Skip to content

Commit 3f5d298

Browse files
Refine UI in CustomizePostFilterActivity and CustomizeCommentFilterActivity.
1 parent e4abfc6 commit 3f5d298

File tree

6 files changed

+146
-47
lines changed

6 files changed

+146
-47
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,14 @@ protected void applyCustomTheme() {
254254
binding.collapsingToolbarLayoutCustomizePostFilterActivity, binding.toolbarCustomizePostFilterActivity);
255255
int primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor();
256256
int primaryIconColor = mCustomThemeWrapper.getPrimaryIconColor();
257+
int filledCardViewBackgroundColor = mCustomThemeWrapper.getFilledCardViewBackgroundColor();
258+
259+
binding.nameCardViewCustomizePostFilterActivity.setCardBackgroundColor(filledCardViewBackgroundColor);
260+
binding.nameExplanationTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
257261
binding.nameTextInputLayoutCustomizePostFilterActivity.setBoxStrokeColor(primaryTextColor);
258262
binding.nameTextInputLayoutCustomizePostFilterActivity.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
259263
binding.nameTextInputEditTextCustomizePostFilterActivity.setTextColor(primaryTextColor);
260264

261-
int filledCardViewBackgroundColor = mCustomThemeWrapper.getFilledCardViewBackgroundColor();
262265
binding.postTypeCardViewCustomizePostFilterActivity.setCardBackgroundColor(filledCardViewBackgroundColor);
263266
binding.postTypeExplanationTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
264267
binding.postTypeTextTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_text_24dp, primaryIconColor), null, null, null);

app/src/main/res/layout-land/activity_customize_post_filter.xml

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,57 @@
5050
android:layout_height="wrap_content"
5151
android:orientation="vertical">
5252

53-
<com.google.android.material.textfield.TextInputLayout
54-
android:id="@+id/name_text_input_layout_customize_post_filter_activity"
53+
<com.google.android.material.card.MaterialCardView
54+
android:id="@+id/name_card_view_customize_post_filter_activity"
55+
style="?attr/materialCardViewFilledStyle"
5556
android:layout_width="match_parent"
5657
android:layout_height="wrap_content"
57-
android:paddingTop="8dp"
58-
android:paddingBottom="8dp"
59-
android:paddingStart="16dp"
60-
android:paddingEnd="16dp"
61-
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
62-
63-
<com.google.android.material.textfield.TextInputEditText
64-
android:id="@+id/name_text_input_edit_text_customize_post_filter_activity"
58+
android:layout_marginTop="16dp"
59+
android:layout_marginBottom="8dp"
60+
app:cardCornerRadius="12dp">
61+
62+
<LinearLayout
6563
android:layout_width="match_parent"
6664
android:layout_height="wrap_content"
67-
android:fontFamily="?attr/font_family"
68-
android:textSize="?attr/font_default"
69-
android:hint="@string/post_filter_name_hint"
70-
android:maxLines="10" />
65+
android:orientation="vertical">
66+
67+
<TextView
68+
android:id="@+id/name_explanation_text_view_customize_post_filter_activity"
69+
android:layout_width="match_parent"
70+
android:layout_height="wrap_content"
71+
android:fontFamily="?attr/font_family"
72+
android:paddingStart="16dp"
73+
android:paddingTop="8dp"
74+
android:paddingEnd="16dp"
75+
android:paddingBottom="8dp"
76+
android:text="@string/post_filter_post_type_explanation"
77+
android:textColor="?attr/primaryTextColor"
78+
android:textSize="?attr/font_default" />
7179

72-
</com.google.android.material.textfield.TextInputLayout>
80+
<com.google.android.material.textfield.TextInputLayout
81+
android:id="@+id/name_text_input_layout_customize_post_filter_activity"
82+
android:layout_width="match_parent"
83+
android:layout_height="wrap_content"
84+
android:paddingTop="8dp"
85+
android:paddingBottom="16dp"
86+
android:paddingStart="16dp"
87+
android:paddingEnd="16dp"
88+
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
89+
90+
<com.google.android.material.textfield.TextInputEditText
91+
android:id="@+id/name_text_input_edit_text_customize_post_filter_activity"
92+
android:layout_width="match_parent"
93+
android:layout_height="wrap_content"
94+
android:fontFamily="?attr/font_family"
95+
android:textSize="?attr/font_default"
96+
android:hint="@string/post_filter_name_hint"
97+
android:maxLines="10" />
98+
99+
</com.google.android.material.textfield.TextInputLayout>
100+
101+
</LinearLayout>
102+
103+
</com.google.android.material.card.MaterialCardView>
73104

