diff --git a/app/src/main/java/com/kabouzeid/gramophone/shortcuts/AppShortcutIconGenerator.java b/app/src/main/java/com/kabouzeid/gramophone/shortcuts/AppShortcutIconGenerator.java index bca090d6..7e3851be 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/shortcuts/AppShortcutIconGenerator.java +++ b/app/src/main/java/com/kabouzeid/gramophone/shortcuts/AppShortcutIconGenerator.java @@ -22,7 +22,7 @@ import com.kabouzeid.gramophone.util.PreferenceUtil; public final class AppShortcutIconGenerator { public static Icon generateThemedIcon(Context context, int iconId) { - if (PreferenceUtil.getInstance(context).getColoredAppShortcuts()) { + if (PreferenceUtil.getInstance(context).getColoredShortcuts()) { return generateUserThemedIcon(context, iconId).toIcon(); } else { return generateDefaultThemedIcon(context, iconId).toIcon(); diff --git a/app/src/main/java/com/kabouzeid/gramophone/ui/activities/SettingsActivity.java b/app/src/main/java/com/kabouzeid/gramophone/ui/activities/SettingsActivity.java index 2fc75fa6..8272fd7d 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/ui/activities/SettingsActivity.java +++ b/app/src/main/java/com/kabouzeid/gramophone/ui/activities/SettingsActivity.java @@ -122,7 +122,6 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia addPreferencesFromResource(R.xml.pref_now_playing_screen); addPreferencesFromResource(R.xml.pref_lockscreen); addPreferencesFromResource(R.xml.pref_audio); - addPreferencesFromResource(R.xml.pref_playlists); } @Nullable @@ -236,10 +235,10 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N_MR1) { colorAppShortcuts.setVisible(false); } else { - colorAppShortcuts.setChecked(PreferenceUtil.getInstance(getActivity()).getColoredAppShortcuts()); + colorAppShortcuts.setChecked(PreferenceUtil.getInstance(getActivity()).getColoredShortcuts()); colorAppShortcuts.setOnPreferenceChangeListener((preference, newValue) -> { // Save preference - PreferenceUtil.getInstance(getActivity()).setColoredAppShortcuts((Boolean) newValue); + PreferenceUtil.getInstance(getActivity()).setColoredShortcuts((Boolean) newValue); // Update app shortcuts new DynamicShortcutManager(getActivity()).updateDynamicShortcuts(); diff --git a/app/src/main/java/com/kabouzeid/gramophone/util/PreferenceUtil.java b/app/src/main/java/com/kabouzeid/gramophone/util/PreferenceUtil.java index 100986bd..b02be43b 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/util/PreferenceUtil.java +++ b/app/src/main/java/com/kabouzeid/gramophone/util/PreferenceUtil.java @@ -51,14 +51,12 @@ public final class PreferenceUtil { public static final String CLASSIC_NOTIFICATION = "classic_notification"; public static final String GENERAL_THEME = "general_theme"; - public static final String COLORED_APP_SHORTCUTS = "colored_app_shortcuts"; + public static final String COLORED_SHORTCUTS = "colored_shortcuts"; public static final String AUDIO_DUCKING = "audio_ducking"; public static final String GAPLESS_PLAYBACK = "gapless_playback"; public static final String REMEMBER_SHUFFLE = "remember_shuffle"; - public static final String LAST_ADDED_CUTOFF = "last_added_interval"; - public static final String SHOW_ALBUM_COVER = "show_album_cover"; public static final String BLUR_ALBUM_COVER = "blur_album_cover"; @@ -157,22 +155,26 @@ public final class PreferenceUtil { editor.apply(); } - public final boolean getColoredAppShortcuts() { - return mPreferences.getBoolean(COLORED_APP_SHORTCUTS, true); + public final boolean getColoredShortcuts() { + return mPreferences.getBoolean(COLORED_SHORTCUTS, true); } - public void setColoredAppShortcuts(final boolean value) { + public void setColoredShortcuts(final boolean value) { final SharedPreferences.Editor editor = mPreferences.edit(); - editor.putBoolean(COLORED_APP_SHORTCUTS, value); + editor.putBoolean(COLORED_SHORTCUTS, value); editor.apply(); } + public final boolean getAudioDucking() { + return mPreferences.getBoolean(AUDIO_DUCKING, true); + } + public final boolean getGaplessPlayback() { return mPreferences.getBoolean(GAPLESS_PLAYBACK, true); } - public final boolean getAudioDucking() { - return mPreferences.getBoolean(AUDIO_DUCKING, true); + public final boolean getRememberShuffle() { + return mPreferences.getBoolean(REMEMBER_SHUFFLE, true); } public final boolean getShowAlbumCover() { @@ -229,34 +231,6 @@ public final class PreferenceUtil { return mPreferences.getString(GENRE_SORT_ORDER, SortOrder.GenreSortOrder.GENRE_A_Z); } - public long getLastAddedCutoff() { - final CalendarUtil calendarUtil = new CalendarUtil(); - long interval; - switch (mPreferences.getString(LAST_ADDED_CUTOFF, "")) { - case "today": - interval = calendarUtil.getElapsedToday(); - break; - case "this_week": - interval = calendarUtil.getElapsedWeek(); - break; - case "past_seven_days": - interval = calendarUtil.getElapsedDays(7); - break; - case "past_three_months": - interval = calendarUtil.getElapsedMonths(3); - break; - case "this_year": - interval = calendarUtil.getElapsedYear(); - break; - case "this_month": - default: - interval = calendarUtil.getElapsedMonth(); - break; - } - - return (System.currentTimeMillis() - interval) / 1000; - } - public int getLastSleepTimerValue() { return mPreferences.getInt(LAST_SLEEP_TIMER_VALUE, 30); } @@ -387,20 +361,6 @@ public final class PreferenceUtil { editor.apply(); } - public final boolean getRememberShuffle() { - return mPreferences.getBoolean(REMEMBER_SHUFFLE, true); - } - - public void setLibraryCategories(List categories) { - Gson gson = new Gson(); - Type collectionType = new TypeToken>() { - }.getType(); - - final SharedPreferences.Editor editor = mPreferences.edit(); - editor.putString(LIBRARY_CATEGORIES, gson.toJson(categories, collectionType)); - editor.apply(); - } - public List getLibraryCategories() { String data = mPreferences.getString(LIBRARY_CATEGORIES, null); if (data != null) { @@ -418,6 +378,15 @@ public final class PreferenceUtil { return getDefaultLibraryCategories(); } + public void setLibraryCategories(List categories) { + Gson gson = new Gson(); + Type collectionType = new TypeToken>() {}.getType(); + + final SharedPreferences.Editor editor = mPreferences.edit(); + editor.putString(LIBRARY_CATEGORIES, gson.toJson(categories, collectionType)); + editor.apply(); + } + public List getDefaultLibraryCategories() { List defaultCategories = new ArrayList<>(5); defaultCategories.add(new CategoryInfo(CategoryInfo.Category.SONGS, true)); diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 31bda0f6..74485e5c 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -12,22 +12,4 @@ black - - @string/today - @string/this_week - @string/past_seven_days - @string/this_month - @string/past_three_months - @string/this_year - - - - today - this_week - past_seven_days - this_month - past_three_months - this_year - - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0455e7c2..3f3d481f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -87,7 +87,7 @@ This year Equalizer Colors - Now playing + Now Playing General theme Audio Library @@ -125,16 +125,16 @@ Empty Playlist name Song - Uses the current songs album cover as lockscreen wallpaper. - Blurs the album cover on the lockscreen. Can cause problems with third party apps and widgets. + Uses the current song\'s album cover as the lockscreen wallpaper. + Blurs the album cover on the lockscreen. This can cause problems with third party apps and widgets. Use the classic notification design. - "Colors the notification in the album cover\u2019s vibrant color." - "Can cause playback issues on some devices." + "Colors the notification with a vibrant color taken from the album cover." + Decrease the volume for notifications and other system sounds. + "This can cause playback issues on some devices." + Shuffle mode will stay on when selecting a new list of songs for the queue. Colors the navigation bar in the primary color. Colors the app shortcuts in the primary color. - Notifications, navigation etc. - Go to the last opened tab on launch - Shuffle mode will stay on when selecting a new list of songs + Go to the last opened tab on launch. Favorites Last added Recently played @@ -166,17 +166,17 @@ Follow on Twitter Visit website Report bugs - Report bugs or request new features. + Open a new issue for bugs or features. Translate - Help translating Phonograph to your native language. + Help translate strings to your native language. Rate Leave a positive rating on Google Play if you like Phonograph. Donate If you think I deserve to get paid for my work, you can leave me a few dollars here. - For the theme engine and some other great stuff. + Improved theme engine and made some other excellent additions. For the pretty material app icon. - For making the Play Store illustration and the empty album cover. - For helping me with the design. + Designed a placeholder image for albums with no cover art. + Made great improvements to the general design. Website Loading products… Up next @@ -201,8 +201,8 @@ Playlist is empty The playing notification provides actions for play/pause etc. Playing notification - For his contributions to the source code. - For creating the album page design. + Several amazing contributions to the source code. + Designed the new album page which was then ported to other activities. Add Library categories Configure visibility and order of library categories. diff --git a/app/src/main/res/xml/pref_playlists.xml b/app/src/main/res/xml/pref_playlists.xml deleted file mode 100644 index 83f4c68e..00000000 --- a/app/src/main/res/xml/pref_playlists.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - -