mirror of
https://github.com/cmclark00/RetroMusicPlayer.git
synced 2025-05-19 08:35:20 +01:00
backup with notch problem
This commit is contained in:
parent
f31831ea7f
commit
62b12da2ad
70 changed files with 1131 additions and 990 deletions
|
@ -186,7 +186,7 @@ public class AlbumDetailsActivity extends AbsSlidingMusicPanelActivity implement
|
|||
|
||||
if (toolbar != null && !PreferenceUtil.getInstance().getFullScreenMode()) {
|
||||
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams();
|
||||
params.topMargin = RetroUtil.getStatusBarHeight(this);
|
||||
params.topMargin = RetroUtil.getStatusBarHeight( );
|
||||
toolbar.setLayoutParams(params);
|
||||
}
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
|||
|
||||
if (toolbar != null && !PreferenceUtil.getInstance().getFullScreenMode()) {
|
||||
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams();
|
||||
params.topMargin = RetroUtil.getStatusBarHeight(this);
|
||||
params.topMargin = RetroUtil.getStatusBarHeight( );
|
||||
toolbar.setLayoutParams(params);
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ public class LyricsActivity extends AbsMusicServiceActivity implements
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
setDrawUnderStatusBar();
|
||||
setDrawUnderNavigationBar();
|
||||
//setDrawUnderNavigationBar();
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_lyrics);
|
||||
|
|
|
@ -97,8 +97,6 @@ public class MainActivity extends AbsSlidingMusicPanelActivity implements Shared
|
|||
|
||||
getBottomNavigationView().setOnNavigationItemSelectedListener(this);
|
||||
|
||||
drawerLayout.setOnApplyWindowInsetsListener((view, windowInsets) -> windowInsets.replaceSystemWindowInsets(0, 0, 0, 0));
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
selectedFragment(PreferenceUtil.getInstance().getLastPage());
|
||||
//setCurrentFragment(new LibraryFragment(), false, LibraryFragment.TAG);
|
||||
|
@ -277,11 +275,6 @@ public class MainActivity extends AbsSlidingMusicPanelActivity implements Shared
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||
if (key.equals(PreferenceUtil.GENERAL_THEME) ||
|
||||
|
@ -325,11 +318,11 @@ public class MainActivity extends AbsSlidingMusicPanelActivity implements Shared
|
|||
.show();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
|
||||
PreferenceUtil.getInstance().setLastPage(menuItem.getItemId());
|
||||
selectedFragment(menuItem.getItemId());
|
||||
applyInsets();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@ package code.name.monkey.retromusic.ui.activities.base;
|
|||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
|
||||
import com.google.android.gms.cast.framework.CastButtonFactory;
|
||||
import com.google.android.gms.cast.framework.CastContext;
|
||||
import com.google.android.gms.cast.framework.CastSession;
|
||||
import com.google.android.gms.cast.framework.SessionManagerListener;
|
||||
|
@ -11,6 +13,7 @@ import com.google.android.gms.common.GoogleApiAvailability;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.cast.WebServer;
|
||||
|
||||
public abstract class AbsCastActivity extends AbsBaseActivity {
|
||||
|
|
|
@ -1,73 +1,99 @@
|
|||
package code.name.monkey.retromusic.ui.activities.base;
|
||||
|
||||
import android.animation.ArgbEvaluator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.PathInterpolator;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import com.google.android.gms.cast.framework.CastSession;
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
|
||||
import com.sothree.slidinguppanel.SlidingUpPanelLayout.PanelState;
|
||||
|
||||
import androidx.annotation.FloatRange;
|
||||
import androidx.annotation.LayoutRes;
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil;
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil;
|
||||
import code.name.monkey.appthemehelper.util.NavigationViewUtil;
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.cast.CastHelper;
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
||||
import code.name.monkey.retromusic.ui.fragments.MiniPlayerFragment;
|
||||
import code.name.monkey.retromusic.ui.fragments.NowPlayingScreen;
|
||||
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerFragment;
|
||||
import code.name.monkey.retromusic.ui.fragments.player.adaptive.AdaptiveFragment;
|
||||
import code.name.monkey.retromusic.ui.fragments.player.blur.BlurPlayerFragment;
|
||||
import code.name.monkey.retromusic.ui.fragments.player.card.CardFragment;
|
||||
import code.name.monkey.retromusic.ui.fragments.player.cardblur.CardBlurFragment;
|
||||
import code.name.monkey.retromusic.ui.fragments.player.color.ColorFragment;
|
||||
import code.name.monkey.retromusic.ui.fragments.player.fit.FitFragment;
|
||||
import code.name.monkey.retromusic.ui.fragments.player.flat.FlatPlayerFragment;
|
||||
import code.name.monkey.retromusic.ui.fragments.player.full.FullPlayerFragment;
|
||||
import code.name.monkey.retromusic.ui.fragments.player.hmm.HmmPlayerFragment;
|
||||
import code.name.monkey.retromusic.ui.fragments.player.material.MaterialFragment;
|
||||
import code.name.monkey.retromusic.ui.fragments.player.normal.PlayerFragment;
|
||||
import code.name.monkey.retromusic.ui.fragments.player.plain.PlainPlayerFragment;
|
||||
import code.name.monkey.retromusic.ui.fragments.player.simple.SimplePlayerFragment;
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||
import code.name.monkey.retromusic.util.RetroUtil;
|
||||
import code.name.monkey.retromusic.util.ViewUtil;
|
||||
import code.name.monkey.retromusic.views.BottomNavigationBarTinted;
|
||||
import code.name.monkey.retromusic.views.FitSystemWindowsLayout;
|
||||
|
||||
public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivity {
|
||||
public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivity implements
|
||||
SlidingUpPanelLayout.PanelSlideListener, PlayerFragment.Callbacks {
|
||||
|
||||
public static final String TAG = AbsSlidingMusicPanelActivity.class.getSimpleName();
|
||||
|
||||
@BindView(R.id.sliding_layout)
|
||||
SlidingUpPanelLayout slidingUpPanelLayout;
|
||||
|
||||
@BindView(R.id.bottom_navigation)
|
||||
BottomNavigationBarTinted bottomNavigationView;
|
||||
|
||||
@BindView(R.id.parentPanel)
|
||||
ViewGroup parentPanel;
|
||||
|
||||
@BindView(R.id.mini_player_container)
|
||||
ViewGroup miniPlayerContainer;
|
||||
@BindView(R.id.main_content)
|
||||
CoordinatorLayout coordinatorLayout;
|
||||
|
||||
private MiniPlayerFragment miniPlayerFragment;
|
||||
private AbsPlayerFragment playerFragment;
|
||||
private NowPlayingScreen currentNowPlayingScreen;
|
||||
|
||||
private int navigationbarColor;
|
||||
private int taskColor;
|
||||
private boolean lightStatusbar;
|
||||
private boolean lightNavigationBar;
|
||||
private ValueAnimator navigationBarColorAnimator;
|
||||
private ArgbEvaluator argbEvaluator = new ArgbEvaluator();
|
||||
|
||||
protected AbsSlidingMusicPanelActivity() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
setDrawUnderNavigationBar();
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(createContentView());
|
||||
ButterKnife.bind(this);
|
||||
setLightStatusbar(true);
|
||||
setLightNavigationBar(true);
|
||||
//setupBottomView();
|
||||
miniPlayerFragment = (MiniPlayerFragment) getSupportFragmentManager().findFragmentById(R.id.mini_player_fragment);
|
||||
}
|
||||
|
||||
private void setupBottomView() {
|
||||
bottomNavigationView.setBackgroundColor(ThemeStore.primaryColor(this));
|
||||
bottomNavigationView.setSelectedItemId(PreferenceUtil.getInstance().getLastPage());
|
||||
|
||||
int iconColor = ATHUtil.resolveColor(this, R.attr.iconColor);
|
||||
int accentColor = ThemeStore.accentColor(this);
|
||||
NavigationViewUtil.setItemIconColors(bottomNavigationView, ColorUtil.withAlpha(iconColor, 0.5f), accentColor);
|
||||
NavigationViewUtil.setItemTextColors(bottomNavigationView, ColorUtil.withAlpha(iconColor, 0.5f), accentColor);
|
||||
|
||||
bottomNavigationView.setLabelVisibilityMode(PreferenceUtil.getInstance().getTabTitleMode());
|
||||
//bottomNavigationView.getMenu().removeItem(R.id.action_playlist);
|
||||
checkDisplayCutout();
|
||||
choosFragmentForTheme();
|
||||
setupSlidingUpPanel();
|
||||
}
|
||||
|
||||
public void setBottomBarVisibility(int gone) {
|
||||
if (bottomNavigationView != null) {
|
||||
bottomNavigationView.setVisibility(gone);
|
||||
hideBottomBar(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,14 +102,15 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
@Override
|
||||
public void onServiceConnected() {
|
||||
super.onServiceConnected();
|
||||
if (!MusicPlayerRemote.getPlayingQueue().isEmpty())
|
||||
parentPanel.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
if (!MusicPlayerRemote.getPlayingQueue().isEmpty()) {
|
||||
slidingUpPanelLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
parentPanel.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
slidingUpPanelLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
hideBottomBar(false);
|
||||
}
|
||||
});
|
||||
} // don't call hideBottomBar(true) here as it causes a bug with the SlidingUpPanelLayout
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -93,7 +120,28 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
}
|
||||
|
||||
public void hideBottomBar(final boolean hide) {
|
||||
miniPlayerContainer.setVisibility(hide ? View.GONE : View.VISIBLE);
|
||||
//int heightOfBarWithTabs = getResources().getDimensionPixelSize(R.dimen.mini_player_height_expanded) + RetroUtil.getNavigationBarHeight(getResources());
|
||||
int height = RetroUtil.checkNavigationBarHeight() ? getResources().getDimensionPixelSize(R.dimen.mini_player_height) : getResources().getDimensionPixelSize(R.dimen.mini_player_height);
|
||||
int heightOfBar = getResources().getDimensionPixelSize(R.dimen.mini_player_height) + RetroUtil.getNavigationBarHeight(this);
|
||||
int heightOfBarWithTabs =
|
||||
getResources().getDimensionPixelSize(R.dimen.mini_player_height_expanded) +
|
||||
RetroUtil.getNavigationBarHeight(this);
|
||||
if (hide) {
|
||||
slidingUpPanelLayout.setPanelHeight(0);
|
||||
collapsePanel();
|
||||
} else {
|
||||
if (!MusicPlayerRemote.getPlayingQueue().isEmpty()) {
|
||||
slidingUpPanelLayout.setPanelHeight(bottomNavigationView.getVisibility() == View.VISIBLE ? heightOfBarWithTabs : heightOfBar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void checkDisplayCutout() {
|
||||
WindowManager.LayoutParams attrs = getWindow().getAttributes();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
attrs.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected View wrapSlidingMusicPanel(@LayoutRes int resId) {
|
||||
|
@ -106,13 +154,18 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (handleBackPress()) {
|
||||
if (!handleBackPress())
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean handleBackPress() {
|
||||
return true;
|
||||
if (slidingUpPanelLayout.getPanelHeight() != 0 && playerFragment.onBackPressed())
|
||||
return true;
|
||||
if (getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED) {
|
||||
collapsePanel();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -128,7 +181,7 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
@Override
|
||||
public void showCastMiniController() {
|
||||
super.showCastMiniController();
|
||||
MusicPlayerRemote.setZeroVolume();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -138,8 +191,8 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
if (castSession == null) {
|
||||
return;
|
||||
}
|
||||
//MusicPlayerRemote.pauseSong();
|
||||
CastHelper.startCasting(castSession, MusicPlayerRemote.getCurrentSong());
|
||||
//MusicPlayerRemote.setZeroVolume();
|
||||
//CastHelper.startCasting(castSession, MusicPlayerRemote.getCurrentSong());
|
||||
}
|
||||
|
||||
public void toggleBottomNavigationView(boolean toggle) {
|
||||
|
@ -150,4 +203,311 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
return bottomNavigationView;
|
||||
}
|
||||
|
||||
public SlidingUpPanelLayout getSlidingUpPanelLayout() {
|
||||
return slidingUpPanelLayout;
|
||||
}
|
||||
|
||||
public AbsPlayerFragment getPlayerFragment() {
|
||||
return playerFragment;
|
||||
}
|
||||
|
||||
protected void setupSlidingUpPanel() {
|
||||
slidingUpPanelLayout.getViewTreeObserver()
|
||||
.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
slidingUpPanelLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
|
||||
if (getPanelState() == PanelState.EXPANDED) {
|
||||
onPanelSlide(slidingUpPanelLayout, 1);
|
||||
onPanelExpanded(slidingUpPanelLayout);
|
||||
} else if (getPanelState() == PanelState.COLLAPSED) {
|
||||
onPanelCollapsed(slidingUpPanelLayout);
|
||||
} else {
|
||||
playerFragment.onHide();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
slidingUpPanelLayout.addPanelSlideListener(this);
|
||||
|
||||
applyInsets();
|
||||
}
|
||||
|
||||
protected void applyInsets() {
|
||||
ViewCompat.setOnApplyWindowInsetsListener(coordinatorLayout, (v, insets) -> {
|
||||
//Bottom navigation view
|
||||
ViewGroup.MarginLayoutParams bParams = (ViewGroup.MarginLayoutParams) bottomNavigationView.getLayoutParams();
|
||||
if (!PreferenceUtil.getInstance().getFullScreenMode())
|
||||
bParams.bottomMargin = insets.getSystemWindowInsetBottom();
|
||||
bParams.rightMargin = insets.getSystemWindowInsetRight();
|
||||
bParams.leftMargin = insets.getSystemWindowInsetLeft();
|
||||
|
||||
|
||||
//For now playing screen
|
||||
FrameLayout layout = findViewById(R.id.safeArea);
|
||||
if (layout != null) {
|
||||
ViewGroup.MarginLayoutParams fParams = (ViewGroup.MarginLayoutParams) layout.getLayoutParams();
|
||||
if (!PreferenceUtil.getInstance().getFullScreenMode()) {
|
||||
fParams.topMargin = insets.getSystemWindowInsetTop();
|
||||
fParams.bottomMargin = insets.getSystemWindowInsetBottom();
|
||||
}
|
||||
fParams.leftMargin = insets.getSystemWindowInsetLeft();
|
||||
fParams.rightMargin = insets.getSystemWindowInsetRight();
|
||||
}
|
||||
|
||||
//Mini player
|
||||
FitSystemWindowsLayout miniPlayer = (FitSystemWindowsLayout) miniPlayerFragment.getView();
|
||||
if (miniPlayer != null) {
|
||||
ViewGroup.MarginLayoutParams mParams = (ViewGroup.MarginLayoutParams) miniPlayer.getLayoutParams();
|
||||
mParams.bottomMargin = insets.getSystemWindowInsetBottom();//RetroUtil.checkNavigationBarHeight() ? 0 : getResources().getDimensionPixelSize(R.dimen.mini_player_height);
|
||||
mParams.leftMargin = insets.getSystemWindowInsetLeft();
|
||||
mParams.rightMargin = insets.getSystemWindowInsetRight();
|
||||
}
|
||||
|
||||
//For Library, Folder, Home etc
|
||||
ViewGroup viewGroup = findViewById(R.id.content_container);
|
||||
if (viewGroup != null) {
|
||||
ViewGroup.MarginLayoutParams mParams = (ViewGroup.MarginLayoutParams) viewGroup.getLayoutParams();
|
||||
mParams.leftMargin = insets.getSystemWindowInsetLeft();
|
||||
mParams.rightMargin = insets.getSystemWindowInsetRight();
|
||||
mParams.bottomMargin = insets.getSystemWindowInsetBottom();
|
||||
}
|
||||
|
||||
FrameLayout frameLayout = findViewById(R.id.sliding_panel);
|
||||
if (frameLayout != null) {
|
||||
ViewGroup.MarginLayoutParams mParams = (ViewGroup.MarginLayoutParams) frameLayout.getLayoutParams();
|
||||
mParams.leftMargin = insets.getSystemWindowInsetLeft();
|
||||
mParams.rightMargin = insets.getSystemWindowInsetRight();
|
||||
if (!PreferenceUtil.getInstance().getFullScreenMode()) {
|
||||
mParams.bottomMargin = insets.getSystemWindowInsetBottom();
|
||||
}
|
||||
}
|
||||
|
||||
coordinatorLayout.setOnApplyWindowInsetsListener(null);
|
||||
return insets.consumeSystemWindowInsets();
|
||||
});
|
||||
}
|
||||
|
||||
public SlidingUpPanelLayout.PanelState getPanelState() {
|
||||
return slidingUpPanelLayout == null ? null : slidingUpPanelLayout.getPanelState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPanelSlide(View panel, float slideOffset) {
|
||||
bottomNavigationView.setTranslationY(slideOffset * 400);
|
||||
setMiniPlayerAlphaProgress(slideOffset);
|
||||
if (navigationBarColorAnimator != null) navigationBarColorAnimator.cancel();
|
||||
super.setNavigationbarColor((int) argbEvaluator.evaluate(slideOffset, navigationbarColor, Color.TRANSPARENT));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPanelStateChanged(View panel, PanelState previousState, PanelState newState) {
|
||||
switch (newState) {
|
||||
case COLLAPSED:
|
||||
onPanelCollapsed(panel);
|
||||
break;
|
||||
case EXPANDED:
|
||||
onPanelExpanded(panel);
|
||||
break;
|
||||
case ANCHORED:
|
||||
collapsePanel(); // this fixes a bug where the panel would get stuck for some reason
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onPanelCollapsed(View panel) {
|
||||
// restore values
|
||||
super.setLightStatusbar(lightStatusbar);
|
||||
super.setTaskDescriptionColor(taskColor);
|
||||
super.setNavigationbarColor(ThemeStore.primaryColor(this));
|
||||
super.setLightNavigationBar(lightNavigationBar);
|
||||
|
||||
playerFragment.setMenuVisibility(false);
|
||||
playerFragment.setUserVisibleHint(false);
|
||||
playerFragment.onHide();
|
||||
}
|
||||
|
||||
public void onPanelExpanded(View panel) {
|
||||
int playerFragmentColor = playerFragment.getPaletteColor();
|
||||
|
||||
super.setTaskDescriptionColor(playerFragmentColor);
|
||||
if (currentNowPlayingScreen == NowPlayingScreen.COLOR) {
|
||||
super.setNavigationbarColor(playerFragmentColor);
|
||||
} else {
|
||||
super.setNavigationbarColor(Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
onPaletteColorChanged();
|
||||
playerFragment.setMenuVisibility(true);
|
||||
playerFragment.setUserVisibleHint(true);
|
||||
playerFragment.onShow();
|
||||
|
||||
}
|
||||
|
||||
private void setMiniPlayerAlphaProgress(@FloatRange(from = 0, to = 1) float progress) {
|
||||
if (miniPlayerFragment.getView() == null) return;
|
||||
float alpha = 1 - progress;
|
||||
miniPlayerFragment.getView().setAlpha(alpha);
|
||||
// necessary to make the views below clickable
|
||||
miniPlayerFragment.getView().setVisibility(alpha == 0 ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
private void choosFragmentForTheme() {
|
||||
currentNowPlayingScreen = PreferenceUtil.getInstance().getNowPlayingScreen();
|
||||
|
||||
Fragment fragment; // must implement AbsPlayerFragment
|
||||
switch (currentNowPlayingScreen) {
|
||||
case MATERIAL:
|
||||
fragment = new MaterialFragment();
|
||||
break;
|
||||
case BLUR:
|
||||
fragment = new BlurPlayerFragment();
|
||||
break;
|
||||
case FLAT:
|
||||
fragment = new FlatPlayerFragment();
|
||||
break;
|
||||
case PLAIN:
|
||||
fragment = new PlainPlayerFragment();
|
||||
break;
|
||||
case FULL:
|
||||
fragment = new FullPlayerFragment();
|
||||
break;
|
||||
case COLOR:
|
||||
fragment = new ColorFragment();
|
||||
break;
|
||||
case CARD:
|
||||
fragment = new CardFragment();
|
||||
break;
|
||||
case SIMPLE:
|
||||
fragment = new SimplePlayerFragment();
|
||||
break;
|
||||
case TINY:
|
||||
fragment = new HmmPlayerFragment();
|
||||
break;
|
||||
case BLUR_CARD:
|
||||
fragment = new CardBlurFragment();
|
||||
break;
|
||||
case ADAPTIVE:
|
||||
fragment = new AdaptiveFragment();
|
||||
break;
|
||||
case FIT:
|
||||
fragment = new FitFragment();
|
||||
break;
|
||||
case NORMAL:
|
||||
default:
|
||||
fragment = new PlayerFragment();
|
||||
break;
|
||||
}
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.player_fragment_container, fragment).commit();
|
||||
getSupportFragmentManager().executePendingTransactions();
|
||||
|
||||
playerFragment = (AbsPlayerFragment) getSupportFragmentManager().findFragmentById(R.id.player_fragment_container);
|
||||
miniPlayerFragment = (MiniPlayerFragment) getSupportFragmentManager().findFragmentById(R.id.mini_player_fragment);
|
||||
|
||||
//noinspection ConstantConditions
|
||||
miniPlayerFragment.getView().setOnClickListener(v -> expandPanel());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (currentNowPlayingScreen != PreferenceUtil.getInstance().getNowPlayingScreen()) {
|
||||
postRecreate();
|
||||
}
|
||||
}
|
||||
|
||||
public void setAntiDragView(View antiDragView) {
|
||||
//slidingUpPanelLayout.setAntiDragView(antiDragView);
|
||||
}
|
||||
|
||||
public void collapsePanel() {
|
||||
slidingUpPanelLayout.setPanelState(PanelState.COLLAPSED);
|
||||
}
|
||||
|
||||
public void expandPanel() {
|
||||
slidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.EXPANDED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPaletteColorChanged() {
|
||||
if (getPanelState() == PanelState.EXPANDED) {
|
||||
int paletteColor = playerFragment.getPaletteColor();
|
||||
boolean isColorLight = ColorUtil.isColorLight(paletteColor);
|
||||
super.setTaskDescriptionColor(paletteColor);
|
||||
if ((currentNowPlayingScreen == NowPlayingScreen.FLAT || currentNowPlayingScreen == NowPlayingScreen.NORMAL) && PreferenceUtil.getInstance().getAdaptiveColor()) {
|
||||
super.setLightNavigationBar(true);
|
||||
super.setLightStatusbar(isColorLight);
|
||||
} else if (currentNowPlayingScreen == NowPlayingScreen.COLOR) {
|
||||
super.setLightStatusbar(isColorLight);
|
||||
super.setLightNavigationBar(isColorLight);
|
||||
} else if (currentNowPlayingScreen == NowPlayingScreen.BLUR || currentNowPlayingScreen == NowPlayingScreen.BLUR_CARD) {
|
||||
super.setLightStatusbar(false);
|
||||
} else if (currentNowPlayingScreen == NowPlayingScreen.CARD || currentNowPlayingScreen == NowPlayingScreen.FULL) {
|
||||
super.setNavigationbarColor(Color.TRANSPARENT);
|
||||
super.setLightStatusbar(false);
|
||||
} else if (currentNowPlayingScreen == NowPlayingScreen.FIT) {
|
||||
super.setNavigationbarColor(Color.TRANSPARENT);
|
||||
super.setLightStatusbar(false);
|
||||
} else {
|
||||
boolean isTheme = isOneOfTheseThemes() && ColorUtil.isColorLight(ThemeStore.primaryColor(this));
|
||||
super.setStatusbarColor(Color.TRANSPARENT);
|
||||
super.setLightStatusbar(isTheme);
|
||||
super.setLightNavigationBar(isTheme);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isOneOfTheseThemes() {
|
||||
return currentNowPlayingScreen == NowPlayingScreen.FLAT
|
||||
|| currentNowPlayingScreen == NowPlayingScreen.PLAIN
|
||||
|| currentNowPlayingScreen == NowPlayingScreen.SIMPLE
|
||||
|| currentNowPlayingScreen == NowPlayingScreen.NORMAL
|
||||
|| currentNowPlayingScreen == NowPlayingScreen.ADAPTIVE
|
||||
|| currentNowPlayingScreen == NowPlayingScreen.TINY
|
||||
|| currentNowPlayingScreen == NowPlayingScreen.MATERIAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLightStatusbar(boolean enabled) {
|
||||
lightStatusbar = enabled;
|
||||
if (getPanelState() == PanelState.COLLAPSED) {
|
||||
super.setLightStatusbar(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLightNavigationBar(boolean enabled) {
|
||||
lightNavigationBar = enabled;
|
||||
if (getPanelState() == PanelState.COLLAPSED) {
|
||||
super.setLightNavigationBar(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNavigationbarColor(int color) {
|
||||
this.navigationbarColor = color;
|
||||
if (getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
|
||||
if (navigationBarColorAnimator != null) navigationBarColorAnimator.cancel();
|
||||
super.setNavigationbarColor(color);
|
||||
}
|
||||
}
|
||||
|
||||
private void animateNavigationBarColor(int color) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
if (navigationBarColorAnimator != null) navigationBarColorAnimator.cancel();
|
||||
navigationBarColorAnimator = ValueAnimator
|
||||
.ofArgb(getWindow().getNavigationBarColor(), color)
|
||||
.setDuration(ViewUtil.RETRO_MUSIC_ANIM_TIME);
|
||||
navigationBarColorAnimator.setInterpolator(new PathInterpolator(0.4f, 0f, 1f, 1f));
|
||||
navigationBarColorAnimator.addUpdateListener(animation -> AbsSlidingMusicPanelActivity.super.setNavigationbarColor((Integer) animation.getAnimatedValue()));
|
||||
navigationBarColorAnimator.start();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (navigationBarColorAnimator != null) navigationBarColorAnimator.cancel(); // just in case
|
||||
}
|
||||
}
|
|
@ -89,11 +89,7 @@ public abstract class AbsThemeActivity extends ATHActivity implements Runnable {
|
|||
}
|
||||
|
||||
public void setDrawUnderNavigationBar() {
|
||||
if (VersionUtils.hasLollipop()) {
|
||||
RetroUtil.setAllowDrawUnderNavigationBar(getWindow());
|
||||
} else if (VersionUtils.hasKitKat()) {
|
||||
RetroUtil.setStatusBarTranslucent(getWindow());
|
||||
}
|
||||
RetroUtil.setAllowDrawUnderNavigationBar(getWindow());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -174,7 +170,7 @@ public abstract class AbsThemeActivity extends ATHActivity implements Runnable {
|
|||
}
|
||||
|
||||
public void setImmersiveFullscreen() {
|
||||
int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
|
|
|
@ -80,7 +80,7 @@ public class MiniPlayerFragment extends AbsMusicServiceFragment implements Music
|
|||
//noinspection ConstantConditions
|
||||
view.setBackgroundColor(ThemeStore.primaryColor(getContext()));
|
||||
view.setOnTouchListener(new FlingPlayBackController(getActivity()));
|
||||
view.setOnClickListener(v -> NavigationUtil.gotoNowPlayingActivity(getContext()));
|
||||
//view.setOnClickListener(v -> NavigationUtil.gotoNowPlayingActivity(getContext()));
|
||||
setUpMiniPlayer();
|
||||
|
||||
if (RetroUtil.isTablet()) {
|
||||
|
|
|
@ -2,24 +2,24 @@ package code.name.monkey.retromusic.ui.fragments;
|
|||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import code.name.monkey.retromusic.R;
|
||||
|
||||
|
||||
public enum NowPlayingScreen {
|
||||
NORMAL(R.string.normal, R.drawable.np_normal, 0),
|
||||
|
||||
ADAPTIVE(R.string.adaptive, R.drawable.np_adaptive, 10),
|
||||
BLUR(R.string.blur, R.drawable.np_blur, 4),
|
||||
CARD(R.string.card, R.drawable.np_card, 6),
|
||||
COLOR(R.string.color, R.drawable.np_color, 5),
|
||||
BLUR_CARD(R.string.blur_card, R.drawable.np_blur_card, 9),
|
||||
FIT(R.string.fit, R.drawable.np_adaptive, 12),
|
||||
FLAT(R.string.flat, R.drawable.np_flat, 1),
|
||||
FULL(R.string.full, R.drawable.np_full, 2),
|
||||
PLAIN(R.string.plain, R.drawable.np_plain, 3),
|
||||
BLUR(R.string.blur, R.drawable.np_blur, 4),
|
||||
COLOR(R.string.color, R.drawable.np_color, 5),
|
||||
CARD(R.string.card, R.drawable.np_card, 6),
|
||||
TINY(R.string.tiny, R.drawable.np_tiny, 7),
|
||||
SIMPLE(R.string.simple, R.drawable.np_simple, 8),
|
||||
BLUR_CARD(R.string.blur_card, R.drawable.np_blur_card, 9),
|
||||
ADAPTIVE(R.string.adaptive, R.drawable.np_adaptive, 10),
|
||||
MATERIAL(R.string.material, R.drawable.np_material, 11),
|
||||
FIT(R.string.fit, R.drawable.np_adaptive, 12);
|
||||
NORMAL(R.string.normal, R.drawable.np_normal, 0),
|
||||
PLAIN(R.string.plain, R.drawable.np_plain, 3),
|
||||
SIMPLE(R.string.simple, R.drawable.np_simple, 8);
|
||||
|
||||
@StringRes
|
||||
public final int titleRes;
|
||||
|
|
|
@ -34,6 +34,7 @@ import code.name.monkey.retromusic.util.MusicUtil;
|
|||
import code.name.monkey.retromusic.util.NavigationUtil;
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||
import code.name.monkey.retromusic.util.RetroUtil;
|
||||
import code.name.monkey.retromusic.util.SystemUtils;
|
||||
import code.name.monkey.retromusic.views.FitSystemWindowsLayout;
|
||||
|
||||
public abstract class AbsPlayerFragment extends AbsMusicServiceFragment implements Toolbar.OnMenuItemClickListener, PaletteColorHolder {
|
||||
|
@ -55,8 +56,11 @@ public abstract class AbsPlayerFragment extends AbsMusicServiceFragment implemen
|
|||
protected void addSafeArea(View view) {
|
||||
FitSystemWindowsLayout safeArea = view.findViewById(R.id.safeArea);
|
||||
if (safeArea != null) {
|
||||
if (PreferenceUtil.getInstance().getFullScreenMode()) safeArea.setFit(false);
|
||||
else safeArea.setFit(true);
|
||||
//ViewGroup.MarginLayoutParams params = ((ViewGroup.MarginLayoutParams) safeArea.getLayoutParams());
|
||||
//params.topMargin = RetroUtil.getStatusBarHeight();
|
||||
//params.bottomMargin = RetroUtil.getNavigationBarHeight();
|
||||
//if (PreferenceUtil.getInstance().getFullScreenMode()) safeArea.setFit(false);
|
||||
//else safeArea.setFit(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -227,4 +231,5 @@ public abstract class AbsPlayerFragment extends AbsMusicServiceFragment implemen
|
|||
|
||||
void onPaletteColorChanged();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
|||
@BindView(R.id.fragment_container)
|
||||
View contentContainer;
|
||||
|
||||
|
||||
private Unbinder unBinder;
|
||||
private MaterialCab cab;
|
||||
private FragmentManager fragmentManager;
|
||||
|
@ -110,6 +111,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
|||
setStatusbarColorAuto(view);
|
||||
setupToolbar();
|
||||
inflateFragment();
|
||||
|
||||
}
|
||||
|
||||
private void inflateFragment() {
|
||||
|
@ -142,13 +144,14 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
|||
TintHelper.setTintAuto(contentContainer, primaryColor, true);
|
||||
|
||||
toolbar.setBackgroundColor(primaryColor);
|
||||
toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
|
||||
appbar.setBackgroundColor(primaryColor);
|
||||
appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
|
||||
getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext())));
|
||||
getMainActivity().setTitle(null);
|
||||
getMainActivity().setSupportActionBar(toolbar);
|
||||
toolbar.setNavigationOnClickListener(v -> showMainMenu());
|
||||
toolbar.setNavigationOnClickListener(v -> NavigationUtil.goToSearch(getMainActivity()));
|
||||
toolbar.setOnClickListener(v -> showMainMenu());
|
||||
toolbar.setNavigationIcon(RetroUtil.getTintedDrawable(getMainActivity(), R.drawable.ic_search_white_24dp, ThemeStore.textColorPrimary(getMainActivity())));
|
||||
}
|
||||
|
||||
private Fragment getCurrentFragment() {
|
||||
|
@ -363,9 +366,6 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
|||
MusicPlayerRemote.openAndShuffleQueue(SongLoader.getAllSongs(getContext())
|
||||
.blockingFirst(), true);
|
||||
return true;
|
||||
case R.id.action_search:
|
||||
NavigationUtil.goToSearch(getMainActivity());
|
||||
break;
|
||||
case R.id.action_equalizer:
|
||||
NavigationUtil.openEqualizer(getActivity());
|
||||
return true;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package code.name.monkey.retromusic.ui.fragments.mainactivity.home;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
|
@ -11,12 +10,9 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.google.android.material.appbar.CollapsingToolbarLayout;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
@ -35,7 +31,6 @@ import butterknife.ButterKnife;
|
|||
import butterknife.OnClick;
|
||||
import butterknife.Unbinder;
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil;
|
||||
import code.name.monkey.appthemehelper.util.TintHelper;
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
||||
|
@ -75,9 +70,9 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
|
|||
@BindView(R.id.toolbar)
|
||||
Toolbar toolbar;
|
||||
|
||||
@BindView(R.id.app_bar)
|
||||
/*@BindView(R.id.app_bar)
|
||||
AppBarLayout appbar;
|
||||
|
||||
*/
|
||||
@BindView(R.id.image)
|
||||
@Nullable
|
||||
ImageView imageView;
|
||||
|
@ -85,8 +80,8 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
|
|||
@BindView(R.id.user_image)
|
||||
CircularImageView userImage;
|
||||
|
||||
@BindView(R.id.collapsing_toolbar)
|
||||
CollapsingToolbarLayout toolbarLayout;
|
||||
/* @BindView(R.id.collapsing_toolbar)
|
||||
CollapsingToolbarLayout toolbarLayout;*/
|
||||
|
||||
@BindView(R.id.recycler_view)
|
||||
RecyclerView recentArtistRV;
|
||||
|
@ -121,18 +116,12 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
|
|||
@BindView(R.id.container)
|
||||
View container;
|
||||
|
||||
@BindView(R.id.title)
|
||||
TextView title;
|
||||
|
||||
@BindView(R.id.suggestion_songs)
|
||||
RecyclerView suggestionsSongs;
|
||||
|
||||
@BindView(R.id.suggestion_container)
|
||||
LinearLayout suggestionsContainer;
|
||||
|
||||
@BindView(R.id.search_icon)
|
||||
ImageView searchIcon;
|
||||
|
||||
private Unbinder unbinder;
|
||||
private HomePresenter homePresenter;
|
||||
private CompositeDisposable disposable;
|
||||
|
@ -241,18 +230,13 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
|
|||
private void setupToolbar() {
|
||||
int primaryColor = ThemeStore.primaryColor(getContext());
|
||||
TintHelper.setTintAuto(container, primaryColor, true);
|
||||
|
||||
toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
|
||||
toolbar.setBackgroundColor(primaryColor);
|
||||
appbar.setBackgroundColor(primaryColor);
|
||||
appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
|
||||
getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext())));
|
||||
userImage.setOnClickListener(v -> showMainMenu());
|
||||
|
||||
getActivity().setTitle(null);
|
||||
getMainActivity().setSupportActionBar(toolbar);
|
||||
toolbar.setNavigationIcon(RetroUtil.getTintedDrawable(getMainActivity(), R.drawable.ic_menu_white_24dp, ThemeStore.textColorPrimary(getMainActivity())));
|
||||
toolbar.setOnClickListener(v -> NavigationUtil.goToSearch(getMainActivity()));
|
||||
toolbar.setNavigationOnClickListener(v -> showMainMenu());
|
||||
title.setTextColor(ThemeStore.textColorPrimary(getContext()));
|
||||
searchIcon.setImageTintList(ColorStateList.valueOf(ThemeStore.accentColor(getContext())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -346,7 +330,6 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
|
|||
Display display = getMainActivity().getWindowManager().getDefaultDisplay();
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
display.getMetrics(metrics);
|
||||
|
||||
return metrics;
|
||||
}
|
||||
|
||||
|
@ -360,7 +343,7 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
|
|||
}
|
||||
|
||||
@OnClick({R.id.last_added, R.id.top_played, R.id.action_shuffle, R.id.history,
|
||||
R.id.user_image, R.id.search})
|
||||
R.id.user_image})
|
||||
void startUserInfo(View view) {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null) {
|
||||
|
@ -380,12 +363,7 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
|
|||
case R.id.user_image:
|
||||
NavigationUtil.goToUserInfo(getActivity());
|
||||
break;
|
||||
case R.id.search:
|
||||
NavigationUtil.goToSearch(activity);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -107,11 +107,6 @@ public class AdaptiveFragment extends AbsPlayerFragment implements Callbacks {
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_adaptive_player, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColorAuto();
|
||||
addSafeArea(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
|
@ -162,5 +157,4 @@ public class AdaptiveFragment extends AbsPlayerFragment implements Callbacks {
|
|||
updateIsFavorite();
|
||||
updateSong();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -140,11 +140,6 @@ public class BlurPlayerFragment extends AbsPlayerFragment implements PlayerAlbum
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_blur, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColor(Color.TRANSPARENT);
|
||||
addSafeArea(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -160,12 +160,7 @@ public class CardFragment extends AbsPlayerFragment implements PlayerAlbumCoverF
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_card_player, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColor(Color.TRANSPARENT);
|
||||
addSafeArea(view);
|
||||
}
|
||||
return view;
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -122,11 +122,6 @@ public class CardBlurFragment extends AbsPlayerFragment implements
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_card_blur_player, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColor(Color.TRANSPARENT);
|
||||
addSafeArea(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ import android.animation.ValueAnimator;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
@ -136,10 +135,6 @@ public class ColorFragment extends AbsPlayerFragment {
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_color_player, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
addSafeArea(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,11 +88,7 @@ public class FlatPlayerFragment extends AbsPlayerFragment implements
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_flat_player, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
//getPlayerActivity().setNavigationbarColorAuto();
|
||||
addSafeArea(view);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ public class FullPlayerFragment extends AbsPlayerFragment implements PlayerAlbum
|
|||
@BindView(R.id.player_toolbar)
|
||||
Toolbar toolbar;
|
||||
|
||||
Unbinder unbinder;
|
||||
private Unbinder unbinder;
|
||||
|
||||
private int lastColor;
|
||||
private FullPlaybackControlsFragment fullPlaybackControlsFragment;
|
||||
|
@ -42,11 +42,7 @@ public class FullPlayerFragment extends AbsPlayerFragment implements PlayerAlbum
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_full, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColor(Color.TRANSPARENT);
|
||||
addSafeArea(view);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,11 +99,7 @@ public class HmmPlayerFragment extends AbsPlayerFragment implements
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_hmm_player, container, false);
|
||||
unBinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColor(Color.TRANSPARENT);
|
||||
addSafeArea(view);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -108,11 +108,6 @@ public class MaterialFragment extends AbsPlayerFragment implements PlayerAlbumCo
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_material, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColorAuto();
|
||||
addSafeArea(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ import butterknife.BindView;
|
|||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil;
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil;
|
||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
||||
|
@ -136,10 +135,7 @@ public class PlayerFragment extends AbsPlayerFragment implements PlayerAlbumCove
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_player, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
addSafeArea(view);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -75,11 +75,7 @@ public class PlainPlayerFragment extends AbsPlayerFragment implements
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_plain_player, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColorAuto();
|
||||
addSafeArea(view);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,11 +46,6 @@ public class SimplePlayerFragment extends AbsPlayerFragment implements
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_simple_player, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColorAuto();
|
||||
addSafeArea(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue