aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-11-12 04:07:35 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-11-12 04:07:35 +0000
commit95a9215ec8159c01bada1d07bb7b647372016b80 (patch)
treef4b876a918856438f97a33e1b14731adf72f561a /app/src
parentf9834f644c15b0b9e3be4c83a580506aec30ccfe (diff)
downloadinfinity-for-reddit-95a9215ec8159c01bada1d07bb7b647372016b80.tar
infinity-for-reddit-95a9215ec8159c01bada1d07bb7b647372016b80.tar.gz
infinity-for-reddit-95a9215ec8159c01bada1d07bb7b647372016b80.tar.bz2
infinity-for-reddit-95a9215ec8159c01bada1d07bb7b647372016b80.tar.lz
infinity-for-reddit-95a9215ec8159c01bada1d07bb7b647372016b80.tar.xz
infinity-for-reddit-95a9215ec8159c01bada1d07bb7b647372016b80.tar.zst
infinity-for-reddit-95a9215ec8159c01bada1d07bb7b647372016b80.zip
Disable swipe action when there are more than 1 column in PostFragment.
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java2
-rw-r--r--app/src/main/res/values/strings.xml1
-rw-r--r--app/src/main/res/xml/swipe_action_preferences.xml5
-rw-r--r--app/src/main/res/xml/theme_preferences.xml5
4 files changed, 9 insertions, 4 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java
index c0b00a18..482ebb21 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java
@@ -785,7 +785,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
}
});
- if (mSharedPreferences.getBoolean(SharedPreferencesUtils.ENABLE_SWIPE_ACTION, false)) {
+ if (nColumns == 1 && mSharedPreferences.getBoolean(SharedPreferencesUtils.ENABLE_SWIPE_ACTION, false)) {
touchHelper.attachToRecyclerView(mPostRecyclerView);
}
mPostRecyclerView.setAdapter(mAdapter);
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 02dfa6f9..ecc9b8a5 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -506,6 +506,7 @@
<string name="settings_disable_image_preview_title">Disable Image Preview in Data Saving Mode</string>
<string name="settings_swipe_action_swipe_left_title">Swipe Left</string>
<string name="settings_swipe_action_swipe_right_title">Swipe Right</string>
+ <string name="settings_swipe_action_info_summary">Not applicable to post feed with more than 1 column.</string>
<string name="no_link_available">Cannot get the link</string>
diff --git a/app/src/main/res/xml/swipe_action_preferences.xml b/app/src/main/res/xml/swipe_action_preferences.xml
index c15330b6..efdbed67 100644
--- a/app/src/main/res/xml/swipe_action_preferences.xml
+++ b/app/src/main/res/xml/swipe_action_preferences.xml
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
+ <Preference
+ app:icon="@drawable/ic_info_preference_24dp"
+ app:summary="@string/settings_swipe_action_info_summary"
+ app:enabled="false" />
+
<SwitchPreference
app:defaultValue="false"
app:key="enable_swipe_action"
diff --git a/app/src/main/res/xml/theme_preferences.xml b/app/src/main/res/xml/theme_preferences.xml
index a520fc49..f4fb02a8 100644
--- a/app/src/main/res/xml/theme_preferences.xml
+++ b/app/src/main/res/xml/theme_preferences.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto">
+<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
<ListPreference
app:defaultValue="2"
@@ -42,7 +41,7 @@
app:title="@string/settings_manage_themes_title" />
<Preference
- android:icon="@drawable/ic_info_preference_24dp"
+ app:icon="@drawable/ic_info_preference_24dp"
app:summary="@string/settings_custom_theme_cannot_apply_to_settings_page_summary"
app:enabled="false" />