diff options
author | Eitan <53308841+blahberi@users.noreply.github.com> | 2024-10-20 20:43:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-20 20:43:32 +0000 |
commit | 6da36366a2383d6da3d3375d6ebd9c7287687384 (patch) | |
tree | d38aaa1766d1fa562a2aec4432cf0f1ac06acc51 /app/src/main/res | |
parent | 9e6139881bf8f72936cb1ae5c94f6512042260c7 (diff) | |
download | infinity-for-reddit-6da36366a2383d6da3d3375d6ebd9c7287687384.tar infinity-for-reddit-6da36366a2383d6da3d3375d6ebd9c7287687384.tar.gz infinity-for-reddit-6da36366a2383d6da3d3375d6ebd9c7287687384.tar.bz2 infinity-for-reddit-6da36366a2383d6da3d3375d6ebd9c7287687384.tar.lz infinity-for-reddit-6da36366a2383d6da3d3375d6ebd9c7287687384.tar.xz infinity-for-reddit-6da36366a2383d6da3d3375d6ebd9c7287687384.tar.zst infinity-for-reddit-6da36366a2383d6da3d3375d6ebd9c7287687384.zip |
Changed the way read posts are handled to support an arbitrary read posts limit (#1720)
* Changed the way read posts are handled to support an arbitrary 'read posts limit'
* Changed db size in summary to kb
* Use return HashSet instead of List in ReadPostsListInterface
* Moved DB summary to Advanced Preferences.
* Completed merge from master into feature/readPost
* Fix some bugs and code style.
---------
Co-authored-by: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>
Diffstat (limited to '')
-rw-r--r-- | app/src/main/res/layout/fragment_post_history.xml | 55 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 3 | ||||
-rw-r--r-- | app/src/main/res/xml/advanced_preferences.xml | 4 |
3 files changed, 61 insertions, 1 deletions
diff --git a/app/src/main/res/layout/fragment_post_history.xml b/app/src/main/res/layout/fragment_post_history.xml index bd0d5ba3..2c3ae592 100644 --- a/app/src/main/res/layout/fragment_post_history.xml +++ b/app/src/main/res/layout/fragment_post_history.xml @@ -60,6 +60,61 @@ </LinearLayout> <LinearLayout + android:id="@+id/read_posts_limit_linear_layout_post_history_fragment" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="?attr/selectableItemBackground" + android:clickable="true" + android:focusable="true" + android:orientation="horizontal" + android:paddingStart="72dp" + android:paddingTop="4dp" + android:paddingEnd="16dp" + android:paddingBottom="4dp"> + + <TextView + android:id="@+id/read_posts_limit_text_view_post_history_fragment" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_marginEnd="16dp" + android:layout_weight="1" + android:drawablePadding="32dp" + android:fontFamily="?attr/font_family" + android:text="@string/settings_read_posts_limit_title" + android:textColor="?attr/primaryTextColor" + android:textSize="?attr/font_16" /> + + <com.google.android.material.materialswitch.MaterialSwitch + android:id="@+id/read_posts_limit_switch_post_history_fragment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" /> + + </LinearLayout> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/read_posts_limit_text_input_layout_post_history_fragment" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingStart="72dp" + android:paddingTop="4dp" + android:paddingEnd="16dp" + android:paddingBottom="4dp"> + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/read_posts_limit_text_input_edit_text_post_history_fragment" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:fontFamily="?attr/font_family" + android:hint="@string/settings_read_posts_limit_hint" + android:inputType="number" + android:maxLines="11" + android:textSize="?attr/font_default" /> + + </com.google.android.material.textfield.TextInputLayout> + + <LinearLayout android:id="@+id/mark_posts_as_read_after_voting_linear_layout_post_history_fragment" android:layout_width="match_parent" android:layout_height="wrap_content" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ac325395..d3b4227d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -570,6 +570,9 @@ <string name="settings_enable_search_history_title">Enable Search History</string> <string name="settings_post_history_title">Post History</string> <string name="settings_mark_posts_as_read_title">Mark Posts as Read</string> + <string name="settings_read_posts_limit_title">Limit Read Posts</string> + <string name="settings_read_posts_limit_hint">Set read posts limit</string> + <string name="settings_read_posts_db_summary">Read Posts DB Table \nSize: %1$d(KB) \nCount: %2$d</string> <string name="settings_mark_posts_as_read_after_voting_title">Mark Posts as Read After Voting</string> <string name="settings_mark_posts_as_read_on_scroll_title">Mark Posts as Read on Scroll</string> <string name="settings_hide_read_posts_automatically_title">Hide Read Posts Automatically</string> diff --git a/app/src/main/res/xml/advanced_preferences.xml b/app/src/main/res/xml/advanced_preferences.xml index 538a5f2e..895f6f86 100644 --- a/app/src/main/res/xml/advanced_preferences.xml +++ b/app/src/main/res/xml/advanced_preferences.xml @@ -27,7 +27,9 @@ <ml.docilealligator.infinityforreddit.customviews.CustomFontPreference app:key="delete_read_posts_in_database" - app:title="@string/settings_delete_read_posts_in_database_title" /> + app:title="@string/settings_delete_read_posts_in_database_title" + app:summary="" + /> <ml.docilealligator.infinityforreddit.customviews.CustomFontPreference app:key="delete_all_legacy_settings" |