aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-12-11 16:02:18 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-12-11 16:02:18 +0000
commit35ae9c547f316dfd7dd1bae7a582f98940440359 (patch)
treed7f6ac7c7e4f7d752f9335368c514e1ba8be7449 /app/src/main
parent06d1d028ebd482607762cdf87f958710d773eec1 (diff)
downloadinfinity-for-reddit-35ae9c547f316dfd7dd1bae7a582f98940440359.tar
infinity-for-reddit-35ae9c547f316dfd7dd1bae7a582f98940440359.tar.gz
infinity-for-reddit-35ae9c547f316dfd7dd1bae7a582f98940440359.tar.bz2
infinity-for-reddit-35ae9c547f316dfd7dd1bae7a582f98940440359.tar.lz
infinity-for-reddit-35ae9c547f316dfd7dd1bae7a582f98940440359.tar.xz
infinity-for-reddit-35ae9c547f316dfd7dd1bae7a582f98940440359.tar.zst
infinity-for-reddit-35ae9c547f316dfd7dd1bae7a582f98940440359.zip
Building CustomizePostFilterActivity.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizePostFilterActivity.java79
-rw-r--r--app/src/main/res/layout/activity_customize_post_filter.xml12
2 files changed, 91 insertions, 0 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 9ad3cac7..b27160f1 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizePostFilterActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizePostFilterActivity.java
@@ -1,6 +1,7 @@
package ml.docilealligator.infinityforreddit.activities;
import android.content.SharedPreferences;
+import android.content.res.ColorStateList;
import android.os.Build;
import android.os.Bundle;
import android.view.Menu;
@@ -16,6 +17,7 @@ import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.checkbox.MaterialCheckBox;
import com.google.android.material.textfield.TextInputEditText;
+import com.google.android.material.textfield.TextInputLayout;
import com.r0adkll.slidr.Slidr;
import javax.inject.Inject;
@@ -63,28 +65,52 @@ public class CustomizePostFilterActivity extends BaseActivity {
TextView postTypeVideoTextView;
@BindView(R.id.post_type_video_check_box_customize_post_filter_activity)
MaterialCheckBox postTypeVideoCheckBox;
+ @BindView(R.id.title_excludes_strings_text_input_layout_customize_post_filter_activity)
+ TextInputLayout titleExcludesStringsTextInputLayout;
@BindView(R.id.title_excludes_strings_text_input_edit_text_customize_post_filter_activity)
TextInputEditText titleExcludesStringsTextInputEditText;
+ @BindView(R.id.title_excludes_regex_text_input_layout_customize_post_filter_activity)
+ TextInputLayout titleExcludesRegexTextInputLayout;
@BindView(R.id.title_excludes_regex_text_input_edit_text_customize_post_filter_activity)
TextInputEditText titleExcludesRegexTextInputEditText;
+ @BindView(R.id.excludes_subreddits_text_input_layout_customize_post_filter_activity)
+ TextInputLayout excludesSubredditsTextInputLayout;
@BindView(R.id.excludes_subreddits_text_input_edit_text_customize_post_filter_activity)
TextInputEditText excludesSubredditsTextInputEditText;
+ @BindView(R.id.excludes_users_text_input_layout_customize_post_filter_activity)
+ TextInputLayout excludesUsersTextInputLayout;
@BindView(R.id.excludes_users_text_input_edit_text_customize_post_filter_activity)
TextInputEditText excludesUsersTextInputEditText;
+ @BindView(R.id.excludes_flairs_text_input_layout_customize_post_filter_activity)
+ TextInputLayout excludesFlairsTextInputLayout;
@BindView(R.id.excludes_flairs_text_input_edit_text_customize_post_filter_activity)
TextInputEditText excludesFlairsTextInputEditText;
+ @BindView(R.id.contains_flairs_text_input_layout_customize_post_filter_activity)
+ TextInputLayout containsFlairsTextInputLayout;
@BindView(R.id.contains_flairs_text_input_edit_text_customize_post_filter_activity)
TextInputEditText containsFlairsTextInputEditText;
+ @BindView(R.id.min_vote_text_input_layout_customize_post_filter_activity)
+ TextInputLayout minVoteTextInputLayout;
@BindView(R.id.min_vote_text_input_edit_text_customize_post_filter_activity)
TextInputEditText minVoteTextInputEditText;
+ @BindView(R.id.max_vote_text_input_layout_customize_post_filter_activity)
+ TextInputLayout maxVoteTextInputLayout;
@BindView(R.id.max_vote_text_input_edit_text_customize_post_filter_activity)
TextInputEditText maxVoteTextInputEditText;
+ @BindView(R.id.min_comments_text_input_layout_customize_post_filter_activity)
+ TextInputLayout minCommentsTextInputLayout;
@BindView(R.id.min_comments_text_input_edit_text_customize_post_filter_activity)
TextInputEditText minCommentsTextInputEditText;
+ @BindView(R.id.max_comments_text_input_layout_customize_post_filter_activity)
+ TextInputLayout maxCommentsTextInputLayout;
@BindView(R.id.max_comments_text_input_edit_text_customize_post_filter_activity)
TextInputEditText maxCommentsTextInputEditText;
+ @BindView(R.id.min_awards_text_input_layout_customize_post_filter_activity)
+ TextInputLayout minAwardsTextInputLayout;
@BindView(R.id.min_awards_text_input_edit_text_customize_post_filter_activity)
TextInputEditText minAwardsTextInputEditText;
+ @BindView(R.id.max_awards_text_input_layout_customize_post_filter_activity)
+ TextInputLayout maxAwardsTextInputLayout;
@BindView(R.id.max_awards_text_input_edit_text_customize_post_filter_activity)
TextInputEditText maxAwardsTextInputEditText;
@Inject
@@ -120,7 +146,21 @@ public class CustomizePostFilterActivity extends BaseActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setToolbarGoToTop(toolbar);
+ postTypeTextLinearLayout.setOnClickListener(view -> {
+ postTypeTextCheckBox.performClick();
+ });
+ postTypeLinkLinearLayout.setOnClickListener(view -> {
+ postTypeLinkCheckBox.performClick();
+ });
+
+ postTypeImageLinearLayout.setOnClickListener(view -> {
+ postTypeImageCheckBox.performClick();
+ });
+
+ postTypeVideoLinearLayout.setOnClickListener(view -> {
+ postTypeVideoCheckBox.performClick();
+ });
}
@Override
@@ -138,7 +178,46 @@ public class CustomizePostFilterActivity extends BaseActivity {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar);
int primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor();
+ postTypeTextTextView.setTextColor(primaryTextColor);
+ postTypeLinkTextView.setTextColor(primaryTextColor);
+ postTypeImageTextView.setTextColor(primaryTextColor);
+ postTypeVideoTextView.setTextColor(primaryTextColor);
+ titleExcludesStringsTextInputLayout.setBoxStrokeColor(primaryTextColor);
+ titleExcludesStringsTextInputLayout.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
titleExcludesStringsTextInputEditText.setTextColor(primaryTextColor);
+ titleExcludesRegexTextInputLayout.setBoxStrokeColor(primaryTextColor);
+ titleExcludesRegexTextInputLayout.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
+ titleExcludesRegexTextInputEditText.setTextColor(primaryTextColor);
+ excludesSubredditsTextInputLayout.setBoxStrokeColor(primaryTextColor);
+ excludesSubredditsTextInputLayout.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
+ excludesSubredditsTextInputEditText.setTextColor(primaryTextColor);
+ excludesUsersTextInputLayout.setBoxStrokeColor(primaryTextColor);
+ excludesUsersTextInputLayout.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
+ excludesUsersTextInputEditText.setTextColor(primaryTextColor);
+ excludesFlairsTextInputLayout.setBoxStrokeColor(primaryTextColor);
+ excludesFlairsTextInputLayout.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
+ excludesFlairsTextInputEditText.setTextColor(primaryTextColor);
+ containsFlairsTextInputLayout.setBoxStrokeColor(primaryTextColor);
+ containsFlairsTextInputLayout.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
+ containsFlairsTextInputEditText.setTextColor(primaryTextColor);
+ minVoteTextInputLayout.setBoxStrokeColor(primaryTextColor);
+ minVoteTextInputLayout.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
+ minVoteTextInputEditText.setTextColor(primaryTextColor);
+ maxVoteTextInputLayout.setBoxStrokeColor(primaryTextColor);
+ maxVoteTextInputLayout.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
+ maxVoteTextInputEditText.setTextColor(primaryTextColor);
+ minCommentsTextInputLayout.setBoxStrokeColor(primaryTextColor);
+ minCommentsTextInputLayout.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
+ minCommentsTextInputEditText.setTextColor(primaryTextColor);
+ maxCommentsTextInputLayout.setBoxStrokeColor(primaryTextColor);
+ maxCommentsTextInputLayout.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
+ maxCommentsTextInputEditText.setTextColor(primaryTextColor);
+ minAwardsTextInputLayout.setBoxStrokeColor(primaryTextColor);
+ minAwardsTextInputLayout.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
+ minAwardsTextInputEditText.setTextColor(primaryTextColor);
+ maxAwardsTextInputLayout.setBoxStrokeColor(primaryTextColor);
+ maxAwardsTextInputLayout.setDefaultHintTextColor(ColorStateList.valueOf(primaryTextColor));
+ maxAwardsTextInputEditText.setTextColor(primaryTextColor);
}
@Override
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 084f83d7..ff4b0598 100644
--- a/app/src/main/res/layout/activity_customize_post_filter.xml
+++ b/app/src/main/res/layout/activity_customize_post_filter.xml
@@ -156,6 +156,7 @@
</LinearLayout>
<com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/title_excludes_strings_text_input_layout_customize_post_filter_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
@@ -175,6 +176,7 @@
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/title_excludes_regex_text_input_layout_customize_post_filter_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
@@ -194,6 +196,7 @@
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/excludes_subreddits_text_input_layout_customize_post_filter_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
@@ -213,6 +216,7 @@
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/excludes_users_text_input_layout_customize_post_filter_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
@@ -232,6 +236,7 @@
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/excludes_flairs_text_input_layout_customize_post_filter_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
@@ -251,6 +256,7 @@
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/contains_flairs_text_input_layout_customize_post_filter_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
@@ -270,6 +276,7 @@
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/min_vote_text_input_layout_customize_post_filter_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
@@ -289,6 +296,7 @@
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/max_vote_text_input_layout_customize_post_filter_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
@@ -308,6 +316,7 @@
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/min_comments_text_input_layout_customize_post_filter_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
@@ -327,6 +336,7 @@
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/max_comments_text_input_layout_customize_post_filter_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
@@ -346,6 +356,7 @@
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/min_awards_text_input_layout_customize_post_filter_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
@@ -365,6 +376,7 @@
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/max_awards_text_input_layout_customize_post_filter_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"