74105
<com.google.android.material.card.MaterialCardView
75106
android:id="@+id/post_type_card_view_customize_post_filter_activity"

app/src/main/res/layout-sw600dp/activity_customize_post_filter.xml

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,57 @@
5050
android:layout_height="wrap_content"
5151
android:orientation="vertical">
5252

53-
<com.google.android.material.textfield.TextInputLayout
54-
android:id="@+id/name_text_input_layout_customize_post_filter_activity"
53+
<com.google.android.material.card.MaterialCardView
54+
android:id="@+id/name_card_view_customize_post_filter_activity"
55+
style="?attr/materialCardViewFilledStyle"
5556
android:layout_width="match_parent"
5657
android:layout_height="wrap_content"
57-
android:paddingTop="8dp"
58-
android:paddingBottom="8dp"
59-
android:paddingStart="16dp"
60-
android:paddingEnd="16dp"
61-
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
62-
63-
<com.google.android.material.textfield.TextInputEditText
64-
android:id="@+id/name_text_input_edit_text_customize_post_filter_activity"
58+
android:layout_marginTop="16dp"
59+
android:layout_marginBottom="8dp"
60+
app:cardCornerRadius="12dp">
61+
62+
<LinearLayout
6563
android:layout_width="match_parent"
6664
android:layout_height="wrap_content"
67-
android:fontFamily="?attr/font_family"
68-
android:textSize="?attr/font_default"
69-
android:hint="@string/post_filter_name_hint"
70-
android:maxLines="10" />
65+
android:orientation="vertical">
66+
67+
<TextView
68+
android:id="@+id/name_explanation_text_view_customize_post_filter_activity"
69+
android:layout_width="match_parent"
70+
android:layout_height="wrap_content"
71+
android:fontFamily="?attr/font_family"
72+
android:paddingStart="16dp"
73+
android:paddingTop="8dp"
74+
android:paddingEnd="16dp"
75+
android:paddingBottom="8dp"
76+
android:text="@string/post_filter_post_type_explanation"
77+
android:textColor="?attr/primaryTextColor"
78+
android:textSize="?attr/font_default" />
7179

72-
</com.google.android.material.textfield.TextInputLayout>
80+
<com.google.android.material.textfield.TextInputLayout
81+
android:id="@+id/name_text_input_layout_customize_post_filter_activity"
82+
android:layout_width="match_parent"
83+
android:layout_height="wrap_content"
84+
android:paddingTop="8dp"
85+
android:paddingBottom="16dp"
86+
android:paddingStart="16dp"
87+
android:paddingEnd="16dp"
88+
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
89+
90+
<com.google.android.material.textfield.TextInputEditText
91+
android:id="@+id/name_text_input_edit_text_customize_post_filter_activity"
92+
android:layout_width="match_parent"
93+
android:layout_height="wrap_content"
94+
android:fontFamily="?attr/font_family"
95+
android:textSize="?attr/font_default"
96+
android:hint="@string/post_filter_name_hint"
97+
android:maxLines="10" />
98+
99+
</com.google.android.material.textfield.TextInputLayout>
100+
101+
</LinearLayout>
102+
103+
</com.google.android.material.card.MaterialCardView>
73104

74105
<com.google.android.material.card.MaterialCardView
75106
android:id="@+id/post_type_card_view_customize_post_filter_activity"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
android:layout_width="match_parent"
4848
android:layout_height="wrap_content"
4949
android:layout_marginStart="16dp"
50-
android:layout_marginTop="8dp"
50+
android:layout_marginTop="16dp"
5151
android:layout_marginEnd="16dp"
5252
android:layout_marginBottom="8dp"
5353
app:cardCornerRadius="12dp">

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

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

