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 1 commit
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 @@ -1119,6 +1119,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,
PrefsUtility.pref_behaviour_mark_posts_as_read() && true,
qilto marked this conversation as resolved.
Show resolved Hide resolved
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,4 +1804,8 @@
<!-- 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>

</resources>
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 @@ -169,6 +169,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