remove most ThemeStore uses for accent colors
This commit is contained in:
parent
e48d5cdfd2
commit
aa5f0c5619
20 changed files with 52 additions and 78 deletions
|
|
@ -11,7 +11,6 @@ import androidx.room.Room;
|
||||||
import com.dkanada.gramophone.database.JellyDatabase;
|
import com.dkanada.gramophone.database.JellyDatabase;
|
||||||
import com.dkanada.gramophone.helper.EventListener;
|
import com.dkanada.gramophone.helper.EventListener;
|
||||||
import com.dkanada.gramophone.util.PreferenceUtil;
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
|
||||||
import com.dkanada.gramophone.views.shortcuts.DynamicShortcutManager;
|
import com.dkanada.gramophone.views.shortcuts.DynamicShortcutManager;
|
||||||
import com.melegy.redscreenofdeath.RedScreenOfDeath;
|
import com.melegy.redscreenofdeath.RedScreenOfDeath;
|
||||||
|
|
||||||
|
|
@ -46,10 +45,6 @@ public class App extends Application {
|
||||||
PreferenceUtil.getInstance(this).setUser(null);
|
PreferenceUtil.getInstance(this).setUser(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ThemeStore.isConfigured(this, 1)) {
|
|
||||||
ThemeStore.editTheme(this).primaryColorRes(R.color.md_indigo_500).accentColorRes(R.color.md_pink_A400).commit();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
new DynamicShortcutManager(this).initDynamicShortcuts();
|
new DynamicShortcutManager(this).initDynamicShortcuts();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import android.view.View;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.dkanada.gramophone.util.NavigationUtil;
|
import com.dkanada.gramophone.util.NavigationUtil;
|
||||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
import com.dkanada.gramophone.databinding.ActivityAboutBinding;
|
import com.dkanada.gramophone.databinding.ActivityAboutBinding;
|
||||||
import com.dkanada.gramophone.databinding.CardAboutAppBinding;
|
import com.dkanada.gramophone.databinding.CardAboutAppBinding;
|
||||||
import com.dkanada.gramophone.databinding.CardAuthorBinding;
|
import com.dkanada.gramophone.databinding.CardAuthorBinding;
|
||||||
|
|
@ -74,7 +74,7 @@ public class AboutActivity extends AbsBaseActivity implements View.OnClickListen
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpToolbar() {
|
private void setUpToolbar() {
|
||||||
binding.toolbar.setBackgroundColor(ThemeStore.primaryColor(this));
|
binding.toolbar.setBackgroundColor(PreferenceUtil.getInstance(this).getPrimaryColor());
|
||||||
setSupportActionBar(binding.toolbar);
|
setSupportActionBar(binding.toolbar);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import com.dkanada.gramophone.databinding.ActivityLoginBinding;
|
||||||
import com.dkanada.gramophone.activities.base.AbsBaseActivity;
|
import com.dkanada.gramophone.activities.base.AbsBaseActivity;
|
||||||
import com.dkanada.gramophone.model.User;
|
import com.dkanada.gramophone.model.User;
|
||||||
import com.dkanada.gramophone.util.PreferenceUtil;
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
|
||||||
|
|
||||||
import org.jellyfin.apiclient.interaction.Response;
|
import org.jellyfin.apiclient.interaction.Response;
|
||||||
import org.jellyfin.apiclient.model.system.SystemInfo;
|
import org.jellyfin.apiclient.model.system.SystemInfo;
|
||||||
|
|
@ -46,7 +45,7 @@ public class LoginActivity extends AbsBaseActivity implements View.OnClickListen
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpViews() {
|
private void setUpViews() {
|
||||||
primaryColor = ThemeStore.primaryColor(this);
|
primaryColor = PreferenceUtil.getInstance(this).getPrimaryColor();
|
||||||
|
|
||||||
setUpToolbar();
|
setUpToolbar();
|
||||||
setUpOnClickListeners();
|
setUpOnClickListeners();
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import androidx.drawerlayout.widget.DrawerLayout;
|
||||||
|
|
||||||
import com.dkanada.gramophone.activities.base.AbsMusicContentActivity;
|
import com.dkanada.gramophone.activities.base.AbsMusicContentActivity;
|
||||||
import com.dkanada.gramophone.util.NavigationUtil;
|
import com.dkanada.gramophone.util.NavigationUtil;
|
||||||
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
import com.kabouzeid.appthemehelper.ThemeStore;
|
||||||
import com.kabouzeid.appthemehelper.util.ATHUtil;
|
import com.kabouzeid.appthemehelper.util.ATHUtil;
|
||||||
import com.kabouzeid.appthemehelper.util.NavigationViewUtil;
|
import com.kabouzeid.appthemehelper.util.NavigationViewUtil;
|
||||||
|
|
@ -131,7 +132,7 @@ public class MainActivity extends AbsMusicContentActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpNavigationView() {
|
private void setUpNavigationView() {
|
||||||
int accentColor = ThemeStore.accentColor(this);
|
int accentColor = PreferenceUtil.getInstance(this).getAccentColor();
|
||||||
NavigationViewUtil.setItemIconColors(binding.navigationView, ATHUtil.resolveColor(this, R.attr.iconColor, ThemeStore.textColorSecondary(this)), accentColor);
|
NavigationViewUtil.setItemIconColors(binding.navigationView, ATHUtil.resolveColor(this, R.attr.iconColor, ThemeStore.textColorSecondary(this)), accentColor);
|
||||||
NavigationViewUtil.setItemTextColors(binding.navigationView, ThemeStore.textColorPrimary(this), accentColor);
|
NavigationViewUtil.setItemTextColors(binding.navigationView, ThemeStore.textColorPrimary(this), accentColor);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,9 @@ import com.dkanada.gramophone.interfaces.MediaCallback;
|
||||||
import com.dkanada.gramophone.model.Album;
|
import com.dkanada.gramophone.model.Album;
|
||||||
import com.dkanada.gramophone.model.Artist;
|
import com.dkanada.gramophone.model.Artist;
|
||||||
import com.dkanada.gramophone.model.Song;
|
import com.dkanada.gramophone.model.Song;
|
||||||
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
import com.dkanada.gramophone.util.QueryUtil;
|
import com.dkanada.gramophone.util.QueryUtil;
|
||||||
import com.dkanada.gramophone.util.Util;
|
import com.dkanada.gramophone.util.Util;
|
||||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
|
||||||
|
|
||||||
import org.jellyfin.apiclient.model.querying.ItemQuery;
|
import org.jellyfin.apiclient.model.querying.ItemQuery;
|
||||||
|
|
||||||
|
|
@ -99,7 +99,7 @@ public class SearchActivity extends AbsMusicContentActivity implements SearchVie
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpToolBar() {
|
private void setUpToolBar() {
|
||||||
binding.toolbar.setBackgroundColor(ThemeStore.primaryColor(this));
|
binding.toolbar.setBackgroundColor(PreferenceUtil.getInstance(this).getPrimaryColor());
|
||||||
setSupportActionBar(binding.toolbar);
|
setSupportActionBar(binding.toolbar);
|
||||||
// noinspection ConstantConditions
|
// noinspection ConstantConditions
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import com.dkanada.gramophone.activities.base.AbsBaseActivity;
|
||||||
import com.dkanada.gramophone.adapter.SelectAdapter;
|
import com.dkanada.gramophone.adapter.SelectAdapter;
|
||||||
import com.dkanada.gramophone.databinding.ActivitySelectBinding;
|
import com.dkanada.gramophone.databinding.ActivitySelectBinding;
|
||||||
import com.dkanada.gramophone.model.User;
|
import com.dkanada.gramophone.model.User;
|
||||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -41,7 +41,7 @@ public class SelectActivity extends AbsBaseActivity {
|
||||||
setNavigationBarColorAuto();
|
setNavigationBarColorAuto();
|
||||||
setTaskDescriptionColorAuto();
|
setTaskDescriptionColorAuto();
|
||||||
|
|
||||||
int primaryColor = ThemeStore.primaryColor(this);
|
int primaryColor = PreferenceUtil.getInstance(this).getPrimaryColor();
|
||||||
|
|
||||||
binding.add.setBackgroundColor(primaryColor);
|
binding.add.setBackgroundColor(primaryColor);
|
||||||
binding.toolbar.setBackgroundColor(primaryColor);
|
binding.toolbar.setBackgroundColor(primaryColor);
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import androidx.preference.PreferenceManager;
|
||||||
import androidx.preference.TwoStatePreference;
|
import androidx.preference.TwoStatePreference;
|
||||||
|
|
||||||
import com.dkanada.gramophone.databinding.ActivitySettingsBinding;
|
import com.dkanada.gramophone.databinding.ActivitySettingsBinding;
|
||||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
|
||||||
import com.dkanada.gramophone.R;
|
import com.dkanada.gramophone.R;
|
||||||
import com.dkanada.gramophone.views.shortcuts.DynamicShortcutManager;
|
import com.dkanada.gramophone.views.shortcuts.DynamicShortcutManager;
|
||||||
import com.dkanada.gramophone.dialogs.preferences.CategoryPreferenceDialog;
|
import com.dkanada.gramophone.dialogs.preferences.CategoryPreferenceDialog;
|
||||||
|
|
@ -37,7 +36,7 @@ public class SettingsActivity extends AbsBaseActivity {
|
||||||
setNavigationBarColorAuto();
|
setNavigationBarColorAuto();
|
||||||
setTaskDescriptionColorAuto();
|
setTaskDescriptionColorAuto();
|
||||||
|
|
||||||
binding.toolbar.setBackgroundColor(ThemeStore.primaryColor(this));
|
binding.toolbar.setBackgroundColor(PreferenceUtil.getInstance(this).getPrimaryColor());
|
||||||
setSupportActionBar(binding.toolbar);
|
setSupportActionBar(binding.toolbar);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ import androidx.core.app.ActivityCompat;
|
||||||
import com.dkanada.gramophone.activities.MainActivity;
|
import com.dkanada.gramophone.activities.MainActivity;
|
||||||
import com.dkanada.gramophone.util.NavigationUtil;
|
import com.dkanada.gramophone.util.NavigationUtil;
|
||||||
import com.dkanada.gramophone.R;
|
import com.dkanada.gramophone.R;
|
||||||
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -109,7 +109,7 @@ public abstract class AbsBaseActivity extends AbsThemeActivity {
|
||||||
private void showWarning() {
|
private void showWarning() {
|
||||||
Snackbar.make(getPermissionWindow(), getPermissionMessage(), Snackbar.LENGTH_SHORT)
|
Snackbar.make(getPermissionWindow(), getPermissionMessage(), Snackbar.LENGTH_SHORT)
|
||||||
.setAction(R.string.ignore, view -> { })
|
.setAction(R.string.ignore, view -> { })
|
||||||
.setActionTextColor(ThemeStore.accentColor(this))
|
.setActionTextColor(PreferenceUtil.getInstance(this).getAccentColor())
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -249,7 +249,7 @@ public abstract class AbsMusicPanelActivity extends AbsMusicServiceActivity impl
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setNavigationBarColor(int color) {
|
public void setNavigationBarColor(int color) {
|
||||||
this.navigationbarColor = color;
|
navigationbarColor = color;
|
||||||
|
|
||||||
if (navigationBarColorAnimator != null) {
|
if (navigationBarColorAnimator != null) {
|
||||||
navigationBarColorAnimator.cancel();
|
navigationBarColorAnimator.cancel();
|
||||||
|
|
@ -286,7 +286,7 @@ public abstract class AbsMusicPanelActivity extends AbsMusicServiceActivity impl
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTaskDescriptionColor(@ColorInt int color) {
|
public void setTaskDescriptionColor(@ColorInt int color) {
|
||||||
this.taskColor = color;
|
taskColor = color;
|
||||||
|
|
||||||
if (getPanelState() == null || getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
|
if (getPanelState() == null || getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
|
||||||
super.setTaskDescriptionColor(color);
|
super.setTaskDescriptionColor(color);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.ColorInt;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.dkanada.gramophone.util.NavigationUtil;
|
import com.dkanada.gramophone.util.NavigationUtil;
|
||||||
|
|
@ -25,10 +24,6 @@ public abstract class AbsThemeActivity extends AppCompatActivity {
|
||||||
|
|
||||||
setTheme(PreferenceUtil.getInstance(this).getTheme().style);
|
setTheme(PreferenceUtil.getInstance(this).getTheme().style);
|
||||||
MaterialDialogsUtil.updateMaterialDialogsThemeSingleton(this);
|
MaterialDialogsUtil.updateMaterialDialogsThemeSingleton(this);
|
||||||
|
|
||||||
if (!ThemeStore.coloredNavigationBar(this)) {
|
|
||||||
ThemeStore.editTheme(this).coloredNavigationBar(true).commit();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -59,19 +54,17 @@ public abstract class AbsThemeActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatusBarColor(int color) {
|
public void setStatusBarColor(int color) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
View statusBar = getWindow().getDecorView().getRootView().findViewById(R.id.status_bar);
|
||||||
final View statusBar = getWindow().getDecorView().getRootView().findViewById(R.id.status_bar);
|
int dark = ColorUtil.darkenColor(color);
|
||||||
if (statusBar != null) {
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
// KitKat through Lollipop will do this automatically
|
||||||
statusBar.setBackgroundColor(ColorUtil.darkenColor(color));
|
if (statusBar != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
setLightStatusBarAuto(color);
|
statusBar.setBackgroundColor(dark);
|
||||||
} else {
|
getWindow().setStatusBarColor(getResources().getColor(android.R.color.transparent));
|
||||||
statusBar.setBackgroundColor(color);
|
} else if (statusBar != null) {
|
||||||
}
|
statusBar.setBackgroundColor(color);
|
||||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
getWindow().setStatusBarColor(ColorUtil.darkenColor(color));
|
getWindow().setStatusBarColor(dark);
|
||||||
setLightStatusBarAuto(color);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -80,7 +73,7 @@ public abstract class AbsThemeActivity extends AppCompatActivity {
|
||||||
setStatusBarColor(ThemeStore.primaryColor(this));
|
setStatusBarColor(ThemeStore.primaryColor(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTaskDescriptionColor(@ColorInt int color) {
|
public void setTaskDescriptionColor(int color) {
|
||||||
ATH.setTaskDescriptionColor(this, color);
|
ATH.setTaskDescriptionColor(this, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ import com.dkanada.gramophone.model.Artist;
|
||||||
import com.dkanada.gramophone.model.Song;
|
import com.dkanada.gramophone.model.Song;
|
||||||
import com.dkanada.gramophone.util.MusicUtil;
|
import com.dkanada.gramophone.util.MusicUtil;
|
||||||
import com.dkanada.gramophone.util.NavigationUtil;
|
import com.dkanada.gramophone.util.NavigationUtil;
|
||||||
import com.dkanada.gramophone.util.ThemeUtil;
|
|
||||||
import com.dkanada.gramophone.util.QueryUtil;
|
import com.dkanada.gramophone.util.QueryUtil;
|
||||||
|
|
||||||
import org.jellyfin.apiclient.model.querying.ItemQuery;
|
import org.jellyfin.apiclient.model.querying.ItemQuery;
|
||||||
|
|
@ -209,7 +208,7 @@ public class AlbumDetailActivity extends AbsMusicContentActivity implements Pale
|
||||||
cab = new MaterialCab(this, R.id.cab_stub)
|
cab = new MaterialCab(this, R.id.cab_stub)
|
||||||
.setMenu(menuRes)
|
.setMenu(menuRes)
|
||||||
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
||||||
.setBackgroundColor(ThemeUtil.shiftBackgroundColorForLightText(getPaletteColor()))
|
.setBackgroundColor(getPaletteColor())
|
||||||
.start(callback);
|
.start(callback);
|
||||||
return cab;
|
return cab;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ import com.dkanada.gramophone.interfaces.PaletteColorHolder;
|
||||||
import com.dkanada.gramophone.model.Artist;
|
import com.dkanada.gramophone.model.Artist;
|
||||||
import com.dkanada.gramophone.model.Song;
|
import com.dkanada.gramophone.model.Song;
|
||||||
import com.dkanada.gramophone.util.MusicUtil;
|
import com.dkanada.gramophone.util.MusicUtil;
|
||||||
import com.dkanada.gramophone.util.ThemeUtil;
|
|
||||||
import com.dkanada.gramophone.util.PreferenceUtil;
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
import com.dkanada.gramophone.util.QueryUtil;
|
import com.dkanada.gramophone.util.QueryUtil;
|
||||||
|
|
||||||
|
|
@ -237,7 +236,7 @@ public class ArtistDetailActivity extends AbsMusicContentActivity implements Pal
|
||||||
cab = new MaterialCab(this, R.id.cab_stub)
|
cab = new MaterialCab(this, R.id.cab_stub)
|
||||||
.setMenu(menuRes)
|
.setMenu(menuRes)
|
||||||
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
||||||
.setBackgroundColor(ThemeUtil.shiftBackgroundColorForLightText(getPaletteColor()))
|
.setBackgroundColor(getPaletteColor())
|
||||||
.start(callback);
|
.start(callback);
|
||||||
return cab;
|
return cab;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,16 +14,14 @@ import com.dkanada.gramophone.BuildConfig;
|
||||||
import com.dkanada.gramophone.activities.base.AbsMusicContentActivity;
|
import com.dkanada.gramophone.activities.base.AbsMusicContentActivity;
|
||||||
import com.dkanada.gramophone.databinding.ActivityGenreDetailBinding;
|
import com.dkanada.gramophone.databinding.ActivityGenreDetailBinding;
|
||||||
import com.dkanada.gramophone.util.NavigationUtil;
|
import com.dkanada.gramophone.util.NavigationUtil;
|
||||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
import com.dkanada.gramophone.R;
|
import com.dkanada.gramophone.R;
|
||||||
import com.dkanada.gramophone.adapter.song.SongAdapter;
|
import com.dkanada.gramophone.adapter.song.SongAdapter;
|
||||||
import com.dkanada.gramophone.helper.MusicPlayerRemote;
|
import com.dkanada.gramophone.helper.MusicPlayerRemote;
|
||||||
import com.dkanada.gramophone.interfaces.CabHolder;
|
import com.dkanada.gramophone.interfaces.CabHolder;
|
||||||
import com.dkanada.gramophone.model.Genre;
|
import com.dkanada.gramophone.model.Genre;
|
||||||
import com.dkanada.gramophone.util.ThemeUtil;
|
|
||||||
import com.dkanada.gramophone.util.QueryUtil;
|
import com.dkanada.gramophone.util.QueryUtil;
|
||||||
import com.dkanada.gramophone.util.ViewUtil;
|
import com.dkanada.gramophone.util.ViewUtil;
|
||||||
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
|
|
||||||
|
|
||||||
import org.jellyfin.apiclient.model.querying.ItemQuery;
|
import org.jellyfin.apiclient.model.querying.ItemQuery;
|
||||||
|
|
||||||
|
|
@ -74,7 +72,7 @@ public class GenreDetailActivity extends AbsMusicContentActivity implements CabH
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpRecyclerView() {
|
private void setUpRecyclerView() {
|
||||||
ViewUtil.setUpFastScrollRecyclerViewColor(this, binding.recyclerView, ThemeStore.accentColor(this));
|
ViewUtil.setUpFastScrollRecyclerViewColor(this, binding.recyclerView, PreferenceUtil.getInstance(this).getAccentColor());
|
||||||
binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|
||||||
adapter = new SongAdapter(this, new ArrayList<>(), R.layout.item_list, false, this);
|
adapter = new SongAdapter(this, new ArrayList<>(), R.layout.item_list, false, this);
|
||||||
|
|
@ -90,7 +88,7 @@ public class GenreDetailActivity extends AbsMusicContentActivity implements CabH
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpToolBar() {
|
private void setUpToolBar() {
|
||||||
binding.toolbar.setBackgroundColor(ThemeStore.primaryColor(this));
|
binding.toolbar.setBackgroundColor(PreferenceUtil.getInstance(this).getPrimaryColor());
|
||||||
setSupportActionBar(binding.toolbar);
|
setSupportActionBar(binding.toolbar);
|
||||||
binding.toolbar.setTitle(genre.name);
|
binding.toolbar.setTitle(genre.name);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
@ -124,7 +122,7 @@ public class GenreDetailActivity extends AbsMusicContentActivity implements CabH
|
||||||
cab = new MaterialCab(this, R.id.cab_stub)
|
cab = new MaterialCab(this, R.id.cab_stub)
|
||||||
.setMenu(menu)
|
.setMenu(menu)
|
||||||
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
||||||
.setBackgroundColor(ThemeUtil.shiftBackgroundColorForLightText(ThemeStore.primaryColor(this)))
|
.setBackgroundColor(PreferenceUtil.getInstance(this).getPrimaryColor())
|
||||||
.start(callback);
|
.start(callback);
|
||||||
|
|
||||||
return cab;
|
return cab;
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,11 @@ import com.dkanada.gramophone.databinding.ActivityPlaylistDetailBinding;
|
||||||
import com.dkanada.gramophone.dialogs.DeletePlaylistDialog;
|
import com.dkanada.gramophone.dialogs.DeletePlaylistDialog;
|
||||||
import com.dkanada.gramophone.dialogs.RenamePlaylistDialog;
|
import com.dkanada.gramophone.dialogs.RenamePlaylistDialog;
|
||||||
import com.dkanada.gramophone.helper.menu.SongsMenuHelper;
|
import com.dkanada.gramophone.helper.menu.SongsMenuHelper;
|
||||||
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
import com.h6ah4i.android.widget.advrecyclerview.animator.GeneralItemAnimator;
|
import com.h6ah4i.android.widget.advrecyclerview.animator.GeneralItemAnimator;
|
||||||
import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator;
|
import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator;
|
||||||
import com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropManager;
|
import com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropManager;
|
||||||
import com.h6ah4i.android.widget.advrecyclerview.utils.WrapperAdapterUtils;
|
import com.h6ah4i.android.widget.advrecyclerview.utils.WrapperAdapterUtils;
|
||||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
|
||||||
import com.dkanada.gramophone.R;
|
import com.dkanada.gramophone.R;
|
||||||
import com.dkanada.gramophone.adapter.song.OrderablePlaylistSongAdapter;
|
import com.dkanada.gramophone.adapter.song.OrderablePlaylistSongAdapter;
|
||||||
import com.dkanada.gramophone.adapter.song.SongAdapter;
|
import com.dkanada.gramophone.adapter.song.SongAdapter;
|
||||||
|
|
@ -29,7 +29,6 @@ import com.dkanada.gramophone.interfaces.CabHolder;
|
||||||
import com.dkanada.gramophone.model.Playlist;
|
import com.dkanada.gramophone.model.Playlist;
|
||||||
import com.dkanada.gramophone.model.PlaylistSong;
|
import com.dkanada.gramophone.model.PlaylistSong;
|
||||||
import com.dkanada.gramophone.model.Song;
|
import com.dkanada.gramophone.model.Song;
|
||||||
import com.dkanada.gramophone.util.ThemeUtil;
|
|
||||||
import com.dkanada.gramophone.util.PlaylistUtil;
|
import com.dkanada.gramophone.util.PlaylistUtil;
|
||||||
import com.dkanada.gramophone.util.ViewUtil;
|
import com.dkanada.gramophone.util.ViewUtil;
|
||||||
|
|
||||||
|
|
@ -85,7 +84,7 @@ public class PlaylistDetailActivity extends AbsMusicContentActivity implements C
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpRecyclerView() {
|
private void setUpRecyclerView() {
|
||||||
ViewUtil.setUpFastScrollRecyclerViewColor(this, binding.recyclerView, ThemeStore.accentColor(this));
|
ViewUtil.setUpFastScrollRecyclerViewColor(this, binding.recyclerView, PreferenceUtil.getInstance(this).getAccentColor());
|
||||||
binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|
||||||
recyclerViewDragDropManager = new RecyclerViewDragDropManager();
|
recyclerViewDragDropManager = new RecyclerViewDragDropManager();
|
||||||
|
|
@ -115,7 +114,7 @@ public class PlaylistDetailActivity extends AbsMusicContentActivity implements C
|
||||||
|
|
||||||
private void setUpToolbar() {
|
private void setUpToolbar() {
|
||||||
binding.toolbar.setTitle(playlist.name);
|
binding.toolbar.setTitle(playlist.name);
|
||||||
binding.toolbar.setBackgroundColor(ThemeStore.primaryColor(this));
|
binding.toolbar.setBackgroundColor(PreferenceUtil.getInstance(this).getPrimaryColor());
|
||||||
setSupportActionBar(binding.toolbar);
|
setSupportActionBar(binding.toolbar);
|
||||||
// noinspection ConstantConditions
|
// noinspection ConstantConditions
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
@ -149,7 +148,7 @@ public class PlaylistDetailActivity extends AbsMusicContentActivity implements C
|
||||||
cab = new MaterialCab(this, R.id.cab_stub)
|
cab = new MaterialCab(this, R.id.cab_stub)
|
||||||
.setMenu(menu)
|
.setMenu(menu)
|
||||||
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
||||||
.setBackgroundColor(ThemeUtil.shiftBackgroundColorForLightText(ThemeStore.primaryColor(this)))
|
.setBackgroundColor(PreferenceUtil.getInstance(this).getPrimaryColor())
|
||||||
.start(callback);
|
.start(callback);
|
||||||
|
|
||||||
return cab;
|
return cab;
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
import com.dkanada.gramophone.util.ShortcutUtil;
|
import com.dkanada.gramophone.util.ShortcutUtil;
|
||||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
|
||||||
import com.dkanada.gramophone.R;
|
import com.dkanada.gramophone.R;
|
||||||
import com.dkanada.gramophone.helper.MusicPlayerRemote;
|
import com.dkanada.gramophone.helper.MusicPlayerRemote;
|
||||||
import com.dkanada.gramophone.interfaces.CabHolder;
|
import com.dkanada.gramophone.interfaces.CabHolder;
|
||||||
|
|
@ -30,7 +30,7 @@ public class ShuffleButtonSongAdapter extends AbsOffsetSongAdapter {
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull final SongAdapter.ViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull final SongAdapter.ViewHolder holder, int position) {
|
||||||
if (holder.getItemViewType() == OFFSET_ITEM) {
|
if (holder.getItemViewType() == OFFSET_ITEM) {
|
||||||
int accentColor = ThemeStore.accentColor(activity);
|
int accentColor = PreferenceUtil.getInstance(activity).getAccentColor();
|
||||||
if (holder.title != null) {
|
if (holder.title != null) {
|
||||||
holder.title.setText(activity.getResources().getString(R.string.action_shuffle_all).toUpperCase());
|
holder.title.setText(activity.getResources().getString(R.string.action_shuffle_all).toUpperCase());
|
||||||
holder.title.setTextColor(accentColor);
|
holder.title.setTextColor(accentColor);
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import com.dkanada.gramophone.databinding.FragmentMainActivityRecyclerViewBindin
|
||||||
import com.dkanada.gramophone.util.PreferenceUtil;
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
import com.google.android.material.appbar.AppBarLayout;
|
import com.google.android.material.appbar.AppBarLayout;
|
||||||
import com.google.android.material.appbar.AppBarLayout.OnOffsetChangedListener;
|
import com.google.android.material.appbar.AppBarLayout.OnOffsetChangedListener;
|
||||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
|
||||||
import com.dkanada.gramophone.R;
|
import com.dkanada.gramophone.R;
|
||||||
import com.dkanada.gramophone.util.ViewUtil;
|
import com.dkanada.gramophone.util.ViewUtil;
|
||||||
|
|
||||||
|
|
@ -71,7 +70,7 @@ public abstract class AbsLibraryPagerRecyclerViewFragment<A extends RecyclerView
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initRecyclerView() {
|
private void initRecyclerView() {
|
||||||
ViewUtil.setUpFastScrollRecyclerViewColor(getActivity(), binding.recyclerView, ThemeStore.accentColor(requireActivity()));
|
ViewUtil.setUpFastScrollRecyclerViewColor(getActivity(), binding.recyclerView, PreferenceUtil.getInstance(requireActivity()).getAccentColor());
|
||||||
|
|
||||||
binding.recyclerView.setLayoutManager(layoutManager);
|
binding.recyclerView.setLayoutManager(layoutManager);
|
||||||
binding.recyclerView.setAdapter(adapter);
|
binding.recyclerView.setAdapter(adapter);
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,9 @@ import com.dkanada.gramophone.helper.MusicPlayerRemote;
|
||||||
import com.dkanada.gramophone.util.ShortcutUtil;
|
import com.dkanada.gramophone.util.ShortcutUtil;
|
||||||
import com.google.android.material.appbar.AppBarLayout;
|
import com.google.android.material.appbar.AppBarLayout;
|
||||||
import com.afollestad.materialcab.MaterialCab;
|
import com.afollestad.materialcab.MaterialCab;
|
||||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
|
||||||
import com.kabouzeid.appthemehelper.common.ATHToolbarActivity;
|
import com.kabouzeid.appthemehelper.common.ATHToolbarActivity;
|
||||||
|
import com.kabouzeid.appthemehelper.util.ColorUtil;
|
||||||
|
import com.kabouzeid.appthemehelper.util.MaterialValueHelper;
|
||||||
import com.kabouzeid.appthemehelper.util.TabLayoutUtil;
|
import com.kabouzeid.appthemehelper.util.TabLayoutUtil;
|
||||||
import com.kabouzeid.appthemehelper.util.ToolbarContentTintHelper;
|
import com.kabouzeid.appthemehelper.util.ToolbarContentTintHelper;
|
||||||
import com.dkanada.gramophone.R;
|
import com.dkanada.gramophone.R;
|
||||||
|
|
@ -38,7 +39,6 @@ import com.dkanada.gramophone.fragments.library.AbsLibraryPagerRecyclerViewCusto
|
||||||
import com.dkanada.gramophone.fragments.library.AlbumsFragment;
|
import com.dkanada.gramophone.fragments.library.AlbumsFragment;
|
||||||
import com.dkanada.gramophone.fragments.library.PlaylistsFragment;
|
import com.dkanada.gramophone.fragments.library.PlaylistsFragment;
|
||||||
import com.dkanada.gramophone.fragments.library.SongsFragment;
|
import com.dkanada.gramophone.fragments.library.SongsFragment;
|
||||||
import com.dkanada.gramophone.util.ThemeUtil;
|
|
||||||
import com.dkanada.gramophone.util.PreferenceUtil;
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
|
|
||||||
public class LibraryFragment extends AbsMainActivityFragment implements CabHolder, MainActivity.MainActivityFragmentCallbacks, ViewPager.OnPageChangeListener, SharedPreferences.OnSharedPreferenceChangeListener {
|
public class LibraryFragment extends AbsMainActivityFragment implements CabHolder, MainActivity.MainActivityFragmentCallbacks, ViewPager.OnPageChangeListener, SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
|
|
@ -95,7 +95,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpToolbar() {
|
private void setUpToolbar() {
|
||||||
int primaryColor = ThemeStore.primaryColor(requireActivity());
|
int primaryColor = PreferenceUtil.getInstance(requireActivity()).getPrimaryColor();
|
||||||
binding.appbar.setBackgroundColor(primaryColor);
|
binding.appbar.setBackgroundColor(primaryColor);
|
||||||
binding.toolbar.setBackgroundColor(primaryColor);
|
binding.toolbar.setBackgroundColor(primaryColor);
|
||||||
binding.toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
|
binding.toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
|
||||||
|
|
@ -110,12 +110,12 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
||||||
|
|
||||||
binding.tabs.setupWithViewPager(binding.pager);
|
binding.tabs.setupWithViewPager(binding.pager);
|
||||||
|
|
||||||
int primaryColor = ThemeStore.primaryColor(requireActivity());
|
int primaryColor = PreferenceUtil.getInstance(requireActivity()).getPrimaryColor();
|
||||||
int normalColor = ToolbarContentTintHelper.toolbarSubtitleColor(requireActivity(), primaryColor);
|
int normalColor = MaterialValueHelper.getSecondaryTextColor(requireActivity(), ColorUtil.isColorLight(primaryColor));
|
||||||
int selectedColor = ToolbarContentTintHelper.toolbarTitleColor(requireActivity(), primaryColor);
|
int selectedColor = MaterialValueHelper.getPrimaryTextColor(requireActivity(), ColorUtil.isColorLight(primaryColor));
|
||||||
TabLayoutUtil.setTabIconColors(binding.tabs, normalColor, selectedColor);
|
TabLayoutUtil.setTabIconColors(binding.tabs, normalColor, selectedColor);
|
||||||
binding.tabs.setTabTextColors(normalColor, selectedColor);
|
binding.tabs.setTabTextColors(normalColor, selectedColor);
|
||||||
binding.tabs.setSelectedTabIndicatorColor(ThemeStore.accentColor(requireActivity()));
|
binding.tabs.setSelectedTabIndicatorColor(PreferenceUtil.getInstance(requireActivity()).getAccentColor());
|
||||||
|
|
||||||
updateTabVisibility();
|
updateTabVisibility();
|
||||||
|
|
||||||
|
|
@ -146,7 +146,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
||||||
cab = new MaterialCab(getMainActivity(), R.id.cab_stub)
|
cab = new MaterialCab(getMainActivity(), R.id.cab_stub)
|
||||||
.setMenu(menuRes)
|
.setMenu(menuRes)
|
||||||
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
||||||
.setBackgroundColor(ThemeUtil.shiftBackgroundColorForLightText(ThemeStore.primaryColor(requireActivity())))
|
.setBackgroundColor(PreferenceUtil.getInstance(requireActivity()).getPrimaryColor())
|
||||||
.start(callback);
|
.start(callback);
|
||||||
|
|
||||||
return cab;
|
return cab;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.dkanada.gramophone.databinding.FragmentMiniPlayerBinding;
|
import com.dkanada.gramophone.databinding.FragmentMiniPlayerBinding;
|
||||||
import com.dkanada.gramophone.model.Song;
|
import com.dkanada.gramophone.model.Song;
|
||||||
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
import com.kabouzeid.appthemehelper.ThemeStore;
|
||||||
import com.kabouzeid.appthemehelper.util.ATHUtil;
|
import com.kabouzeid.appthemehelper.util.ATHUtil;
|
||||||
import com.dkanada.gramophone.R;
|
import com.dkanada.gramophone.R;
|
||||||
|
|
@ -56,9 +57,10 @@ public class MiniPlayerFragment extends AbsMusicServiceFragment implements Music
|
||||||
|
|
||||||
private void setUpMiniPlayer() {
|
private void setUpMiniPlayer() {
|
||||||
setUpPlayPauseButton();
|
setUpPlayPauseButton();
|
||||||
|
int accentColor = PreferenceUtil.getInstance(requireActivity()).getAccentColor();
|
||||||
|
|
||||||
binding.progressBar.setProgressTintList(ColorStateList.valueOf(ThemeStore.accentColor(requireActivity())));
|
binding.progressBar.setSupportProgressTintList(ColorStateList.valueOf(accentColor));
|
||||||
binding.progressBar.setIndeterminateTintList(ColorStateList.valueOf(ThemeStore.accentColor(requireActivity())));
|
binding.progressBar.setSupportIndeterminateTintList(ColorStateList.valueOf(accentColor));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpPlayPauseButton() {
|
private void setUpPlayPauseButton() {
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import com.dkanada.gramophone.views.ColorCircleDrawable;
|
||||||
import com.flask.colorpicker.ColorPickerView;
|
import com.flask.colorpicker.ColorPickerView;
|
||||||
import com.flask.colorpicker.builder.ColorPickerClickListener;
|
import com.flask.colorpicker.builder.ColorPickerClickListener;
|
||||||
import com.flask.colorpicker.builder.ColorPickerDialogBuilder;
|
import com.flask.colorpicker.builder.ColorPickerDialogBuilder;
|
||||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
|
||||||
|
|
||||||
public class ColorPreference extends Preference implements View.OnClickListener, ColorPickerClickListener {
|
public class ColorPreference extends Preference implements View.OnClickListener, ColorPickerClickListener {
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
|
|
@ -52,13 +51,6 @@ public class ColorPreference extends Preference implements View.OnClickListener,
|
||||||
public void onClick(DialogInterface dialog, int color, Integer[] allColors) {
|
public void onClick(DialogInterface dialog, int color, Integer[] allColors) {
|
||||||
preferences.edit().putInt(getKey(), color).apply();
|
preferences.edit().putInt(getKey(), color).apply();
|
||||||
colorView.setColor(color);
|
colorView.setColor(color);
|
||||||
|
|
||||||
// TODO remove this when the theme helper library is removed
|
|
||||||
if (getKey().equals(PreferenceUtil.PRIMARY_COLOR)) {
|
|
||||||
ThemeStore.editTheme(getContext()).primaryColor(color).commit();
|
|
||||||
} else if (getKey().equals(PreferenceUtil.ACCENT_COLOR)) {
|
|
||||||
ThemeStore.editTheme(getContext()).accentColor(color).commit();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ import android.util.TypedValue;
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
import androidx.core.graphics.drawable.IconCompat;
|
import androidx.core.graphics.drawable.IconCompat;
|
||||||
|
|
||||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
|
||||||
import com.dkanada.gramophone.R;
|
import com.dkanada.gramophone.R;
|
||||||
import com.dkanada.gramophone.util.ImageUtil;
|
import com.dkanada.gramophone.util.ImageUtil;
|
||||||
import com.dkanada.gramophone.util.PreferenceUtil;
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
|
|
@ -41,7 +40,7 @@ public final class AppShortcutIconGenerator {
|
||||||
|
|
||||||
// Return an Icon of iconId with those colors
|
// Return an Icon of iconId with those colors
|
||||||
return generateThemedIcon(context, iconId,
|
return generateThemedIcon(context, iconId,
|
||||||
ThemeStore.primaryColor(context),
|
PreferenceUtil.getInstance(context).getPrimaryColor(),
|
||||||
typedColorBackground.data
|
typedColorBackground.data
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue