change some method names in theme activity
This commit is contained in:
parent
704502f653
commit
94244bb172
14 changed files with 61 additions and 62 deletions
|
|
@ -60,10 +60,10 @@ public class AboutActivity extends AbsBaseActivity implements View.OnClickListen
|
|||
supportBinding = CardSupportDevelopmentBinding.bind(findViewById(R.id.support_layout));
|
||||
thanksBinding = CardSpecialThanksBinding.bind(findViewById(R.id.thanks_layout));
|
||||
|
||||
setDrawUnderStatusbar();
|
||||
setStatusbarColorAuto();
|
||||
setDrawUnderStatusBar();
|
||||
setStatusBarColorAuto();
|
||||
|
||||
setNavigationbarColorAuto();
|
||||
setNavigationBarColorAuto();
|
||||
setTaskDescriptionColorAuto();
|
||||
|
||||
setUpViews();
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ public class LoginActivity extends AbsBaseActivity implements View.OnClickListen
|
|||
binding = ActivityLoginBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
setDrawUnderStatusbar();
|
||||
setStatusbarColorAuto();
|
||||
setDrawUnderStatusBar();
|
||||
setStatusBarColorAuto();
|
||||
|
||||
setNavigationbarColorAuto();
|
||||
setNavigationBarColorAuto();
|
||||
setTaskDescriptionColorAuto();
|
||||
|
||||
setUpViews();
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class MainActivity extends AbsMusicPanelActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setDrawUnderStatusbar();
|
||||
setDrawUnderStatusBar();
|
||||
|
||||
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {
|
||||
binding.navigationView.setFitsSystemWindows(false);
|
||||
|
|
|
|||
|
|
@ -50,10 +50,10 @@ public class SearchActivity extends AbsMusicServiceActivity implements SearchVie
|
|||
binding = ActivitySearchBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
setDrawUnderStatusbar();
|
||||
setStatusbarColorAuto();
|
||||
setDrawUnderStatusBar();
|
||||
setStatusBarColorAuto();
|
||||
|
||||
setNavigationbarColorAuto();
|
||||
setNavigationBarColorAuto();
|
||||
setTaskDescriptionColorAuto();
|
||||
|
||||
binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
|
|
|
|||
|
|
@ -41,10 +41,10 @@ public class SelectActivity extends AbsBaseActivity {
|
|||
}
|
||||
});
|
||||
|
||||
setDrawUnderStatusbar();
|
||||
setStatusbarColorAuto();
|
||||
setDrawUnderStatusBar();
|
||||
setStatusBarColorAuto();
|
||||
|
||||
setNavigationbarColorAuto();
|
||||
setNavigationBarColorAuto();
|
||||
setTaskDescriptionColorAuto();
|
||||
|
||||
int primaryColor = ThemeStore.primaryColor(this);
|
||||
|
|
|
|||
|
|
@ -42,10 +42,10 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
|
|||
binding = ActivitySettingsBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
setDrawUnderStatusbar();
|
||||
setStatusbarColorAuto();
|
||||
setDrawUnderStatusBar();
|
||||
setStatusBarColorAuto();
|
||||
|
||||
setNavigationbarColorAuto();
|
||||
setNavigationBarColorAuto();
|
||||
setTaskDescriptionColorAuto();
|
||||
|
||||
binding.toolbar.setBackgroundColor(ThemeStore.primaryColor(this));
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@ public class SplashActivity extends AbsBaseActivity {
|
|||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_splash);
|
||||
setDrawUnderStatusbar();
|
||||
setDrawUnderStatusBar();
|
||||
|
||||
setStatusbarColorAuto();
|
||||
setNavigationbarColorAuto();
|
||||
setStatusBarColorAuto();
|
||||
setNavigationBarColorAuto();
|
||||
setTaskDescriptionColorAuto();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ public abstract class AbsMusicPanelActivity extends AbsMusicServiceActivity impl
|
|||
public void onPanelSlide(View panel, @FloatRange(from = 0, to = 1) float slideOffset) {
|
||||
setMiniPlayerAlphaProgress(slideOffset);
|
||||
if (navigationBarColorAnimator != null) navigationBarColorAnimator.cancel();
|
||||
super.setNavigationbarColor(ColorUtils.blendARGB(navigationbarColor, playerFragment.getPaletteColor(), slideOffset));
|
||||
super.setNavigationBarColor(ColorUtils.blendARGB(navigationbarColor, playerFragment.getPaletteColor(), slideOffset));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -163,9 +163,9 @@ public abstract class AbsMusicPanelActivity extends AbsMusicServiceActivity impl
|
|||
|
||||
public void onPanelCollapsed(View panel) {
|
||||
// restore values
|
||||
super.setLightStatusbar(lightStatusbar);
|
||||
super.setLightStatusBar(lightStatusbar);
|
||||
super.setTaskDescriptionColor(taskColor);
|
||||
super.setNavigationbarColor(navigationbarColor);
|
||||
super.setNavigationBarColor(navigationbarColor);
|
||||
|
||||
playerFragment.setMenuVisibility(false);
|
||||
playerFragment.setUserVisibleHint(false);
|
||||
|
|
@ -175,9 +175,9 @@ public abstract class AbsMusicPanelActivity extends AbsMusicServiceActivity impl
|
|||
public void onPanelExpanded(View panel) {
|
||||
// setting fragments values
|
||||
int playerFragmentColor = playerFragment.getPaletteColor();
|
||||
super.setLightStatusbar(false);
|
||||
super.setLightStatusBar(false);
|
||||
super.setTaskDescriptionColor(playerFragmentColor);
|
||||
super.setNavigationbarColor(playerFragmentColor);
|
||||
super.setNavigationBarColor(playerFragmentColor);
|
||||
|
||||
playerFragment.setMenuVisibility(true);
|
||||
playerFragment.setUserVisibleHint(true);
|
||||
|
|
@ -252,16 +252,16 @@ public abstract class AbsMusicPanelActivity extends AbsMusicServiceActivity impl
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setLightStatusbar(boolean enabled) {
|
||||
public void setLightStatusBar(boolean enabled) {
|
||||
lightStatusbar = enabled;
|
||||
|
||||
if (getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
|
||||
super.setLightStatusbar(enabled);
|
||||
super.setLightStatusBar(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNavigationbarColor(int color) {
|
||||
public void setNavigationBarColor(int color) {
|
||||
this.navigationbarColor = color;
|
||||
|
||||
if (navigationBarColorAnimator != null) {
|
||||
|
|
@ -269,7 +269,7 @@ public abstract class AbsMusicPanelActivity extends AbsMusicServiceActivity impl
|
|||
}
|
||||
|
||||
if (getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
|
||||
super.setNavigationbarColor(color);
|
||||
super.setNavigationBarColor(color);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -284,7 +284,7 @@ public abstract class AbsMusicPanelActivity extends AbsMusicServiceActivity impl
|
|||
.setDuration(ViewUtil.PHONOGRAPH_ANIM_TIME);
|
||||
|
||||
navigationBarColorAnimator.setInterpolator(new PathInterpolator(0.4f, 0f, 1f, 1f));
|
||||
navigationBarColorAnimator.addUpdateListener(animation -> super.setNavigationbarColor((int) animation.getAnimatedValue()));
|
||||
navigationBarColorAnimator.addUpdateListener(animation -> super.setNavigationBarColor((int) animation.getAnimatedValue()));
|
||||
navigationBarColorAnimator.start();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import android.view.View;
|
|||
|
||||
import androidx.annotation.ColorInt;
|
||||
|
||||
import com.dkanada.gramophone.BuildConfig;
|
||||
import com.kabouzeid.appthemehelper.ATH;
|
||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
||||
import com.kabouzeid.appthemehelper.common.ATHToolbarActivity;
|
||||
|
|
@ -28,7 +27,7 @@ public abstract class AbsThemeActivity extends ATHToolbarActivity {
|
|||
}
|
||||
}
|
||||
|
||||
protected void setDrawUnderStatusbar() {
|
||||
protected void setDrawUnderStatusBar() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
Util.setAllowDrawUnderStatusBar(getWindow());
|
||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
|
|
@ -36,26 +35,26 @@ public abstract class AbsThemeActivity extends ATHToolbarActivity {
|
|||
}
|
||||
}
|
||||
|
||||
public void setStatusbarColor(int color) {
|
||||
public void setStatusBarColor(int color) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
final View statusBar = getWindow().getDecorView().getRootView().findViewById(R.id.status_bar);
|
||||
if (statusBar != null) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
statusBar.setBackgroundColor(ColorUtil.darkenColor(color));
|
||||
setLightStatusbarAuto(color);
|
||||
setLightStatusBarAuto(color);
|
||||
} else {
|
||||
statusBar.setBackgroundColor(color);
|
||||
}
|
||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
getWindow().setStatusBarColor(ColorUtil.darkenColor(color));
|
||||
setLightStatusbarAuto(color);
|
||||
setLightStatusBarAuto(color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setStatusbarColorAuto() {
|
||||
public void setStatusBarColorAuto() {
|
||||
// we don't want to use status bar color because we are darkening the color on our own to support KitKat
|
||||
setStatusbarColor(ThemeStore.primaryColor(this));
|
||||
setStatusBarColor(ThemeStore.primaryColor(this));
|
||||
}
|
||||
|
||||
public void setTaskDescriptionColor(@ColorInt int color) {
|
||||
|
|
@ -66,19 +65,19 @@ public abstract class AbsThemeActivity extends ATHToolbarActivity {
|
|||
setTaskDescriptionColor(ThemeStore.primaryColor(this));
|
||||
}
|
||||
|
||||
public void setNavigationbarColor(int color) {
|
||||
public void setNavigationBarColor(int color) {
|
||||
ATH.setNavigationbarColor(this, color);
|
||||
}
|
||||
|
||||
public void setNavigationbarColorAuto() {
|
||||
setNavigationbarColor(ThemeStore.navigationBarColor(this));
|
||||
public void setNavigationBarColorAuto() {
|
||||
setNavigationBarColor(ThemeStore.navigationBarColor(this));
|
||||
}
|
||||
|
||||
public void setLightStatusbar(boolean enabled) {
|
||||
public void setLightStatusBar(boolean enabled) {
|
||||
ATH.setLightStatusbar(this, enabled);
|
||||
}
|
||||
|
||||
public void setLightStatusbarAuto(int bgColor) {
|
||||
setLightStatusbar(ColorUtil.isColorLight(bgColor));
|
||||
public void setLightStatusBarAuto(int bgColor) {
|
||||
setLightStatusBar(ColorUtil.isColorLight(bgColor));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class AlbumDetailActivity extends AbsMusicPanelActivity implements Palett
|
|||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setDrawUnderStatusbar();
|
||||
setDrawUnderStatusBar();
|
||||
setUpObservableListViewParams();
|
||||
setUpToolbar();
|
||||
setUpViews();
|
||||
|
|
@ -118,13 +118,13 @@ public class AlbumDetailActivity extends AbsMusicPanelActivity implements Palett
|
|||
toolbarColor = color;
|
||||
binding.appBarLayout.setBackgroundColor(color);
|
||||
|
||||
setNavigationbarColor(color);
|
||||
setNavigationBarColor(color);
|
||||
setTaskDescriptionColor(color);
|
||||
|
||||
binding.toolbar.setBackgroundColor(color);
|
||||
// needed to auto readjust the toolbar content color
|
||||
setSupportActionBar(binding.toolbar);
|
||||
setStatusbarColor(color);
|
||||
setStatusBarColor(color);
|
||||
|
||||
int secondaryTextColor = MaterialValueHelper.getSecondaryTextColor(this, ColorUtil.isColorLight(color));
|
||||
binding.artistIcon.setColorFilter(secondaryTextColor, PorterDuff.Mode.SRC_IN);
|
||||
|
|
@ -241,9 +241,9 @@ public class AlbumDetailActivity extends AbsMusicPanelActivity implements Palett
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setStatusbarColor(int color) {
|
||||
super.setStatusbarColor(color);
|
||||
setLightStatusbar(false);
|
||||
public void setStatusBarColor(int color) {
|
||||
super.setStatusBarColor(color);
|
||||
setLightStatusBar(false);
|
||||
}
|
||||
|
||||
private void setAlbum(Album album) {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public class ArtistDetailActivity extends AbsMusicPanelActivity implements Palet
|
|||
// must be loaded before album adapter
|
||||
usePalette = PreferenceUtil.getInstance(this).getAlbumArtistColoredFooters();
|
||||
|
||||
setDrawUnderStatusbar();
|
||||
setDrawUnderStatusBar();
|
||||
setUpObservableListViewParams();
|
||||
setUpToolbar();
|
||||
setUpViews();
|
||||
|
|
@ -167,13 +167,13 @@ public class ArtistDetailActivity extends AbsMusicPanelActivity implements Palet
|
|||
toolbarColor = color;
|
||||
binding.appBarLayout.setBackgroundColor(color);
|
||||
|
||||
setNavigationbarColor(color);
|
||||
setNavigationBarColor(color);
|
||||
setTaskDescriptionColor(color);
|
||||
|
||||
binding.toolbar.setBackgroundColor(color);
|
||||
// needed to auto readjust the toolbar content color
|
||||
setSupportActionBar(binding.toolbar);
|
||||
setStatusbarColor(color);
|
||||
setStatusBarColor(color);
|
||||
|
||||
int secondaryTextColor = MaterialValueHelper.getSecondaryTextColor(this, ColorUtil.isColorLight(color));
|
||||
binding.durationIcon.setColorFilter(secondaryTextColor, PorterDuff.Mode.SRC_IN);
|
||||
|
|
@ -268,9 +268,9 @@ public class ArtistDetailActivity extends AbsMusicPanelActivity implements Palet
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setStatusbarColor(int color) {
|
||||
super.setStatusbarColor(color);
|
||||
setLightStatusbar(false);
|
||||
public void setStatusBarColor(int color) {
|
||||
super.setStatusBarColor(color);
|
||||
setLightStatusBar(false);
|
||||
}
|
||||
|
||||
private void setArtist(Artist artist) {
|
||||
|
|
|
|||
|
|
@ -44,10 +44,10 @@ public class GenreDetailActivity extends AbsMusicPanelActivity implements CabHol
|
|||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setDrawUnderStatusbar();
|
||||
setStatusbarColorAuto();
|
||||
setDrawUnderStatusBar();
|
||||
setStatusBarColorAuto();
|
||||
|
||||
setNavigationbarColorAuto();
|
||||
setNavigationBarColorAuto();
|
||||
setTaskDescriptionColorAuto();
|
||||
|
||||
setUpRecyclerView();
|
||||
|
|
|
|||
|
|
@ -54,10 +54,10 @@ public class PlaylistDetailActivity extends AbsMusicPanelActivity implements Cab
|
|||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setDrawUnderStatusbar();
|
||||
setStatusbarColorAuto();
|
||||
setDrawUnderStatusBar();
|
||||
setStatusBarColorAuto();
|
||||
|
||||
setNavigationbarColorAuto();
|
||||
setNavigationBarColorAuto();
|
||||
setTaskDescriptionColorAuto();
|
||||
|
||||
setUpRecyclerView();
|
||||
|
|
|
|||
|
|
@ -73,8 +73,8 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
|||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
PreferenceUtil.getInstance(getActivity()).registerOnSharedPreferenceChangedListener(this);
|
||||
getMainActivity().setStatusbarColorAuto();
|
||||
getMainActivity().setNavigationbarColorAuto();
|
||||
getMainActivity().setStatusBarColorAuto();
|
||||
getMainActivity().setNavigationBarColorAuto();
|
||||
getMainActivity().setTaskDescriptionColorAuto();
|
||||
|
||||
setUpToolbar();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue