Permalink
Browse files

#612 Inverted preference

  • Loading branch information...
QuantumBadger committed Sep 11, 2018
1 parent a8d92d2 commit 2bf7cddbb5b11c5be1e21bff73e8c95a58c5a667
@@ -536,9 +536,9 @@ public static boolean pref_behaviour_nsfw(final Context context, final SharedPre
return getBoolean(R.string.pref_behaviour_nsfw_key, false, context, sharedPreferences);
}
//Show Visited Posts? False hides them. See strings.xml, prefs_behaviour.xml, PostListingFragment.java
public static boolean pref_behaviour_show_visited(final Context context, final SharedPreferences sharedPreferences) {
return getBoolean(R.string.pref_behaviour_show_read_posts_key, true, context, sharedPreferences);
//Show Visited Posts? True hides them. See strings.xml, prefs_behaviour.xml, PostListingFragment.java
public static boolean pref_behaviour_hide_read_posts(final Context context, final SharedPreferences sharedPreferences) {
return getBoolean(R.string.pref_behaviour_hide_read_posts_key, false, context, sharedPreferences);
}
public static boolean pref_behaviour_share_permalink(final Context context, final SharedPreferences sharedPreferences) {
@@ -626,7 +626,7 @@ public void run() {
final JsonBufferedArray posts = listing.getArray("children");
final boolean isNsfwAllowed = PrefsUtility.pref_behaviour_nsfw(activity, mSharedPreferences);
final boolean showVisited = PrefsUtility.pref_behaviour_show_visited(activity, mSharedPreferences);
final boolean hideReadPosts = PrefsUtility.pref_behaviour_hide_read_posts(activity, mSharedPreferences);
final boolean isConnectionWifi = General.isConnectionWifi(activity);
final PrefsUtility.AppearanceThumbnailsShow thumbnailsPref = PrefsUtility.appearance_thumbnails_show(
@@ -712,8 +712,9 @@ public void run() {
showSubredditName,
downloadThisThumbnail);
// Skip adding this post (go to next iteration) if it has been clicked on AND user preference "showVisited" is false
if (preparedPost.isRead() && !showVisited) continue;
// Skip adding this post (go to next iteration) if it has been clicked on AND user preference
// "hideReadPosts" is true
if(hideReadPosts && preparedPost.isRead()) continue;
if(precacheComments) {
@@ -93,9 +93,6 @@
<string name="pref_behaviour_nsfw_key" translatable="false">pref_behaviour_nsfw</string>
<string name="pref_behaviour_nsfw_title">Show NSFW content</string>
<string name="pref_behaviour_show_read_posts_key" translatable="false">pref_behaviour_read_posts</string>
<string name="pref_behaviour_show_read_posts_title">Show Visited Posts</string>
<!-- Cache Prefs -->
<string name="pref_cache_pruning">Cache Pruning</string>
@@ -1088,4 +1085,8 @@
<string name="pref_behaviour_usecustomtabs_title">Use Custom Tabs</string>
<string name="pref_behaviour_usecustomtabs_summary">Use Custom Tabs when available</string>
<!-- 2018-09-11 -->
<string name="pref_behaviour_hide_read_posts_key" translatable="false">pref_behaviour_hide_read_posts</string>
<string name="pref_behaviour_hide_read_posts_title">Hide read posts</string>
</resources>
@@ -164,9 +164,9 @@
android:key="@string/pref_behaviour_nsfw_key"
android:defaultValue="false"/>
<CheckBoxPreference android:title="@string/pref_behaviour_show_read_posts_title"
android:key="@string/pref_behaviour_show_read_posts_key"
android:defaultValue="true"/>
<CheckBoxPreference android:title="@string/pref_behaviour_hide_read_posts_title"
android:key="@string/pref_behaviour_hide_read_posts_key"
android:defaultValue="false"/>
<ListPreference android:title="@string/pref_behaviour_postcount_title"
android:key="@string/pref_behaviour_postcount_key"

0 comments on commit 2bf7cdd

Please sign in to comment.