46-
<com.google.android.material.textfield.TextInputLayout
47-
android:id="@+id/name_text_input_layout_customize_post_filter_activity"
46+
<com.google.android.material.card.MaterialCardView
47+
android:id="@+id/name_card_view_customize_post_filter_activity"
48+
style="?attr/materialCardViewFilledStyle"
4849
android:layout_width="match_parent"
4950
android:layout_height="wrap_content"
50-
android:paddingTop="8dp"
51-
android:paddingBottom="8dp"
52-
android:paddingStart="16dp"
53-
android:paddingEnd="16dp"
54-
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
55-
56-
<com.google.android.material.textfield.TextInputEditText
57-
android:id="@+id/name_text_input_edit_text_customize_post_filter_activity"
51+
android:layout_marginStart="16dp"
52+
android:layout_marginTop="16dp"
53+
android:layout_marginEnd="16dp"
54+
android:layout_marginBottom="8dp"
55+
app:cardCornerRadius="12dp">
56+
57+
<LinearLayout
5858
android:layout_width="match_parent"
5959
android:layout_height="wrap_content"
60-
android:fontFamily="?attr/font_family"
61-
android:textSize="?attr/font_default"
62-
android:hint="@string/post_filter_name_hint"
63-
android:maxLines="10" />
60+
android:orientation="vertical">
61+
62+
<TextView
63+
android:id="@+id/name_explanation_text_view_customize_post_filter_activity"
64+
android:layout_width="match_parent"
65+
android:layout_height="wrap_content"
66+
android:fontFamily="?attr/font_family"
67+
android:paddingStart="16dp"
68+
android:paddingTop="8dp"
69+
android:paddingEnd="16dp"
70+
android:paddingBottom="8dp"
71+
android:text="@string/post_filter_post_type_explanation"
72+
android:textColor="?attr/primaryTextColor"
73+
android:textSize="?attr/font_default" />
74+
75+
<com.google.android.material.textfield.TextInputLayout
76+
android:id="@+id/name_text_input_layout_customize_post_filter_activity"
77+
android:layout_width="match_parent"
78+
android:layout_height="wrap_content"
79+
android:paddingTop="8dp"
80+
android:paddingBottom="16dp"
81+
android:paddingStart="16dp"
82+
android:paddingEnd="16dp"
83+
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
84+
85+
<com.google.android.material.textfield.TextInputEditText
86+
android:id="@+id/name_text_input_edit_text_customize_post_filter_activity"
87+
android:layout_width="match_parent"
88+
android:layout_height="wrap_content"
89+
android:fontFamily="?attr/font_family"
90+
android:textSize="?attr/font_default"
91+
android:hint="@string/post_filter_name_hint"
92+
android:maxLines="10" />
6493

65-
</com.google.android.material.textfield.TextInputLayout>
94+
</com.google.android.material.textfield.TextInputLayout>
95+
96+
</LinearLayout>
97+
98+
</com.google.android.material.card.MaterialCardView>
6699

67100
<com.google.android.material.card.MaterialCardView
68101
android:id="@+id/post_type_card_view_customize_post_filter_activity"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,7 @@
11531153
<string name="edit_post_filter_name_of_usage_info">Leave it blank to apply this post filter to all the subreddits / users / multireddits</string>
11541154
<string name="click_to_apply_post_filter">Click here to apply it to some post feeds</string>
11551155
<string name="post_filter_usage_embedded_more_count">and %1$d more</string>
1156+
<string name="post_filter_name_explanation">The post filter name should be unique.</string>
11561157
<string name="post_filter_post_type_explanation">To see certain types of posts, please turn on the switch corresponding to the types.</string>
11571158
<string name="post_filter_only_nsfw_spoiler_explanation">To only see NSFW or spoiler posts, please turn on the corresponding switch.</string>
11581159
<string name="post_filter_title_excludes_strings_explanation">Posts will be filtered out if they contain the following keywords in their title.</string>

0 commit comments

Comments
 (0)