diff --git a/app/src/main/java/com/cappielloantonio/play/ui/activity/MainActivity.java b/app/src/main/java/com/cappielloantonio/play/ui/activity/MainActivity.java index fdf4f262..41f3d9ae 100644 --- a/app/src/main/java/com/cappielloantonio/play/ui/activity/MainActivity.java +++ b/app/src/main/java/com/cappielloantonio/play/ui/activity/MainActivity.java @@ -170,14 +170,14 @@ public class MainActivity extends BaseActivity { @Override public void onStateChanged(@NonNull View view, int state) { switch (state) { - case BottomSheetBehavior.STATE_SETTLING | BottomSheetBehavior.STATE_COLLAPSED: - PlayerBottomSheetFragment playerBottomSheetFragment = (PlayerBottomSheetFragment) getSupportFragmentManager().findFragmentByTag("PlayerBottomSheet"); - if (playerBottomSheetFragment == null) break; - playerBottomSheetFragment.scrollOnTop(); - break; case BottomSheetBehavior.STATE_HIDDEN: MusicPlayerRemote.quitPlaying(); break; + case BottomSheetBehavior.STATE_COLLAPSED: + case BottomSheetBehavior.STATE_SETTLING: + PlayerBottomSheetFragment playerBottomSheetFragment = (PlayerBottomSheetFragment) getSupportFragmentManager().findFragmentByTag("PlayerBottomSheet"); + if (playerBottomSheetFragment != null) playerBottomSheetFragment.scrollOnTop(); + break; } } @@ -188,7 +188,6 @@ public class MainActivity extends BaseActivity { return; } else { - float condensedSlideOffset = Math.max(0.0f, Math.min(0.2f, slideOffset - 0.2f)) / 0.2f; playerBottomSheetFragment.getPlayerHeader().setAlpha(1 - condensedSlideOffset); playerBottomSheetFragment.getPlayerHeader().setVisibility(condensedSlideOffset > 0.99 ? View.GONE : View.VISIBLE);