Skip to content

Commit e4abfc6

Browse files
Refine UI and add explanations for the name in CustomizeCommentFilterActivity.
1 parent da8785f commit e4abfc6

File tree

3 files changed

+54
-17
lines changed

3 files changed

+54
-17
lines changed

app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeCommentFilterActivity.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,14 @@ protected void applyCustomTheme() {
180180
applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(binding.appbarLayoutCustomizeCommentFilterActivity, binding.collapsingToolbarLayoutCustomizeCommentFilterActivity, binding.toolbarCustomizeCommentFilterActivity);
181181
int primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor();
182182
int primaryIconColor = mCustomThemeWrapper.getPrimaryIconColor();
183+
int filledCardViewBackgroundColor = mCustomThemeWrapper.getFilledCardViewBackgroundColor();
184+
185+
binding.nameCardViewCustomizePostFilterActivity.setCardBackgroundColor(filledCardViewBackgroundColor);
186+
binding.nameExplanationTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
183187
binding.nameTextInputLayoutCustomizeCommentFilterActivity.setBoxStrokeColor(primaryTextColor);
184188
binding.nameTextInputLayoutCustomizeCommentFilterActivity.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
185189
binding.nameTextInputEditTextCustomizeCommentFilterActivity.setTextColor(primaryTextColor);
186190

187-
int filledCardViewBackgroundColor = mCustomThemeWrapper.getFilledCardViewBackgroundColor();
188191
binding.displayModeCardViewCustomizePostFilterActivity.setCardBackgroundColor(filledCardViewBackgroundColor);
189192
binding.displayModeExplanationTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
190193
binding.displayModeTitleTextViewCustomizeCommentFilterActivity.setTextColor(primaryTextColor);

app/src/main/res/layout/activity_customize_comment_filter.xml

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,59 @@
4141
android:layout_height="wrap_content"
4242
android:orientation="vertical">
4343

44-
<com.google.android.material.textfield.TextInputLayout
45-
android:id="@+id/name_text_input_layout_customize_comment_filter_activity"
44+
<com.google.android.material.card.MaterialCardView
45+
android:id="@+id/name_card_view_customize_post_filter_activity"
46+
style="?attr/materialCardViewFilledStyle"
4647
android:layout_width="match_parent"
4748
android:layout_height="wrap_content"
48-
android:paddingTop="8dp"
49-
android:paddingBottom="8dp"
50-
android:paddingStart="16dp"
51-
android:paddingEnd="16dp"
52-
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
53-
54-
<com.google.android.material.textfield.TextInputEditText
55-
android:id="@+id/name_text_input_edit_text_customize_comment_filter_activity"
49+
android:layout_marginStart="16dp"
50+
android:layout_marginTop="8dp"
51+
android:layout_marginEnd="16dp"
52+
android:layout_marginBottom="8dp"
53+
app:cardCornerRadius="12dp">
54+
55+
<LinearLayout
5656
android:layout_width="match_parent"
5757
android:layout_height="wrap_content"
58-
android:fontFamily="?attr/font_family"
59-
android:textSize="?attr/font_default"
60-
android:hint="@string/comment_filter_name_hint"
61-
android:maxLines="10" />
58+
android:orientation="vertical">
59+
60+
<TextView
61+
android:id="@+id/name_explanation_text_view_customize_post_filter_activity"
62+
android:layout_width="match_parent"
63+
android:layout_height="wrap_content"
64+
android:fontFamily="?attr/font_family"
65+
android:paddingStart="16dp"
66+
android:paddingTop="8dp"
67+
android:paddingEnd="16dp"
68+
android:paddingBottom="8dp"
69+
android:text="@string/comment_filter_name_explanation"
70+
android:textColor="?attr/primaryTextColor"
71+
android:textSize="?attr/font_default" />
6272

63-
</com.google.android.material.textfield.TextInputLayout>
73+
<com.google.android.material.textfield.TextInputLayout
74+
android:id="@+id/name_text_input_layout_customize_comment_filter_activity"
75+
android:layout_width="match_parent"
76+
android:layout_height="wrap_content"
77+
android:paddingTop="8dp"
78+
android:paddingBottom="16dp"
79+
android:paddingStart="16dp"
80+
android:paddingEnd="16dp"
81+
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
82+
83+
<com.google.android.material.textfield.TextInputEditText
84+
android:id="@+id/name_text_input_edit_text_customize_comment_filter_activity"
85+
android:layout_width="match_parent"
86+
android:layout_height="wrap_content"
87+
android:fontFamily="?attr/font_family"
88+
android:textSize="?attr/font_default"
89+
android:hint="@string/comment_filter_name_hint"
90+
android:maxLines="10" />
91+
92+
</com.google.android.material.textfield.TextInputLayout>
93+
94+
</LinearLayout>
95+
96+
</com.google.android.material.card.MaterialCardView>
6497

6598
<com.google.android.material.card.MaterialCardView
6699
android:id="@+id/display_mode_card_view_customize_post_filter_activity"

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,8 @@
14241424
<string name="comment_filter_display_mode">Display mode</string>
14251425
<string name="comment_filter_display_mode_remove_comments">Remove comments</string>
14261426
<string name="comment_filter_display_mode_fully_collapse_comments">Fully collapse comments</string>
1427-
<string name="comment_filter_display_mode_explanation">Filtered out comments will be shown as the following selected option</string>
1427+
<string name="comment_filter_name_explanation">The comment filter name should be unique.</string>
1428+
<string name="comment_filter_display_mode_explanation">Filtered out comments will be shown as the following selected option.</string>
14281429
<string name="comment_filter_exclude_strings_explanation">Comments will be filtered out if they contain the following keywords.</string>
14291430
<string name="comment_filter_exclude_users_explanation">Comments will be filtered out if they were submitted by the following users.</string>
14301431
<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>

0 commit comments

Comments
 (0)