change the default sort methods

This commit is contained in:
dkanada 2020-11-06 11:16:00 +09:00
commit bb2793dbea
3 changed files with 7 additions and 7 deletions

View file

@ -162,7 +162,7 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
ThemeStore.markChanged(requireActivity());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
// set the new theme so that updateAppShortcuts can pull it
requireActivity().setTheme(PreferenceUtil.getThemeResFromPrefValue(themeName));
requireActivity().setTheme(PreferenceUtil.getThemeResource(themeName));
new DynamicShortcutManager(getActivity()).updateDynamicShortcuts();
}

View file

@ -18,7 +18,7 @@ import com.dkanada.gramophone.util.Util;
public abstract class AbsThemeActivity extends ATHToolbarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(PreferenceUtil.getInstance(this).getGeneralTheme());
setTheme(PreferenceUtil.getInstance(this).getTheme());
super.onCreate(savedInstanceState);
MaterialDialogsUtil.updateMaterialDialogsThemeSingleton(this);

View file

@ -110,12 +110,12 @@ public final class PreferenceUtil {
}
@StyleRes
public int getGeneralTheme() {
return getThemeResFromPrefValue(mPreferences.getString(GENERAL_THEME, "dark"));
public int getTheme() {
return getThemeResource(mPreferences.getString(GENERAL_THEME, "dark"));
}
@StyleRes
public static int getThemeResFromPrefValue(String themePrefValue) {
public static int getThemeResource(String themePrefValue) {
switch (themePrefValue) {
case "light":
return R.style.Theme_Phonograph_Light;
@ -239,7 +239,7 @@ public final class PreferenceUtil {
}
public final String getAlbumSortMethod() {
return mPreferences.getString(ALBUM_SORT_METHOD, SortMethod.NAME);
return mPreferences.getString(ALBUM_SORT_METHOD, SortMethod.RANDOM);
}
public void setAlbumSortMethod(final String sortMethod) {
@ -249,7 +249,7 @@ public final class PreferenceUtil {
}
public final String getSongSortMethod() {
return mPreferences.getString(SONG_SORT_METHOD, SortMethod.NAME);
return mPreferences.getString(SONG_SORT_METHOD, SortMethod.RANDOM);
}
public void setSongSortMethod(final String sortMethod) {