Skip to content

Commit

Permalink
Refine UI and add explanations for the name in CustomizeCommentFilter…
Browse files Browse the repository at this point in the history
…Activity.
  • Loading branch information
Docile-Alligator committed Aug 20, 2024
1 parent da8785f commit e4abfc6
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,14 @@ protected void applyCustomTheme() {
applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(binding.appbarLayoutCustomizeCommentFilterActivity, binding.collapsingToolbarLayoutCustomizeCommentFilterActivity, binding.toolbarCustomizeCommentFilterActivity);
int primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor();
int primaryIconColor = mCustomThemeWrapper.getPrimaryIconColor();
int filledCardViewBackgroundColor = mCustomThemeWrapper.getFilledCardViewBackgroundColor();

binding.nameCardViewCustomizePostFilterActivity.setCardBackgroundColor(filledCardViewBackgroundColor);
binding.nameExplanationTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
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);
Expand Down
63 changes: 48 additions & 15 deletions app/src/main/res/layout/activity_customize_comment_filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,59 @@
android:layout_height="wrap_content"
android:orientation="vertical">

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/name_text_input_layout_customize_comment_filter_activity"
<com.google.android.material.card.MaterialCardView
android:id="@+id/name_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">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/name_text_input_edit_text_customize_comment_filter_activity"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
app:cardCornerRadius="12dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="?attr/font_family"
android:textSize="?attr/font_default"
android:hint="@string/comment_filter_name_hint"
android:maxLines="10" />
android:orientation="vertical">

<TextView
android:id="@+id/name_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_name_explanation"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_default" />

</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/name_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/name_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/comment_filter_name_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/display_mode_card_view_customize_post_filter_activity"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,8 @@
<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_name_explanation">The comment filter name should be unique.</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>
Expand Down

0 comments on commit e4abfc6

Please sign in to comment.