diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2015-04-22 09:53:48 +0200 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2015-04-22 09:53:48 +0200 |
commit | b253289b1f90783db536a490b63530b72df2ea8b (patch) | |
tree | ca35f92e2a96dc1aadd3ae89b48af154f2e5d7b8 /core/src | |
parent | 75d9c6ec7bb316ee677da2dc9bb3b187d0958a19 (diff) | |
parent | 8ed0353c48de056086e5b82977d6660826c130bc (diff) | |
download | AntennaPod-b253289b1f90783db536a490b63530b72df2ea8b.zip |
Merge pull request #759 from mfietz/nav_drawer_preferences
Nav Drawer Preferences
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java | 23 | ||||
-rwxr-xr-x | core/src/main/res/drawable-hdpi/ic_feed_grey600_24dp.png | bin | 1601 -> 2359 bytes | |||
-rwxr-xr-x | core/src/main/res/drawable-hdpi/ic_feed_white_24dp.png | bin | 1367 -> 1663 bytes | |||
-rwxr-xr-x | core/src/main/res/drawable-mdpi/ic_feed_grey600_24dp.png | bin | 1018 -> 1566 bytes | |||
-rwxr-xr-x | core/src/main/res/drawable-mdpi/ic_feed_white_24dp.png | bin | 875 -> 1156 bytes | |||
-rwxr-xr-x | core/src/main/res/drawable-xhdpi/ic_feed_grey600_24dp.png | bin | 2223 -> 3200 bytes | |||
-rwxr-xr-x | core/src/main/res/drawable-xhdpi/ic_feed_white_24dp.png | bin | 1933 -> 2314 bytes | |||
-rwxr-xr-x | core/src/main/res/drawable-xxhdpi/ic_feed_grey600_24dp.png | bin | 3265 -> 4754 bytes | |||
-rwxr-xr-x | core/src/main/res/drawable-xxhdpi/ic_feed_white_24dp.png | bin | 2884 -> 3406 bytes | |||
-rw-r--r-- | core/src/main/res/values/arrays.xml | 11 | ||||
-rw-r--r-- | core/src/main/res/values/dimens.xml | 4 | ||||
-rw-r--r-- | core/src/main/res/values/strings.xml | 3 |
12 files changed, 39 insertions, 2 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index 8e4ab1a49..2c863d378 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -16,6 +16,8 @@ import org.json.JSONException; import java.io.File; import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; import java.util.LinkedList; import java.util.List; import java.util.concurrent.TimeUnit; @@ -63,6 +65,7 @@ public class UserPreferences implements private static final String PREF_EXPANDED_NOTIFICATION = "prefExpandNotify"; private static final String PREF_PERSISTENT_NOTIFICATION = "prefPersistNotify"; public static final String PREF_QUEUE_ADD_TO_FRONT = "prefQueueAddToFront"; + public static final String PREF_HIDDEN_DRAWER_ITEMS = "prefHiddenDrawerItems"; // TODO: Make this value configurable private static final float PREF_AUTO_FLATTR_PLAYED_DURATION_THRESHOLD_DEFAULT = 0.8f; @@ -99,6 +102,7 @@ public class UserPreferences implements private boolean isFreshInstall; private int notifyPriority; private boolean persistNotify; + private List<String> hiddenDrawerItems; private UserPreferences(Context context) { this.context = context; @@ -167,6 +171,7 @@ public class UserPreferences implements notifyPriority = NotificationCompat.PRIORITY_DEFAULT; } persistNotify = sp.getBoolean(PREF_PERSISTENT_NOTIFICATION, false); + hiddenDrawerItems = Arrays.asList(StringUtils.split(sp.getString(PREF_HIDDEN_DRAWER_ITEMS, ""), ',')); } private int readThemeValue(String valueFromPrefs) { @@ -355,6 +360,11 @@ public class UserPreferences implements return instance.rewindSecs; } + public static List<String> getHiddenDrawerItems() { + instanceAvailable(); + return new ArrayList<String>(instance.hiddenDrawerItems); + } + /** * Returns the capacity of the episode cache. This method will return the * negative integer EPISODE_CACHE_SIZE_UNLIMITED if the cache size is set to @@ -456,6 +466,8 @@ public class UserPreferences implements } } else if (key.equals(PREF_PERSISTENT_NOTIFICATION)) { persistNotify = sp.getBoolean(PREF_PERSISTENT_NOTIFICATION, false); + } else if (key.equals(PREF_HIDDEN_DRAWER_ITEMS)) { + hiddenDrawerItems = Arrays.asList(StringUtils.split(sp.getString(PREF_HIDDEN_DRAWER_ITEMS, ""), ',')); } } @@ -532,6 +544,17 @@ public class UserPreferences implements instance.autoFlattrPlayedDurationThreshold = autoFlattrThreshold; } + public static void setHiddenDrawerItems(Context context, List<String> items) { + instanceAvailable(); + instance.hiddenDrawerItems = items; + String str = StringUtils.join(items, ','); + PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext()) + .edit() + .putString(PREF_HIDDEN_DRAWER_ITEMS, str) + .commit(); + } + + /** * Return the folder where the app stores all of its data. This method will * return the standard data folder if none has been set by the user. diff --git a/core/src/main/res/drawable-hdpi/ic_feed_grey600_24dp.png b/core/src/main/res/drawable-hdpi/ic_feed_grey600_24dp.png Binary files differindex 46be3e14e..0c3bb0757 100755 --- a/core/src/main/res/drawable-hdpi/ic_feed_grey600_24dp.png +++ b/core/src/main/res/drawable-hdpi/ic_feed_grey600_24dp.png diff --git a/core/src/main/res/drawable-hdpi/ic_feed_white_24dp.png b/core/src/main/res/drawable-hdpi/ic_feed_white_24dp.png Binary files differindex 3d57127f5..667300129 100755 --- a/core/src/main/res/drawable-hdpi/ic_feed_white_24dp.png +++ b/core/src/main/res/drawable-hdpi/ic_feed_white_24dp.png diff --git a/core/src/main/res/drawable-mdpi/ic_feed_grey600_24dp.png b/core/src/main/res/drawable-mdpi/ic_feed_grey600_24dp.png Binary files differindex 79f082610..d46b325d8 100755 --- a/core/src/main/res/drawable-mdpi/ic_feed_grey600_24dp.png +++ b/core/src/main/res/drawable-mdpi/ic_feed_grey600_24dp.png diff --git a/core/src/main/res/drawable-mdpi/ic_feed_white_24dp.png b/core/src/main/res/drawable-mdpi/ic_feed_white_24dp.png Binary files differindex 15a4b16bf..ac94476c2 100755 --- a/core/src/main/res/drawable-mdpi/ic_feed_white_24dp.png +++ b/core/src/main/res/drawable-mdpi/ic_feed_white_24dp.png diff --git a/core/src/main/res/drawable-xhdpi/ic_feed_grey600_24dp.png b/core/src/main/res/drawable-xhdpi/ic_feed_grey600_24dp.png Binary files differindex 5cb0262ee..b25d64863 100755 --- a/core/src/main/res/drawable-xhdpi/ic_feed_grey600_24dp.png +++ b/core/src/main/res/drawable-xhdpi/ic_feed_grey600_24dp.png diff --git a/core/src/main/res/drawable-xhdpi/ic_feed_white_24dp.png b/core/src/main/res/drawable-xhdpi/ic_feed_white_24dp.png Binary files differindex 5f34b0492..3c3e74c1d 100755 --- a/core/src/main/res/drawable-xhdpi/ic_feed_white_24dp.png +++ b/core/src/main/res/drawable-xhdpi/ic_feed_white_24dp.png diff --git a/core/src/main/res/drawable-xxhdpi/ic_feed_grey600_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_feed_grey600_24dp.png Binary files differindex 01ef2ee4d..aacf24d28 100755 --- a/core/src/main/res/drawable-xxhdpi/ic_feed_grey600_24dp.png +++ b/core/src/main/res/drawable-xxhdpi/ic_feed_grey600_24dp.png diff --git a/core/src/main/res/drawable-xxhdpi/ic_feed_white_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_feed_white_24dp.png Binary files differindex 6dd465852..625dbaa1f 100755 --- a/core/src/main/res/drawable-xxhdpi/ic_feed_white_24dp.png +++ b/core/src/main/res/drawable-xxhdpi/ic_feed_white_24dp.png diff --git a/core/src/main/res/values/arrays.xml b/core/src/main/res/values/arrays.xml index 979653c79..ccf14d329 100644 --- a/core/src/main/res/values/arrays.xml +++ b/core/src/main/res/values/arrays.xml @@ -118,6 +118,7 @@ <string-array name="autodl_select_networks_default_values"> <item>0</item> </string-array> + <string-array name="theme_options"> <item>@string/pref_theme_title_light</item> <item>@string/pref_theme_title_dark</item> @@ -126,4 +127,14 @@ <item>0</item> <item>1</item> </string-array> + + <string-array name="nav_drawer_titles"> + <item>@string/queue_label</item> + <item>@string/new_episodes_label</item> + <item>@string/all_episodes_label</item> + <item>@string/downloads_label</item> + <item>@string/playback_history_label</item> + <item>@string/add_feed_label</item> + </string-array> + </resources> diff --git a/core/src/main/res/values/dimens.xml b/core/src/main/res/values/dimens.xml index 81a55142a..c46537b3e 100644 --- a/core/src/main/res/values/dimens.xml +++ b/core/src/main/res/values/dimens.xml @@ -16,10 +16,10 @@ <dimen name="thumbnail_length_downloaded_item">64dp</dimen> <dimen name="thumbnail_length_onlinefeedview">100dp</dimen> <dimen name="feeditemlist_header_height">132dp</dimen> - <dimen name="thumbnail_length_navlist">42dp</dimen> + <dimen name="thumbnail_length_navlist">40dp</dimen> <dimen name="listview_secondary_button_width">48dp</dimen> <dimen name="drawer_width">280dp</dimen> - <dimen name="listitem_iconwithtext_height">56dp</dimen> + <dimen name="listitem_iconwithtext_height">48dp</dimen> <dimen name="listitem_iconwithtext_textleftpadding">14dp</dimen> <dimen name="listitem_iconwithtext_textverticalpadding">16dp</dimen> diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index f3741e89f..f162bb353 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -32,6 +32,7 @@ <!-- Main activity --> <string name="drawer_open">Open menu</string> <string name="drawer_close">Close menu</string> + <string name="drawer_preferences">Drawer Preferences</string> <!-- Webview actions --> <string name="open_in_browser_label">Open in browser</string> @@ -246,6 +247,8 @@ <string name="pref_auto_flattr_sum">Configure automatic flattring</string> <string name="user_interface_label">User Interface</string> <string name="pref_set_theme_title">Select theme</string> + <string name="pref_nav_drawer_items_title">Change navigation drawer</string> + <string name="pref_nav_drawer_items_sum">Change which items appear in the navigation drawer.</string> <string name="pref_set_theme_sum">Change the appearance of AntennaPod.</string> <string name="pref_automatic_download_title">Automatic download</string> <string name="pref_automatic_download_sum">Configure the automatic download of episodes.</string> |