Fixed DetailListFragment AppBarLayout

main
Prathamesh More 2021-11-08 11:44:24 +05:30
parent 5fa3b8febc
commit 58d71cad8a
3 changed files with 10 additions and 8 deletions

View File

@ -38,6 +38,7 @@ import code.name.monkey.retromusic.interfaces.IArtistClickListener
import code.name.monkey.retromusic.model.Album
import code.name.monkey.retromusic.model.Artist
import code.name.monkey.retromusic.util.RetroUtil
import com.google.android.material.shape.MaterialShapeDrawable
import com.google.android.material.transition.MaterialSharedAxis
class DetailListFragment : AbsMainActivityFragment(R.layout.fragment_playlist_detail),
@ -63,6 +64,8 @@ class DetailListFragment : AbsMainActivityFragment(R.layout.fragment_playlist_de
returnTransition = MaterialSharedAxis(MaterialSharedAxis.Y, false)
}
}
binding.appBarLayout.statusBarForeground =
MaterialShapeDrawable.createWithElevationOverlay(requireContext())
postponeEnterTransition()
view.doOnPreDraw { startPostponedEnterTransition() }
}

View File

@ -63,14 +63,13 @@ class MediaButtonIntentReceiver : BroadcastReceiver() {
when (msg.what) {
MSG_HEADSET_DOUBLE_CLICK_TIMEOUT -> {
val clickCount = msg.arg1
val command: String?
if (DEBUG) Log.v(TAG, "Handling headset click, count = $clickCount")
when (clickCount) {
1 -> command = ACTION_TOGGLE_PAUSE
2 -> command = ACTION_SKIP
3 -> command = ACTION_REWIND
else -> command = null
val command = when (clickCount) {
1 -> ACTION_TOGGLE_PAUSE
2 -> ACTION_SKIP
3 -> ACTION_REWIND
else -> null
}
if (command != null) {

View File

@ -12,7 +12,8 @@
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:liftOnScroll="true">
app:liftOnScroll="true"
android:fitsSystemWindows="true">
<FrameLayout
android:id="@+id/toolbar_container"
@ -24,7 +25,6 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurface"
app:navigationIcon="@drawable/ic_keyboard_backspace_black"
app:titleTextAppearance="@style/ToolbarTextAppearanceNormal" />
</FrameLayout>