diff options
Diffstat (limited to 'app')
6 files changed, 146 insertions, 47 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizePostFilterActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizePostFilterActivity.java index d9df88d2..ca56bcdf 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizePostFilterActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizePostFilterActivity.java @@ -254,11 +254,14 @@ public class CustomizePostFilterActivity extends BaseActivity { binding.collapsingToolbarLayoutCustomizePostFilterActivity, binding.toolbarCustomizePostFilterActivity); int primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor(); int primaryIconColor = mCustomThemeWrapper.getPrimaryIconColor(); + int filledCardViewBackgroundColor = mCustomThemeWrapper.getFilledCardViewBackgroundColor(); + + binding.nameCardViewCustomizePostFilterActivity.setCardBackgroundColor(filledCardViewBackgroundColor); + binding.nameExplanationTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor); binding.nameTextInputLayoutCustomizePostFilterActivity.setBoxStrokeColor(primaryTextColor); binding.nameTextInputLayoutCustomizePostFilterActivity.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor)); binding.nameTextInputEditTextCustomizePostFilterActivity.setTextColor(primaryTextColor); - int filledCardViewBackgroundColor = mCustomThemeWrapper.getFilledCardViewBackgroundColor(); binding.postTypeCardViewCustomizePostFilterActivity.setCardBackgroundColor(filledCardViewBackgroundColor); binding.postTypeExplanationTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor); binding.postTypeTextTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_text_24dp, primaryIconColor), null, null, null); diff --git a/app/src/main/res/layout-land/activity_customize_post_filter.xml b/app/src/main/res/layout-land/activity_customize_post_filter.xml index 61ce99cc..32197519 100644 --- a/app/src/main/res/layout-land/activity_customize_post_filter.xml +++ b/app/src/main/res/layout-land/activity_customize_post_filter.xml @@ -50,26 +50,57 @@ android:layout_height="wrap_content" android:orientation="vertical"> - <com.google.android.material.textfield.TextInputLayout - android:id="@+id/name_text_input_layout_customize_post_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_post_filter_activity" + android:layout_marginTop="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/post_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/post_filter_post_type_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_post_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_post_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/post_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/post_type_card_view_customize_post_filter_activity" diff --git a/app/src/main/res/layout-sw600dp/activity_customize_post_filter.xml b/app/src/main/res/layout-sw600dp/activity_customize_post_filter.xml index 61ce99cc..32197519 100644 --- a/app/src/main/res/layout-sw600dp/activity_customize_post_filter.xml +++ b/app/src/main/res/layout-sw600dp/activity_customize_post_filter.xml @@ -50,26 +50,57 @@ android:layout_height="wrap_content" android:orientation="vertical"> - <com.google.android.material.textfield.TextInputLayout - android:id="@+id/name_text_input_layout_customize_post_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_post_filter_activity" + android:layout_marginTop="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/post_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/post_filter_post_type_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_post_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_post_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/post_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/post_type_card_view_customize_post_filter_activity" 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 75ac2f88..1022e720 100644 --- a/app/src/main/res/layout/activity_customize_comment_filter.xml +++ b/app/src/main/res/layout/activity_customize_comment_filter.xml @@ -47,7 +47,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="16dp" - android:layout_marginTop="8dp" + android:layout_marginTop="16dp" android:layout_marginEnd="16dp" android:layout_marginBottom="8dp" app:cardCornerRadius="12dp"> diff --git a/app/src/main/res/layout/activity_customize_post_filter.xml b/app/src/main/res/layout/activity_customize_post_filter.xml index 89c59f4e..575bc9c0 100644 --- a/app/src/main/res/layout/activity_customize_post_filter.xml +++ b/app/src/main/res/layout/activity_customize_post_filter.xml @@ -43,26 +43,59 @@ android:layout_height="wrap_content" android:orientation="vertical"> - <com.google.android.material.textfield.TextInputLayout - android:id="@+id/name_text_input_layout_customize_post_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_post_filter_activity" + android:layout_marginStart="16dp" + android:layout_marginTop="16dp" + 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/post_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/post_filter_post_type_explanation" + android:textColor="?attr/primaryTextColor" + android:textSize="?attr/font_default" /> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/name_text_input_layout_customize_post_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_post_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/post_filter_name_hint" + android:maxLines="10" /> - </com.google.android.material.textfield.TextInputLayout> + </com.google.android.material.textfield.TextInputLayout> + + </LinearLayout> + + </com.google.android.material.card.MaterialCardView> <com.google.android.material.card.MaterialCardView android:id="@+id/post_type_card_view_customize_post_filter_activity" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 301d02f1..1b50d61e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1153,6 +1153,7 @@ <string name="edit_post_filter_name_of_usage_info">Leave it blank to apply this post filter to all the subreddits / users / multireddits</string> <string name="click_to_apply_post_filter">Click here to apply it to some post feeds</string> <string name="post_filter_usage_embedded_more_count">and %1$d more</string> + <string name="post_filter_name_explanation">The post filter name should be unique.</string> <string name="post_filter_post_type_explanation">To see certain types of posts, please turn on the switch corresponding to the types.</string> <string name="post_filter_only_nsfw_spoiler_explanation">To only see NSFW or spoiler posts, please turn on the corresponding switch.</string> <string name="post_filter_title_excludes_strings_explanation">Posts will be filtered out if they contain the following keywords in their title.</string> |