aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2024-08-20 18:34:36 +0000
committerDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2024-08-20 18:34:36 +0000
commitda8785fdc8897133c22e7dfa90a0b5aff1bd7547 (patch)
tree96687389e84c3bbff868d7c884142fe90348aed3 /app/src
parent8fdc2cc945a518c5b9c08cec546ea952caad71a4 (diff)
downloadinfinity-for-reddit-da8785fdc8897133c22e7dfa90a0b5aff1bd7547.tar
infinity-for-reddit-da8785fdc8897133c22e7dfa90a0b5aff1bd7547.tar.gz
infinity-for-reddit-da8785fdc8897133c22e7dfa90a0b5aff1bd7547.tar.bz2
infinity-for-reddit-da8785fdc8897133c22e7dfa90a0b5aff1bd7547.tar.lz
infinity-for-reddit-da8785fdc8897133c22e7dfa90a0b5aff1bd7547.tar.xz
infinity-for-reddit-da8785fdc8897133c22e7dfa90a0b5aff1bd7547.tar.zst
infinity-for-reddit-da8785fdc8897133c22e7dfa90a0b5aff1bd7547.zip
Refine UI and add explanations in CustomizeCommentFilterActivity.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeCommentFilterActivity.java14
-rw-r--r--app/src/main/res/layout/activity_customize_comment_filter.xml341
-rw-r--r--app/src/main/res/values/strings.xml5
3 files changed, 262 insertions, 98 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeCommentFilterActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeCommentFilterActivity.java
index afa5cad6..b8e5d15e 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeCommentFilterActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeCommentFilterActivity.java
@@ -183,6 +183,10 @@ public class CustomizeCommentFilterActivity extends BaseActivity {
binding.nameTextInputLayoutCustomizeCommentFilterActivity.setBoxStrokeColor(primaryTextColor);
binding.nameTextInputLayoutCustomizeCommentFilterActivity.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
binding.nameTextInputEditTextCustomizeCommentFilterActivity.setTextColor(primaryTextColor);
+
+ int filledCardViewBackgroundColor = mCustomThemeWrapper.getFilledCardViewBackgroundColor();
+ binding.displayModeCardViewCustomizePostFilterActivity.setCardBackgroundColor(filledCardViewBackgroundColor);
+ binding.displayModeExplanationTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
binding.displayModeTitleTextViewCustomizeCommentFilterActivity.setTextColor(primaryTextColor);
binding.displayModeSpinnerCustomizeCommentFilterActivity.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
@@ -198,15 +202,25 @@ public class CustomizeCommentFilterActivity extends BaseActivity {
}
});
+
+ binding.excludeStringsCardViewCustomizePostFilterActivity.setCardBackgroundColor(filledCardViewBackgroundColor);
+ binding.excludeStringsExplanationTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
binding.excludeStringsTextInputLayoutCustomizeCommentFilterActivity.setBoxStrokeColor(primaryTextColor);
binding.excludeStringsTextInputLayoutCustomizeCommentFilterActivity.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
binding.excludeStringsTextInputEditTextCustomizeCommentFilterActivity.setTextColor(primaryTextColor);
+
+ binding.excludeUsersCardViewCustomizePostFilterActivity.setCardBackgroundColor(filledCardViewBackgroundColor);
+ binding.excludeUsersExplanationTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
binding.excludeUsersTextInputLayoutCustomizeCommentFilterActivity.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
binding.excludeUsersTextInputEditTextCustomizeCommentFilterActivity.setTextColor(primaryTextColor);
binding.addUsersImageViewCustomizeCommentFilterActivity.setImageDrawable(Utils.getTintedDrawable(this, R.drawable.ic_add_24dp, primaryIconColor));
+
+ binding.voteCardViewCustomizePostFilterActivity.setCardBackgroundColor(filledCardViewBackgroundColor);
+ binding.minVoteExplanationTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
binding.minVoteTextInputLayoutCustomizeCommentFilterActivity.setBoxStrokeColor(primaryTextColor);
binding.minVoteTextInputLayoutCustomizeCommentFilterActivity.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
binding.minVoteTextInputEditTextCustomizeCommentFilterActivity.setTextColor(primaryTextColor);
+ binding.maxVoteExplanationTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
binding.maxVoteTextInputLayoutCustomizeCommentFilterActivity.setBoxStrokeColor(primaryTextColor);
binding.maxVoteTextInputLayoutCustomizeCommentFilterActivity.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
binding.maxVoteTextInputEditTextCustomizeCommentFilterActivity.setTextColor(primaryTextColor);
diff --git a/app/src/main/res/layout/activity_customize_comment_filter.xml b/app/src/main/res/layout/activity_customize_comment_filter.xml
index 4e393ff4..7d8987ef 100644
--- a/app/src/main/res/layout/activity_customize_comment_filter.xml
+++ b/app/src/main/res/layout/activity_customize_comment_filter.xml
@@ -62,134 +62,279 @@
</com.google.android.material.textfield.TextInputLayout>
- <LinearLayout
+ <com.google.android.material.card.MaterialCardView
+ android:id="@+id/display_mode_card_view_customize_post_filter_activity"
+ style="?attr/materialCardViewFilledStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
+ android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
- android:layout_marginStart="20dp">
+ app:cardCornerRadius="12dp">
- <TextView
- android:id="@+id/display_mode_title_text_view_customize_comment_filter_activity"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="16dp"
- android:layout_gravity="center_vertical"
- android:text="@string/comment_filter_display_mode"
- android:textSize="?attr/font_default"
- android:fontFamily="?attr/font_family" />
-
- <androidx.appcompat.widget.AppCompatSpinner
- android:id="@+id/display_mode_spinner_customize_comment_filter_activity"
- android:layout_width="0dp"
+ <LinearLayout
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:layout_gravity="center_vertical"
- android:entries="@array/comment_filter_display_mode" />
+ android:orientation="vertical">
- </LinearLayout>
+ <TextView
+ android:id="@+id/display_mode_explanation_text_view_customize_post_filter_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp"
+ android:paddingStart="16dp"
+ android:paddingEnd="16dp"
+ android:text="@string/comment_filter_display_mode_explanation"
+ android:textSize="?attr/font_default"
+ android:textColor="?attr/primaryTextColor"
+ android:fontFamily="?attr/font_family" />
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/exclude_strings_text_input_layout_customize_comment_filter_activity"
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="16dp"
+ android:layout_marginStart="20dp">
+
+ <TextView
+ android:id="@+id/display_mode_title_text_view_customize_comment_filter_activity"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="16dp"
+ android:layout_gravity="center_vertical"
+ android:text="@string/comment_filter_display_mode"
+ android:textSize="?attr/font_default"
+ android:fontFamily="?attr/font_family" />
+
+ <androidx.appcompat.widget.AppCompatSpinner
+ android:id="@+id/display_mode_spinner_customize_comment_filter_activity"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_gravity="center_vertical"
+ android:entries="@array/comment_filter_display_mode" />
+
+ </LinearLayout>
+
+ </LinearLayout>
+
+ </com.google.android.material.card.MaterialCardView>
+
+ <com.google.android.material.card.MaterialCardView
+ android:id="@+id/exclude_strings_card_view_customize_post_filter_activity"
+ style="?attr/materialCardViewFilledStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingTop="8dp"
- android:paddingBottom="8dp"
- android:paddingStart="16dp"
- android:paddingEnd="16dp"
- style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="8dp"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="8dp"
+ app:cardCornerRadius="12dp">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/exclude_strings_text_input_edit_text_customize_comment_filter_activity"
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:fontFamily="?attr/font_family"
- android:textSize="?attr/font_default"
- android:hint="@string/excludes_strings_hint"
- android:maxLines="10" />
-
- </com.google.android.material.textfield.TextInputLayout>
+ android:orientation="vertical">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/exclude_users_text_input_layout_customize_comment_filter_activity"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:paddingTop="8dp"
- android:paddingBottom="8dp"
- android:layout_marginStart="16dp"
- style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
-
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/exclude_users_text_input_edit_text_customize_comment_filter_activity"
+ <TextView
+ android:id="@+id/exclude_strings_explanation_text_view_customize_post_filter_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:fontFamily="?attr/font_family"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp"
+ android:paddingStart="16dp"
+ android:paddingEnd="16dp"
+ android:text="@string/comment_filter_exclude_strings_explanation"
android:textSize="?attr/font_default"
- android:hint="@string/exclude_users_hint"
- android:maxLines="10" />
+ android:textColor="?attr/primaryTextColor"
+ android:fontFamily="?attr/font_family" />
- </com.google.android.material.textfield.TextInputLayout>
-
- <ImageView
- android:id="@+id/add_users_image_view_customize_comment_filter_activity"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:padding="16dp"
- android:background="?actionBarItemBackground"
- android:clickable="true"
- android:focusable="true" />
-
- </LinearLayout>
-
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/min_vote_text_input_layout_customize_comment_filter_activity"
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/exclude_strings_text_input_layout_customize_comment_filter_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="8dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="16dp"
+ android:paddingEnd="16dp"
+ style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/exclude_strings_text_input_edit_text_customize_comment_filter_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:fontFamily="?attr/font_family"
+ android:textSize="?attr/font_default"
+ android:hint="@string/excludes_strings_hint"
+ android:maxLines="10" />
+
+ </com.google.android.material.textfield.TextInputLayout>
+
+ </LinearLayout>
+
+ </com.google.android.material.card.MaterialCardView>
+
+ <com.google.android.material.card.MaterialCardView
+ android:id="@+id/exclude_users_card_view_customize_post_filter_activity"
+ style="?attr/materialCardViewFilledStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingTop="8dp"
- android:paddingBottom="8dp"
- android:paddingStart="16dp"
- android:paddingEnd="16dp"
- style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="8dp"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="8dp"
+ app:cardCornerRadius="12dp">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/min_vote_text_input_edit_text_customize_comment_filter_activity"
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:inputType="numberSigned"
- android:fontFamily="?attr/font_family"
- android:textSize="?attr/font_default"
- android:hint="@string/min_vote_hint"
- android:maxLines="1" />
-
- </com.google.android.material.textfield.TextInputLayout>
+ android:orientation="vertical">
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/max_vote_text_input_layout_customize_comment_filter_activity"
+ <TextView
+ android:id="@+id/exclude_users_explanation_text_view_customize_post_filter_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:fontFamily="?attr/font_family"
+ android:paddingStart="16dp"
+ android:paddingTop="8dp"
+ android:paddingEnd="16dp"
+ android:paddingBottom="8dp"
+ android:text="@string/comment_filter_exclude_users_explanation"
+ android:textColor="?attr/primaryTextColor"
+ android:textSize="?attr/font_default" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/exclude_users_text_input_layout_customize_comment_filter_activity"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:paddingTop="8dp"
+ android:paddingBottom="16dp"
+ android:layout_marginStart="16dp"
+ style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/exclude_users_text_input_edit_text_customize_comment_filter_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:fontFamily="?attr/font_family"
+ android:textSize="?attr/font_default"
+ android:hint="@string/exclude_users_hint"
+ android:maxLines="10" />
+
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <ImageView
+ android:id="@+id/add_users_image_view_customize_comment_filter_activity"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:padding="16dp"
+ android:background="?actionBarItemBackground"
+ android:clickable="true"
+ android:focusable="true" />
+
+ </LinearLayout>
+
+ </LinearLayout>
+
+ </com.google.android.material.card.MaterialCardView>
+
+ <com.google.android.material.card.MaterialCardView
+ android:id="@+id/vote_card_view_customize_post_filter_activity"
+ style="?attr/materialCardViewFilledStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingTop="8dp"
- android:paddingBottom="8dp"
- android:paddingStart="16dp"
- android:paddingEnd="16dp"
- style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="8dp"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="8dp"
+ app:cardCornerRadius="12dp">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/max_vote_text_input_edit_text_customize_comment_filter_activity"
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:inputType="numberSigned"
- android:fontFamily="?attr/font_family"
- android:textSize="?attr/font_default"
- android:hint="@string/max_vote_hint"
- android:maxLines="1" />
+ android:orientation="vertical">
- </com.google.android.material.textfield.TextInputLayout>
+ <TextView
+ android:id="@+id/min_vote_explanation_text_view_customize_post_filter_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:fontFamily="?attr/font_family"
+ android:paddingStart="16dp"
+ android:paddingTop="8dp"
+ android:paddingEnd="16dp"
+ android:paddingBottom="8dp"
+ android:text="@string/comment_filter_min_vote_explanation"
+ android:textColor="?attr/primaryTextColor"
+ android:textSize="?attr/font_default" />
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/min_vote_text_input_layout_customize_comment_filter_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp"
+ android:paddingStart="16dp"
+ android:paddingEnd="16dp"
+ style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/min_vote_text_input_edit_text_customize_comment_filter_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:inputType="numberSigned"
+ android:fontFamily="?attr/font_family"
+ android:textSize="?attr/font_default"
+ android:hint="@string/min_vote_hint"
+ android:maxLines="1" />
+
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <TextView
+ android:id="@+id/max_vote_explanation_text_view_customize_post_filter_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:fontFamily="?attr/font_family"
+ android:paddingStart="16dp"
+ android:paddingTop="8dp"
+ android:paddingEnd="16dp"
+ android:paddingBottom="8dp"
+ android:text="@string/comment_filter_max_vote_explanation"
+ android:textColor="?attr/primaryTextColor"
+ android:textSize="?attr/font_default" />
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/max_vote_text_input_layout_customize_comment_filter_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="8dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="16dp"
+ android:paddingEnd="16dp"
+ style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/max_vote_text_input_edit_text_customize_comment_filter_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:inputType="numberSigned"
+ android:fontFamily="?attr/font_family"
+ android:textSize="?attr/font_default"
+ android:hint="@string/max_vote_hint"
+ android:maxLines="1" />
+
+ </com.google.android.material.textfield.TextInputLayout>
+
+ </LinearLayout>
+
+ </com.google.android.material.card.MaterialCardView>
</LinearLayout>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 9792add7..eea33bad 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1424,5 +1424,10 @@
<string name="comment_filter_display_mode">Display mode</string>
<string name="comment_filter_display_mode_remove_comments">Remove comments</string>
<string name="comment_filter_display_mode_fully_collapse_comments">Fully collapse comments</string>
+ <string name="comment_filter_display_mode_explanation">Filtered out comments will be shown as the following selected option</string>
+ <string name="comment_filter_exclude_strings_explanation">Comments will be filtered out if they contain the following keywords.</string>
+ <string name="comment_filter_exclude_users_explanation">Comments will be filtered out if they were submitted by the following users.</string>
+ <string name="comment_filter_min_vote_explanation">Comments that have a score lower than the following value will be filtered out (-1 means no restriction).</string>
+ <string name="comment_filter_max_vote_explanation">Comments that have a score higher than the following value will be filtered out (-1 means no restriction).</string>
</resources>