summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorTom Hennen <TomHennen@users.noreply.github.com>2015-05-03 14:49:03 -0400
committerTom Hennen <TomHennen@users.noreply.github.com>2015-05-03 14:49:03 -0400
commitcd4bd0e37d76d48d01e9549ee31610c36279cdc8 (patch)
treec0cadb83a91a288df67fa84cebd58776f58bd11a /core
parent4e78205e624b6f3b19272c2a04f02d14f44875fd (diff)
parenta92220f8dbb3339ea101abeac0cf77bd87d9b544 (diff)
downloadAntennaPod-cd4bd0e37d76d48d01e9549ee31610c36279cdc8.zip
Merge pull request #787 from mfietz/feature/queue-lock
Queue Lock: Swipe and drag can be disabled
Diffstat (limited to 'core')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java19
-rw-r--r--core/src/main/res/drawable-hdpi/ic_lock_closed_grey600_24dp.pngbin0 -> 366 bytes
-rw-r--r--core/src/main/res/drawable-hdpi/ic_lock_closed_white_24dp.pngbin0 -> 358 bytes
-rw-r--r--core/src/main/res/drawable-hdpi/ic_lock_open_grey600_24dp.pngbin0 -> 362 bytes
-rw-r--r--core/src/main/res/drawable-hdpi/ic_lock_open_white_24dp.pngbin0 -> 356 bytes
-rw-r--r--core/src/main/res/drawable-mdpi/ic_lock_closed_grey600_24dp.pngbin0 -> 242 bytes
-rw-r--r--core/src/main/res/drawable-mdpi/ic_lock_closed_white_24dp.pngbin0 -> 237 bytes
-rw-r--r--core/src/main/res/drawable-mdpi/ic_lock_open_grey600_24dp.pngbin0 -> 242 bytes
-rw-r--r--core/src/main/res/drawable-mdpi/ic_lock_open_white_24dp.pngbin0 -> 238 bytes
-rw-r--r--core/src/main/res/drawable-xhdpi/ic_lock_closed_grey600_24dp.pngbin0 -> 430 bytes
-rw-r--r--core/src/main/res/drawable-xhdpi/ic_lock_closed_white_24dp.pngbin0 -> 421 bytes
-rw-r--r--core/src/main/res/drawable-xhdpi/ic_lock_open_grey600_24dp.pngbin0 -> 427 bytes
-rw-r--r--core/src/main/res/drawable-xhdpi/ic_lock_open_white_24dp.pngbin0 -> 420 bytes
-rw-r--r--core/src/main/res/drawable-xxhdpi/ic_lock_closed_grey600_24dp.pngbin0 -> 630 bytes
-rw-r--r--core/src/main/res/drawable-xxhdpi/ic_lock_closed_white_24dp.pngbin0 -> 621 bytes
-rw-r--r--core/src/main/res/drawable-xxhdpi/ic_lock_open_grey600_24dp.pngbin0 -> 627 bytes
-rw-r--r--core/src/main/res/drawable-xxhdpi/ic_lock_open_white_24dp.pngbin0 -> 621 bytes
-rw-r--r--core/src/main/res/drawable-xxxhdpi/ic_lock_closed_grey600_24dp.pngbin0 -> 854 bytes
-rw-r--r--core/src/main/res/drawable-xxxhdpi/ic_lock_closed_white_24dp.pngbin0 -> 839 bytes
-rw-r--r--core/src/main/res/drawable-xxxhdpi/ic_lock_open_grey600_24dp.pngbin0 -> 850 bytes
-rw-r--r--core/src/main/res/drawable-xxxhdpi/ic_lock_open_white_24dp.pngbin0 -> 838 bytes
-rw-r--r--core/src/main/res/values/attrs.xml2
-rw-r--r--core/src/main/res/values/strings.xml2
-rw-r--r--core/src/main/res/values/styles.xml8
24 files changed, 31 insertions, 0 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 2c863d378..bfc0cfb61 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
@@ -66,6 +66,7 @@ public class UserPreferences implements
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";
+ public static final String PREF_QUEUE_LOCKED = "prefQueueLocked";
// TODO: Make this value configurable
private static final float PREF_AUTO_FLATTR_PLAYED_DURATION_THRESHOLD_DEFAULT = 0.8f;
@@ -103,6 +104,7 @@ public class UserPreferences implements
private int notifyPriority;
private boolean persistNotify;
private List<String> hiddenDrawerItems;
+ private boolean queueLocked;
private UserPreferences(Context context) {
this.context = context;
@@ -172,6 +174,7 @@ public class UserPreferences implements
}
persistNotify = sp.getBoolean(PREF_PERSISTENT_NOTIFICATION, false);
hiddenDrawerItems = Arrays.asList(StringUtils.split(sp.getString(PREF_HIDDEN_DRAWER_ITEMS, ""), ','));
+ queueLocked = sp.getBoolean(PREF_QUEUE_LOCKED, false);
}
private int readThemeValue(String valueFromPrefs) {
@@ -395,6 +398,11 @@ public class UserPreferences implements
return instance.isFreshInstall;
}
+ public static boolean isQueueLocked() {
+ instanceAvailable();
+ return instance.queueLocked;
+ }
+
@Override
public void onSharedPreferenceChanged(SharedPreferences sp, String key) {
Log.d(TAG, "Registered change of user preferences. Key: " + key);
@@ -468,6 +476,8 @@ public class UserPreferences implements
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, ""), ','));
+ } else if(key.equals(PREF_QUEUE_LOCKED)) {
+ queueLocked = sp.getBoolean(PREF_QUEUE_LOCKED, false);
}
}
@@ -554,6 +564,15 @@ public class UserPreferences implements
.commit();
}
+ public static void setQueueLocked(boolean locked) {
+ instanceAvailable();
+ instance.queueLocked = locked;
+ PreferenceManager.getDefaultSharedPreferences(instance.context)
+ .edit()
+ .putBoolean(PREF_QUEUE_LOCKED, locked)
+ .commit();
+ }
+
/**
* Return the folder where the app stores all of its data. This method will
diff --git a/core/src/main/res/drawable-hdpi/ic_lock_closed_grey600_24dp.png b/core/src/main/res/drawable-hdpi/ic_lock_closed_grey600_24dp.png
new file mode 100644
index 000000000..b6dba1002
--- /dev/null
+++ b/core/src/main/res/drawable-hdpi/ic_lock_closed_grey600_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-hdpi/ic_lock_closed_white_24dp.png b/core/src/main/res/drawable-hdpi/ic_lock_closed_white_24dp.png
new file mode 100644
index 000000000..5c60ab08a
--- /dev/null
+++ b/core/src/main/res/drawable-hdpi/ic_lock_closed_white_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-hdpi/ic_lock_open_grey600_24dp.png b/core/src/main/res/drawable-hdpi/ic_lock_open_grey600_24dp.png
new file mode 100644
index 000000000..a99e9f2b6
--- /dev/null
+++ b/core/src/main/res/drawable-hdpi/ic_lock_open_grey600_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-hdpi/ic_lock_open_white_24dp.png b/core/src/main/res/drawable-hdpi/ic_lock_open_white_24dp.png
new file mode 100644
index 000000000..61c623ce2
--- /dev/null
+++ b/core/src/main/res/drawable-hdpi/ic_lock_open_white_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-mdpi/ic_lock_closed_grey600_24dp.png b/core/src/main/res/drawable-mdpi/ic_lock_closed_grey600_24dp.png
new file mode 100644
index 000000000..f1627ce34
--- /dev/null
+++ b/core/src/main/res/drawable-mdpi/ic_lock_closed_grey600_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-mdpi/ic_lock_closed_white_24dp.png b/core/src/main/res/drawable-mdpi/ic_lock_closed_white_24dp.png
new file mode 100644
index 000000000..8f18d11e6
--- /dev/null
+++ b/core/src/main/res/drawable-mdpi/ic_lock_closed_white_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-mdpi/ic_lock_open_grey600_24dp.png b/core/src/main/res/drawable-mdpi/ic_lock_open_grey600_24dp.png
new file mode 100644
index 000000000..ada8d3be4
--- /dev/null
+++ b/core/src/main/res/drawable-mdpi/ic_lock_open_grey600_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-mdpi/ic_lock_open_white_24dp.png b/core/src/main/res/drawable-mdpi/ic_lock_open_white_24dp.png
new file mode 100644
index 000000000..72d01c406
--- /dev/null
+++ b/core/src/main/res/drawable-mdpi/ic_lock_open_white_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-xhdpi/ic_lock_closed_grey600_24dp.png b/core/src/main/res/drawable-xhdpi/ic_lock_closed_grey600_24dp.png
new file mode 100644
index 000000000..ca35f6d0a
--- /dev/null
+++ b/core/src/main/res/drawable-xhdpi/ic_lock_closed_grey600_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-xhdpi/ic_lock_closed_white_24dp.png b/core/src/main/res/drawable-xhdpi/ic_lock_closed_white_24dp.png
new file mode 100644
index 000000000..01fb55ca1
--- /dev/null
+++ b/core/src/main/res/drawable-xhdpi/ic_lock_closed_white_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-xhdpi/ic_lock_open_grey600_24dp.png b/core/src/main/res/drawable-xhdpi/ic_lock_open_grey600_24dp.png
new file mode 100644
index 000000000..11d9a4b8b
--- /dev/null
+++ b/core/src/main/res/drawable-xhdpi/ic_lock_open_grey600_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-xhdpi/ic_lock_open_white_24dp.png b/core/src/main/res/drawable-xhdpi/ic_lock_open_white_24dp.png
new file mode 100644
index 000000000..01ca4b56c
--- /dev/null
+++ b/core/src/main/res/drawable-xhdpi/ic_lock_open_white_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-xxhdpi/ic_lock_closed_grey600_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_lock_closed_grey600_24dp.png
new file mode 100644
index 000000000..311a7fa13
--- /dev/null
+++ b/core/src/main/res/drawable-xxhdpi/ic_lock_closed_grey600_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-xxhdpi/ic_lock_closed_white_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_lock_closed_white_24dp.png
new file mode 100644
index 000000000..39a163843
--- /dev/null
+++ b/core/src/main/res/drawable-xxhdpi/ic_lock_closed_white_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-xxhdpi/ic_lock_open_grey600_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_lock_open_grey600_24dp.png
new file mode 100644
index 000000000..c0552d564
--- /dev/null
+++ b/core/src/main/res/drawable-xxhdpi/ic_lock_open_grey600_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-xxhdpi/ic_lock_open_white_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_lock_open_white_24dp.png
new file mode 100644
index 000000000..46852d54f
--- /dev/null
+++ b/core/src/main/res/drawable-xxhdpi/ic_lock_open_white_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-xxxhdpi/ic_lock_closed_grey600_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_lock_closed_grey600_24dp.png
new file mode 100644
index 000000000..e41d5b9ee
--- /dev/null
+++ b/core/src/main/res/drawable-xxxhdpi/ic_lock_closed_grey600_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-xxxhdpi/ic_lock_closed_white_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_lock_closed_white_24dp.png
new file mode 100644
index 000000000..2376b7334
--- /dev/null
+++ b/core/src/main/res/drawable-xxxhdpi/ic_lock_closed_white_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-xxxhdpi/ic_lock_open_grey600_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_lock_open_grey600_24dp.png
new file mode 100644
index 000000000..c281784dd
--- /dev/null
+++ b/core/src/main/res/drawable-xxxhdpi/ic_lock_open_grey600_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-xxxhdpi/ic_lock_open_white_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_lock_open_white_24dp.png
new file mode 100644
index 000000000..25ea3ab99
--- /dev/null
+++ b/core/src/main/res/drawable-xxxhdpi/ic_lock_open_white_24dp.png
Binary files differ
diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml
index 368921f76..caedd7673 100644
--- a/core/src/main/res/values/attrs.xml
+++ b/core/src/main/res/values/attrs.xml
@@ -37,6 +37,8 @@
<attr name="av_ff_big" format="reference"/>
<attr name="av_rew_big" format="reference"/>
<attr name="ic_settings" format="reference"/>
+ <attr name="ic_lock_open" format="reference"/>
+ <attr name="ic_lock_closed" format="reference"/>
<!-- Used in itemdescription -->
<attr name="non_transparent_background" format="reference"/>
diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml
index c0c2f06de..3421d3c52 100644
--- a/core/src/main/res/values/strings.xml
+++ b/core/src/main/res/values/strings.xml
@@ -161,6 +161,8 @@
<string name="unknown_media_key">AntennaPod - Unknown media key: %1$d</string>
<!-- Queue operations -->
+ <string name="lock_queue">Lock queue</string>
+ <string name="unlock_queue">Unlock queue</string>
<string name="clear_queue_label">Clear queue</string>
<string name="undo">Undo</string>
<string name="removed_from_queue">Item removed</string>
diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml
index 4ac4a79fd..080203745 100644
--- a/core/src/main/res/values/styles.xml
+++ b/core/src/main/res/values/styles.xml
@@ -42,6 +42,8 @@
<item name="attr/av_ff_big">@drawable/ic_fast_forward_grey600_36dp</item>
<item name="attr/av_rew_big">@drawable/ic_fast_rewind_grey600_36dp</item>
<item name="attr/ic_settings">@drawable/ic_settings_grey600_24dp</item>
+ <item name="attr/ic_lock_open">@drawable/ic_lock_open_grey600_24dp</item>
+ <item name="attr/ic_lock_closed">@drawable/ic_lock_closed_grey600_24dp</item>
</style>
<style name="Theme.AntennaPod.Dark" parent="@style/Theme.AppCompat">
@@ -84,6 +86,8 @@
<item name="attr/av_ff_big">@drawable/ic_fast_forward_white_36dp</item>
<item name="attr/av_rew_big">@drawable/ic_fast_rewind_white_36dp</item>
<item name="attr/ic_settings">@drawable/ic_settings_white_24dp</item>
+ <item name="attr/ic_lock_open">@drawable/ic_lock_open_white_24dp</item>
+ <item name="attr/ic_lock_closed">@drawable/ic_lock_closed_white_24dp</item>
</style>
<style name="Theme.AntennaPod.Light.NoTitle" parent="@style/Theme.AppCompat.Light.NoActionBar">
@@ -129,6 +133,8 @@
<item name="attr/av_ff_big">@drawable/ic_fast_forward_grey600_36dp</item>
<item name="attr/av_rew_big">@drawable/ic_fast_rewind_grey600_36dp</item>
<item name="attr/ic_settings">@drawable/ic_settings_grey600_24dp</item>
+ <item name="attr/ic_lock_open">@drawable/ic_lock_open_grey600_24dp</item>
+ <item name="attr/ic_lock_closed">@drawable/ic_lock_closed_grey600_24dp</item>
</style>
<style name="Theme.AntennaPod.Dark.NoTitle" parent="@style/Theme.AppCompat.NoActionBar">
@@ -173,6 +179,8 @@
<item name="attr/av_ff_big">@drawable/ic_fast_forward_white_36dp</item>
<item name="attr/av_rew_big">@drawable/ic_fast_rewind_white_36dp</item>
<item name="attr/ic_settings">@drawable/ic_settings_white_24dp</item>
+ <item name="attr/ic_lock_open">@drawable/ic_lock_open_white_24dp</item>
+ <item name="attr/ic_lock_closed">@drawable/ic_lock_closed_white_24dp</item>
</style>
<style name="Theme.AntennaPod.VideoPlayer" parent="@style/Theme.AntennaPod.Dark">