mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-07 03:07:26 +01:00
Building CustomizePostFilterActivity.
This commit is contained in:
parent
06d1d028eb
commit
35ae9c547f
@ -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
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user