This commit is contained in:
h4h13 2018-08-11 01:18:18 +05:30
parent 74ae7f517e
commit e5774b422c
22 changed files with 756 additions and 637 deletions

View file

@ -171,9 +171,10 @@ public class AlbumDetailsActivity extends AbsSlidingMusicPanelActivity implement
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.artist_image:
Pair<View, String> pair = new Pair<>(artistImage,
getString(R.string.transition_artist_image));
NavigationUtil.goToArtist(this, getAlbum().getArtistId(), pair);
Pair[] artistPairs = new Pair[]{Pair.create(image,
getResources().getString(R.string.transition_artist_image))};
NavigationUtil.goToArtist(this, getAlbum().getArtistId(),
artistPairs);
break;
case R.id.action_shuffle_all:
MusicPlayerRemote.openAndShuffleQueue(album.songs, true);

View file

@ -125,18 +125,19 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
setDrawUnderStatusBar(true);
super.onCreate(bundle);
ButterKnife.bind(this);
supportPostponeEnterTransition();
setBottomBarVisibility(View.GONE);
setNavigationbarColorAuto();
setLightNavigationBar(true);
supportPostponeEnterTransition();
lastFMRestClient = new LastFMRestClient(this);
setUpViews();
int artistID = getIntent().getIntExtra(EXTRA_ARTIST_ID, -1);
artistDetailsPresenter = new ArtistDetailsPresenter(this, artistID);
artistDetailsPresenter = new ArtistDetailsPresenter(this, getIntent().getExtras());
artistDetailsPresenter.subscribe();
}
private void setUpViews() {
@ -232,7 +233,7 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
@Override
protected void onResume() {
super.onResume();
artistDetailsPresenter.subscribe();
}
@Override

View file

@ -0,0 +1 @@
package code.name.monkey.retromusic.ui.activities; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import butterknife.OnClick; import code.name.monkey.retromusic.R; import code.name.monkey.retromusic.RetroApplication; import code.name.monkey.retromusic.ui.activities.base.AbsBaseActivity; public class ErrorHandlerActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_error_handler); } @OnClick(R.id.clear_app_data) void clearAppDate(View view) { RetroApplication.deleteAppData(); } }

View file

@ -37,11 +37,14 @@ public class ProVersionActivity extends AbsBaseActivity implements
private static final String TAG = "ProVersionActivity";
@BindView(R.id.toolbar)
Toolbar toolbar;
@BindView(R.id.restore_button)
View restoreButton;
@BindView(R.id.purchase_button)
View purchaseButton;
@BindView(R.id.app_bar)
AppBarLayout appBar;
@BindView(R.id.status_bar)
View statusBar;

View file

