Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setting for marking posts as read #1145

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,12 @@ public static boolean pref_behaviour_hide_read_posts() {
false);
}

public static boolean pref_behaviour_mark_posts_as_read() {
return getBoolean(
R.string.pref_behaviour_mark_posts_as_read_key,
true);
}

public enum SharingDomain {
STANDARD_REDDIT("reddit.com"),
SHORT_REDDIT("redd.it"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ Entry update(
timestamp,
Boolean.TRUE.equals(post.getLikes()),
Boolean.FALSE.equals(post.getLikes()),
post.getClicked() || mIsRead,
(PrefsUtility.pref_behaviour_mark_posts_as_read() && post.getClicked())
|| mIsRead,
post.getSaved(),
post.getHidden() ? true : null);
}
Expand Down Expand Up @@ -375,7 +376,7 @@ Entry markRead(final TimestampUTC timestamp) {
timestamp,
mIsUpvoted,
mIsDownvoted,
true,
mIsRead || PrefsUtility.pref_behaviour_mark_posts_as_read(),
mIsSaved,
mIsHidden);
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1804,6 +1804,10 @@
<!-- 2023-10-22 -->
<string name="userprofile_tag_suspended">Suspended</string>

<!-- 2023-11-25 -->
<string name="pref_behaviour_mark_posts_as_read_key" translatable="false">pref_behaviour_mark_posts_as_read</string>
<string name="pref_behaviour_mark_posts_as_read_title">Mark posts as read</string>

<!-- 2023-12-12 -->
<string name="pref_developer_header" translatable="false">Developer Options</string>
<string name="pref_developer_test_notification_key" translatable="false">pref_developer_test_notification_key</string>
Expand Down
4 changes: 4 additions & 0 deletions src/main/res/xml/prefs_behaviour.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@
android:key="@string/pref_behaviour_hide_read_posts_key"
android:defaultValue="false"/>

<CheckBoxPreference android:title="@string/pref_behaviour_mark_posts_as_read_title"
android:key="@string/pref_behaviour_mark_posts_as_read_key"
android:defaultValue="true"/>

<ListPreference android:title="@string/pref_behaviour_postcount_title"
android:key="@string/pref_behaviour_postcount_key"
android:entries="@array/pref_behaviour_postcount_items"
Expand Down
Loading