Fixed DetailListFragment AppBarLayout

This commit is contained in:
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.Album
import code.name.monkey.retromusic.model.Artist import code.name.monkey.retromusic.model.Artist
import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.RetroUtil
import com.google.android.material.shape.MaterialShapeDrawable
import com.google.android.material.transition.MaterialSharedAxis import com.google.android.material.transition.MaterialSharedAxis
class DetailListFragment : AbsMainActivityFragment(R.layout.fragment_playlist_detail), 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) returnTransition = MaterialSharedAxis(MaterialSharedAxis.Y, false)
} }
} }
binding.appBarLayout.statusBarForeground =
MaterialShapeDrawable.createWithElevationOverlay(requireContext())
postponeEnterTransition() postponeEnterTransition()
view.doOnPreDraw { startPostponedEnterTransition() } view.doOnPreDraw { startPostponedEnterTransition() }
} }

View file

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

View file

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