@ -11,6 +11,10 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.animation.PathInterpolator;
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
import com.sothree.slidinguppanel.SlidingUpPanelLayout.PanelState;
import butterknife.BindView;
import butterknife.ButterKnife;
import code.name.monkey.appthemehelper.ThemeStore;
@ -35,399 +39,397 @@ import code.name.monkey.retromusic.ui.fragments.player.simple.SimplePlayerFragme
import code.name.monkey.retromusic.util.PreferenceUtil;
import code.name.monkey.retromusic.util.ViewUtil;
import code.name.monkey.retromusic.views.BottomNavigationViewEx;
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
import com.sothree.slidinguppanel.SlidingUpPanelLayout.PanelState;
public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivity implements
SlidingUpPanelLayout.PanelSlideListener,
PlayerFragment.Callbacks {
SlidingUpPanelLayout.PanelSlideListener,
PlayerFragment.Callbacks {
public static final String TAG = AbsSlidingMusicPanelActivity.class.getSimpleName();
public static final String TAG = AbsSlidingMusicPanelActivity.class.getSimpleName();
@BindView(R.id.bottom_navigation)
BottomNavigationViewEx bottomNavigationView;
@BindView(R.id.sliding_layout)
SlidingUpPanelLayout slidingUpPanelLayout;
@BindView(R.id.bottom_navigation)
BottomNavigationViewEx bottomNavigationView;
@BindView(R.id.sliding_layout)
SlidingUpPanelLayout slidingUpPanelLayout;
private int navigationbarColor;
private int taskColor;
private boolean lightStatusBar;
private boolean lightNavigationBar;
private NowPlayingScreen currentNowPlayingScreen;
private AbsPlayerFragment playerFragment;
private MiniPlayerFragment miniPlayerFragment;
private ValueAnimator navigationBarColorAnimator;
private int navigationbarColor;
private int taskColor;
private boolean lightStatusBar;
private boolean lightNavigationBar;
private NowPlayingScreen currentNowPlayingScreen;
private AbsPlayerFragment playerFragment;
private MiniPlayerFragment miniPlayerFragment;
private ValueAnimator navigationBarColorAnimator;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(createContentView());
ButterKnife.bind(this);
choosFragmentForTheme();
//noinspection ConstantConditions
miniPlayerFragment.getView().setOnClickListener(v -> expandPanel());
slidingUpPanelLayout.getViewTreeObserver()
.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
slidingUpPanelLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(createContentView());
ButterKnife.bind(this);
choosFragmentForTheme();
//noinspection ConstantConditions
miniPlayerFragment.getView().setOnClickListener(v -> expandPanel());
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();
}
}
});
if (getPanelState() == PanelState.EXPANDED) {
onPanelSlide(slidingUpPanelLayout, 1);
onPanelExpanded(slidingUpPanelLayout);
} else if (getPanelState() == PanelState.COLLAPSED) {
onPanelCollapsed(slidingUpPanelLayout);
} else {
playerFragment.onHide();
}
}
});
setupBottomView();
slidingUpPanelLayout.addPanelSlideListener(this);
setupBottomView();
slidingUpPanelLayout.addPanelSlideListener(this);
}
private void choosFragmentForTheme() {
currentNowPlayingScreen = PreferenceUtil.getInstance(this).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 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);
}
private void setupBottomView() {
bottomNavigationView.setSelectedItemId(PreferenceUtil.getInstance(this).getLastPage());
bottomNavigationView.setBackgroundColor(ThemeStore.primaryColor(this));
bottomNavigationView.enableAnimation(false);
bottomNavigationView.enableItemShiftingMode(false);
bottomNavigationView.enableShiftingMode(false);
bottomNavigationView.setTextSize(10f);
bottomNavigationView.setTextVisibility(PreferenceUtil.getInstance(this).tabTitles());
}
@Override
protected void onResume() {
super.onResume();
if (currentNowPlayingScreen != PreferenceUtil.getInstance(this).getNowPlayingScreen()) {
postRecreate();
}
}
@Override
public void onDestroy() {
super.onDestroy();
if (navigationBarColorAnimator != null) {
navigationBarColorAnimator.cancel(); // just in case
}
}
protected abstract View createContentView();
@Override
public void onServiceConnected() {
super.onServiceConnected();
if (!MusicPlayerRemote.getPlayingQueue().isEmpty()) {
slidingUpPanelLayout.getViewTreeObserver()
.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
slidingUpPanelLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
hideBottomBar(false);
}
});
}// don't call hideBottomBar(true) here as it causes a bug with the SlidingUpPanelLayout
}
@Override
public void onQueueChanged() {
super.onQueueChanged();
hideBottomBar(MusicPlayerRemote.getPlayingQueue().isEmpty());
}
@Override
public void onPanelSlide(View panel, @FloatRange(from = 0, to = 1) float slideOffset) {
bottomNavigationView.setTranslationY(slideOffset * 400);
setMiniPlayerAlphaProgress(slideOffset);
//findViewById(R.id.player_fragment_container).setAlpha(slideOffset);
}
@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(navigationbarColor);
super.setLightNavigationBar(lightNavigationBar);
playerFragment.setMenuVisibility(false);
playerFragment.setUserVisibleHint(false);
playerFragment.onHide();
}
public void onPanelExpanded(View panel) {
// setting fragments values
int playerFragmentColor = playerFragment.getPaletteColor();
super.setTaskDescriptionColor(playerFragmentColor);
if (currentNowPlayingScreen == NowPlayingScreen.COLOR) {
super.setNavigationbarColor(playerFragmentColor);
} else {
super.setNavigationbarColor(ThemeStore.primaryColor(this));
}
setLightStatusBar();
private void choosFragmentForTheme() {
currentNowPlayingScreen = PreferenceUtil.getInstance(this).getNowPlayingScreen();
playerFragment.setMenuVisibility(true);
playerFragment.setUserVisibleHint(true);
playerFragment.onShow();
}
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;
private void setLightStatusBar() {
super.setLightStatusbar(!PreferenceUtil.getInstance(this).getAdaptiveColor() &&
ColorUtil.isColorLight(ThemeStore.primaryColor(this)) && (
currentNowPlayingScreen == NowPlayingScreen.FLAT
|| currentNowPlayingScreen == NowPlayingScreen.PLAIN
|| currentNowPlayingScreen == NowPlayingScreen.SIMPLE
|| currentNowPlayingScreen == NowPlayingScreen.NORMAL
|| currentNowPlayingScreen == NowPlayingScreen.ADAPTIVE
|| currentNowPlayingScreen == NowPlayingScreen.TINY
|| currentNowPlayingScreen == NowPlayingScreen.MATERIAL));
}
case NORMAL:
default:
fragment = new PlayerFragment();
break;
}
getSupportFragmentManager().beginTransaction().replace(R.id.player_fragment_container, fragment)
.commit();
getSupportFragmentManager().executePendingTransactions();
@Override
public void setLightStatusbar(boolean enabled) {
lightStatusBar = enabled;
if (getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
super.setLightStatusbar(enabled);
playerFragment = (AbsPlayerFragment) getSupportFragmentManager()
.findFragmentById(R.id.player_fragment_container);
miniPlayerFragment = (MiniPlayerFragment) getSupportFragmentManager()
.findFragmentById(R.id.mini_player_fragment);
}
}
@Override
public void setLightNavigationBar(boolean enabled) {
lightNavigationBar = enabled;
private void setupBottomView() {
bottomNavigationView.setSelectedItemId(PreferenceUtil.getInstance(this).getLastPage());
bottomNavigationView.setBackgroundColor(ThemeStore.primaryColor(this));
bottomNavigationView.enableAnimation(false);
bottomNavigationView.enableItemShiftingMode(false);
bottomNavigationView.enableShiftingMode(false);
bottomNavigationView.setTextSize(10f);
bottomNavigationView.setTextVisibility(PreferenceUtil.getInstance(this).tabTitles());
}
@Override
protected void onResume() {
super.onResume();
if (currentNowPlayingScreen != PreferenceUtil.getInstance(this).getNowPlayingScreen()) {
postRecreate();
}
}
@Override
public void onDestroy() {
super.onDestroy();
if (navigationBarColorAnimator != null) {
navigationBarColorAnimator.cancel(); // just in case
}
}
protected abstract View createContentView();
@Override
public void onServiceConnected() {
super.onServiceConnected();
if (!MusicPlayerRemote.getPlayingQueue().isEmpty()) {
slidingUpPanelLayout.getViewTreeObserver()
.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
slidingUpPanelLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
hideBottomBar(false);
}
});
}// don't call hideBottomBar(true) here as it causes a bug with the SlidingUpPanelLayout
}
@Override
public void onQueueChanged() {
super.onQueueChanged();
hideBottomBar(MusicPlayerRemote.getPlayingQueue().isEmpty());
}
@Override
public void onPanelSlide(View panel, @FloatRange(from = 0, to = 1) float slideOffset) {
bottomNavigationView.setTranslationY(slideOffset * 400);
setMiniPlayerAlphaProgress(slideOffset);
//findViewById(R.id.player_fragment_container).setAlpha(slideOffset);
}
@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(navigationbarColor);
super.setLightNavigationBar(lightNavigationBar);
playerFragment.setMenuVisibility(false);
playerFragment.setUserVisibleHint(false);
playerFragment.onHide();
}
public void onPanelExpanded(View panel) {
// setting fragments values
int playerFragmentColor = playerFragment.getPaletteColor();
super.setTaskDescriptionColor(playerFragmentColor);
if (currentNowPlayingScreen == NowPlayingScreen.COLOR) {
super.setNavigationbarColor(playerFragmentColor);
} else {
super.setNavigationbarColor(ThemeStore.primaryColor(this));
}
setLightStatusBar();
playerFragment.setMenuVisibility(true);
playerFragment.setUserVisibleHint(true);
playerFragment.onShow();
}
private void setLightStatusBar() {
super.setLightStatusbar(!PreferenceUtil.getInstance(this).getAdaptiveColor() &&
ColorUtil.isColorLight(ThemeStore.primaryColor(this)) && (
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() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
super.setLightStatusbar(enabled);
}
}
@Override
public void setLightNavigationBar(boolean enabled) {
lightNavigationBar = enabled;
/*if (getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
super.setLightNavigationBar(enabled);
}*/
}
@Override
public void setTaskDescriptionColor(@ColorInt int color) {
taskColor = color;
if (getPanelState() == null || getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
super.setTaskDescriptionColor(color);
}
}
@Override
public void setNavigationbarColor(int color) {
navigationbarColor = color;
if (getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
if (navigationBarColorAnimator != null) {
navigationBarColorAnimator.cancel();
}
super.setNavigationbarColor(color);
@Override
public void setTaskDescriptionColor(@ColorInt int color) {
taskColor = color;
if (getPanelState() == null || getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
super.setTaskDescriptionColor(color);
}
}
}
@Override
public void onPaletteColorChanged() {
int playerFragmentColor = playerFragment.getPaletteColor();
if (getPanelState() == PanelState.EXPANDED) {
super.setTaskDescriptionColor(playerFragmentColor);
if (currentNowPlayingScreen == NowPlayingScreen.COLOR) {
super.setNavigationbarColor(playerFragmentColor);
}
@Override
public void setNavigationbarColor(int color) {
navigationbarColor = color;
if (getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
if (navigationBarColorAnimator != null) {
navigationBarColorAnimator.cancel();
}
super.setNavigationbarColor(color);
}
}
}
private void setMiniPlayerAlphaProgress(@FloatRange(from = 0, to = 1) float progress) {
if (miniPlayerFragment == null) {
return;
@Override
public void onPaletteColorChanged() {
int playerFragmentColor = playerFragment.getPaletteColor();
if (getPanelState() == PanelState.EXPANDED) {
super.setTaskDescriptionColor(playerFragmentColor);
if (currentNowPlayingScreen == NowPlayingScreen.COLOR) {
super.setNavigationbarColor(playerFragmentColor);
}
}
}
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 setMiniPlayerAlphaProgress(@FloatRange(from = 0, to = 1) float progress) {
if (miniPlayerFragment == 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);
public void hideBottomBar(final boolean hide) {
int heightOfBar =
getResources().getDimensionPixelSize(R.dimen.mini_player_height);
int heightOfBarWithTabs =
getResources().getDimensionPixelSize(R.dimen.mini_player_height_expanded);
if (hide) {
slidingUpPanelLayout.setPanelHeight(0);
collapsePanel();
} else {
if (!MusicPlayerRemote.getPlayingQueue().isEmpty()) {
slidingUpPanelLayout.setPanelHeight(bottomNavigationView.getVisibility() == View.VISIBLE ?
heightOfBarWithTabs : heightOfBar);
}
}
}
public void setBottomBarVisibility(int gone) {
if (bottomNavigationView != null) {
//TransitionManager.beginDelayedTransition(bottomNavigationView);
bottomNavigationView.setVisibility(gone);
hideBottomBar(false);
public void hideBottomBar(final boolean hide) {
int heightOfBar =
getResources().getDimensionPixelSize(R.dimen.mini_player_height);
int heightOfBarWithTabs =
getResources().getDimensionPixelSize(R.dimen.mini_player_height_expanded);
if (hide) {
slidingUpPanelLayout.setPanelHeight(0);
collapsePanel();
} else {
if (!MusicPlayerRemote.getPlayingQueue().isEmpty()) {
slidingUpPanelLayout.setPanelHeight(bottomNavigationView.getVisibility() == View.VISIBLE ?
heightOfBarWithTabs : heightOfBar);
}
}
}
}
protected View wrapSlidingMusicPanel(@LayoutRes int resId) {
@SuppressLint("InflateParams")
View slidingMusicPanelLayout = getLayoutInflater()
.inflate(R.layout.sliding_music_panel_layout, null);
ViewGroup contentContainer = slidingMusicPanelLayout.findViewById(R.id.content_container);
getLayoutInflater().inflate(resId, contentContainer);
return slidingMusicPanelLayout;
}
@Override
public void onBackPressed() {
if (!handleBackPress()) {
super.onBackPressed();
public void setBottomBarVisibility(int gone) {
if (bottomNavigationView != null) {
//TransitionManager.beginDelayedTransition(bottomNavigationView);
bottomNavigationView.setVisibility(gone);
hideBottomBar(false);
}
}
}
public boolean handleBackPress() {
if (slidingUpPanelLayout.getPanelHeight() != 0 && playerFragment.onBackPressed()) {
return true;
protected View wrapSlidingMusicPanel(@LayoutRes int resId) {
@SuppressLint("InflateParams")
View slidingMusicPanelLayout = getLayoutInflater()
.inflate(R.layout.sliding_music_panel_layout, null);
ViewGroup contentContainer = slidingMusicPanelLayout.findViewById(R.id.content_container);
getLayoutInflater().inflate(resId, contentContainer);
return slidingMusicPanelLayout;
}
if (getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED) {
collapsePanel();
return true;
@Override
public void onBackPressed() {
if (!handleBackPress()) {
super.onBackPressed();
}
}
return false;
}
private void animateNavigationBarColor(int color) {
if (navigationBarColorAnimator != null) {
navigationBarColorAnimator.cancel();
public boolean handleBackPress() {
if (slidingUpPanelLayout.getPanelHeight() != 0 && playerFragment.onBackPressed()) {
return true;
}
if (getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED) {
collapsePanel();
return true;
}
return false;
}
navigationBarColorAnimator = ValueAnimator.ofArgb(getWindow().getNavigationBarColor(), color)
.setDuration(ViewUtil.RETRO_MUSIC_ANIM_TIME);
navigationBarColorAnimator.setInterpolator(new PathInterpolator(0.4f, 0f, 1f, 1f));
navigationBarColorAnimator.addUpdateListener(animation -> {
int playerFragmentColorDark = ColorUtil.darkenColor((Integer) animation.getAnimatedValue());
bottomNavigationView.setBackgroundColor(playerFragmentColorDark);
miniPlayerFragment.setColor(playerFragmentColorDark);
AbsSlidingMusicPanelActivity.super.setNavigationbarColor(playerFragmentColorDark);
private void animateNavigationBarColor(int color) {
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 -> {
int playerFragmentColorDark = ColorUtil.darkenColor((Integer) animation.getAnimatedValue());
View view = getWindow().getDecorView().getRootView();
view.setBackgroundColor(playerFragmentColorDark);
bottomNavigationView.setBackgroundColor(playerFragmentColorDark);
miniPlayerFragment.setColor(playerFragmentColorDark);
AbsSlidingMusicPanelActivity.super.setNavigationbarColor(playerFragmentColorDark);
if (view.findViewById(R.id.toolbar) != null) {
view.findViewById(R.id.toolbar).setBackgroundColor(playerFragmentColorDark);
}
if (view.findViewById(R.id.appbar) != null) {
view.findViewById(R.id.appbar).setBackgroundColor(playerFragmentColorDark);
}
if (view.findViewById(R.id.status_bar) != null) {
view.findViewById(R.id.status_bar)
.setBackgroundColor(ColorUtil.darkenColor(playerFragmentColorDark));
}
});
navigationBarColorAnimator.start();
}
View view = getWindow().getDecorView().getRootView();
view.setBackgroundColor(playerFragmentColorDark);
@Override
protected View getSnackBarContainer() {
return findViewById(R.id.content_container);
}
if (view.findViewById(R.id.toolbar) != null) {
view.findViewById(R.id.toolbar).setBackgroundColor(playerFragmentColorDark);
}
if (view.findViewById(R.id.appbar) != null) {
view.findViewById(R.id.appbar).setBackgroundColor(playerFragmentColorDark);
}
if (view.findViewById(R.id.status_bar) != null) {
view.findViewById(R.id.status_bar)
.setBackgroundColor(ColorUtil.darkenColor(playerFragmentColorDark));
}
});
navigationBarColorAnimator.start();
}
public SlidingUpPanelLayout getSlidingUpPanelLayout() {
return slidingUpPanelLayout;
}
@Override
protected View getSnackBarContainer() {
return findViewById(R.id.content_container);
}
public MiniPlayerFragment getMiniPlayerFragment() {
return miniPlayerFragment;
}
public SlidingUpPanelLayout getSlidingUpPanelLayout() {
return slidingUpPanelLayout;
}
public AbsPlayerFragment getPlayerFragment() {
return playerFragment;
}
public MiniPlayerFragment getMiniPlayerFragment() {
return miniPlayerFragment;
}
public BottomNavigationViewEx getBottomNavigationView() {
return bottomNavigationView;
}
public AbsPlayerFragment getPlayerFragment() {
return playerFragment;
}
public SlidingUpPanelLayout.PanelState getPanelState() {
return slidingUpPanelLayout == null ? null : slidingUpPanelLayout.getPanelState();
}
public BottomNavigationViewEx getBottomNavigationView() {
return bottomNavigationView;
}
public void collapsePanel() {
slidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
}
public SlidingUpPanelLayout.PanelState getPanelState() {
return slidingUpPanelLayout == null ? null : slidingUpPanelLayout.getPanelState();
}
public void expandPanel() {
slidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.EXPANDED);
}
public void collapsePanel() {
slidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
}
public void expandPanel() {
slidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.EXPANDED);
}
}

View file

@ -43,10 +43,13 @@ public abstract class AbsTagEditorActivity extends AbsBaseActivity {
private static final int REQUEST_CODE_SELECT_IMAGE = 1000;
@BindView(R.id.save_fab)
FloatingActionButton save;
@BindView(R.id.image)
ImageView image;
@BindView(R.id.image_container)
FrameLayout imageContainer;
CharSequence[] items;
private int id;
private int paletteColorPrimary;

View file

@ -8,6 +8,7 @@ import android.support.v7.widget.Toolbar;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import android.widget.TextView;
import org.jaudiotagger.tag.FieldKey;
@ -28,22 +29,34 @@ public class SongTagEditorActivity extends AbsTagEditorActivity implements TextW
public static final String TAG = SongTagEditorActivity.class.getSimpleName();
@BindView(R.id.toolbar)
Toolbar toolbar;
@BindView(R.id.app_bar)
AppBarLayout appBarLayout;
@BindView(R.id.title)
TextView title;
@BindView(R.id.title1)
EditText songTitle;
@BindView(R.id.title2)
EditText albumTitle;
@BindView(R.id.artist)
EditText artist;
@BindView(R.id.genre)
EditText genre;
@BindView(R.id.year)
EditText year;
@BindView(R.id.image_text)
EditText trackNumber;
@BindView(R.id.lyrics)
EditText lyrics;
@BindView(R.id.album_artist)
EditText albumArtist;
@ -51,7 +64,8 @@ public class SongTagEditorActivity extends AbsTagEditorActivity implements TextW
appBarLayout.setBackgroundColor(ThemeStore.primaryColor(this));
toolbar.setBackgroundColor(ThemeStore.primaryColor(this));
toolbar.setNavigationOnClickListener(v -> onBackPressed());
setTitle(R.string.action_tag_editor);
setTitle(null);
title.setTextColor(ThemeStore.textColorPrimary(this));
setSupportActionBar(toolbar);
}

View file

@ -31,9 +31,7 @@ import code.name.monkey.retromusic.util.MusicUtil;
import code.name.monkey.retromusic.util.NavigationUtil;
public class ArtistAdapter extends
AbsMultiSelectAdapter<ArtistAdapter.ViewHolder, Artist> implements
FastScrollRecyclerView.SectionedAdapter {
public class ArtistAdapter extends AbsMultiSelectAdapter<ArtistAdapter.ViewHolder, Artist> implements FastScrollRecyclerView.SectionedAdapter {
protected final AppCompatActivity activity;
protected ArrayList<Artist> dataSet;
@ -54,7 +52,7 @@ public class ArtistAdapter extends
}
public ArtistAdapter(@NonNull AppCompatActivity activity, ArrayList<Artist> dataSet,
@LayoutRes int itemLayoutRes ) {
@LayoutRes int itemLayoutRes) {
super(activity, null, R.menu.menu_media_selection);
this.activity = activity;
this.dataSet = dataSet;

View file

@ -55,10 +55,13 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
@BindView(R.id.toolbar)
Toolbar toolbar;
@BindView(R.id.app_bar)
AppBarLayout appbar;
@BindView(R.id.title)
TextView title;
@BindView(R.id.search)
IconImageView search;

View file

@ -86,18 +86,25 @@ public class FoldersFragment extends AbsMainActivityFragment implements
private static final int LOADER_ID = LoaderIds.FOLDERS_FRAGMENT;
@BindView(R.id.coordinator_layout)
CoordinatorLayout coordinatorLayout;
@BindView(R.id.container)
View container;
@BindView(R.id.title)
TextView title;
@BindView(android.R.id.empty)
View empty;
@BindView(R.id.toolbar)
Toolbar toolbar;
@BindView(R.id.bread_crumbs)
BreadCrumbLayout breadCrumbs;
@BindView(R.id.appbar)
AppBarLayout appbar;
@BindView(R.id.recycler_view)
FastScrollRecyclerView recyclerView;

View file

@ -42,27 +42,39 @@ import code.name.monkey.retromusic.util.PreferenceUtil;
public class FullPlaybackControlsFragment extends AbsPlayerControlsFragment {
@BindView(R.id.player_song_current_progress)
TextView mPlayerSongCurrentProgress;
@BindView(R.id.player_song_total_time)
TextView songTotalTime;
@BindView(R.id.player_progress_slider)
SeekBar progressSlider;
@BindView(R.id.player_prev_button)
ImageButton playerPrevButton;
@BindView(R.id.player_next_button)
ImageButton playerNextButton;
@BindView(R.id.player_repeat_button)
ImageButton playerRepeatButton;
@BindView(R.id.player_shuffle_button)
ImageButton playerShuffleButton;
@BindView(R.id.player_play_pause_button)
ImageButton playerPlayPauseFab;
Unbinder unbinder;
@BindView(R.id.title)
TextView mTitle;
@BindView(R.id.text)
TextView mText;
@BindView(R.id.volume_fragment_container)
View mVolumeContainer;
Unbinder unbinder;
private int lastPlaybackControlsColor;
private int lastDisabledPlaybackControlsColor;
private MusicProgressViewUpdateHelper progressViewUpdateHelper;