Skip to content

Commit

Permalink
Remove min and max awards in CustomizePostFilterActivity.
Browse files Browse the repository at this point in the history
  • Loading branch information
Docile-Alligator committed Nov 6, 2023
1 parent 71c055b commit 5f1a23a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,6 @@ public class CustomizePostFilterActivity extends BaseActivity {
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
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
Expand Down Expand Up @@ -330,8 +322,6 @@ private void bindView() {
maxVoteTextInputEditText.setText(Integer.toString(postFilter.maxVote));
minCommentsTextInputEditText.setText(Integer.toString(postFilter.minComments));
maxCommentsTextInputEditText.setText(Integer.toString(postFilter.maxComments));
minAwardsTextInputEditText.setText(Integer.toString(postFilter.minAwards));
maxAwardsTextInputEditText.setText(Integer.toString(postFilter.maxAwards));

Intent intent = getIntent();
String excludeSubreddit = intent.getStringExtra(EXTRA_EXCLUDE_SUBREDDIT);
Expand Down Expand Up @@ -451,12 +441,6 @@ protected void applyCustomTheme() {
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);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
nameTextInputEditText.setTextCursorDrawable(cursorDrawable);
Expand All @@ -474,8 +458,6 @@ protected void applyCustomTheme() {
maxVoteTextInputEditText.setTextCursorDrawable(cursorDrawable);
minCommentsTextInputEditText.setTextCursorDrawable(cursorDrawable);
maxCommentsTextInputEditText.setTextCursorDrawable(cursorDrawable);
minAwardsTextInputEditText.setTextCursorDrawable(cursorDrawable);
maxAwardsTextInputEditText.setTextCursorDrawable(cursorDrawable);
} else {
setCursorDrawableColor(nameTextInputEditText, primaryTextColor);
setCursorDrawableColor(titleExcludesStringsTextInputEditText, primaryTextColor);
Expand All @@ -492,8 +474,6 @@ protected void applyCustomTheme() {
setCursorDrawableColor(maxVoteTextInputEditText, primaryTextColor);
setCursorDrawableColor(minCommentsTextInputEditText, primaryTextColor);
setCursorDrawableColor(maxCommentsTextInputEditText, primaryTextColor);
setCursorDrawableColor(minAwardsTextInputEditText, primaryTextColor);
setCursorDrawableColor(maxAwardsTextInputEditText, primaryTextColor);
}

if (typeface != null) {
Expand Down Expand Up @@ -636,8 +616,8 @@ private void constructPostFilter() throws PatternSyntaxException {
postFilter.minVote = minVoteTextInputEditText.getText() == null || minVoteTextInputEditText.getText().toString().equals("") ? -1 : Integer.parseInt(minVoteTextInputEditText.getText().toString());
postFilter.maxComments = maxCommentsTextInputEditText.getText() == null || maxCommentsTextInputEditText.getText().toString().equals("") ? -1 : Integer.parseInt(maxCommentsTextInputEditText.getText().toString());
postFilter.minComments = minCommentsTextInputEditText.getText() == null || minCommentsTextInputEditText.getText().toString().equals("") ? -1 : Integer.parseInt(minCommentsTextInputEditText.getText().toString());
postFilter.maxAwards = maxAwardsTextInputEditText.getText() == null || maxAwardsTextInputEditText.getText().toString().equals("") ? -1 : Integer.parseInt(maxAwardsTextInputEditText.getText().toString());
postFilter.minAwards = minAwardsTextInputEditText.getText() == null || minAwardsTextInputEditText.getText().toString().equals("") ? -1 : Integer.parseInt(minAwardsTextInputEditText.getText().toString());
postFilter.maxAwards = -1;
postFilter.minAwards = -1;
postFilter.postTitleExcludesRegex = titleExcludesRegexTextInputEditText.getText().toString();
Pattern.compile(postFilter.postTitleExcludesRegex);
postFilter.postTitleContainsRegex = titleContainsRegexTextInputEditText.getText().toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
private int mButtonTextColor;
private int mCommentIconAndInfoColor;
private int mFullyCollapsedCommentBackgroundColor;
private int mAwardedCommentBackgroundColor;
private int[] verticalBlockColors;

private int mSearchCommentIndex = -1;
Expand Down Expand Up @@ -260,7 +259,6 @@ public void configureTheme(@NonNull MarkwonTheme.Builder builder) {
mButtonTextColor = customThemeWrapper.getButtonTextColor();
mCommentIconAndInfoColor = customThemeWrapper.getCommentIconAndInfoColor();
mFullyCollapsedCommentBackgroundColor = customThemeWrapper.getFullyCollapsedCommentBackgroundColor();
mAwardedCommentBackgroundColor = customThemeWrapper.getAwardedCommentBackgroundColor();

verticalBlockColors = new int[] {
customThemeWrapper.getCommentVerticalBarColor1(),
Expand Down Expand Up @@ -366,8 +364,6 @@ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int positi
if (comment != null) {
if (mIsSingleCommentThreadMode && comment.getId().equals(mSingleCommentId)) {
holder.itemView.setBackgroundColor(mSingleCommentThreadBackgroundColor);
} else if (comment.getAwards() != null && !comment.getAwards().equals("")) {
holder.itemView.setBackgroundColor(mAwardedCommentBackgroundColor);
}

String authorPrefixed = "u/" + comment.getAuthor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,6 @@ public int getFullyCollapsedCommentBackgroundColor() {
getDefaultColor("#8EDFBA", "#21C561", "#21C561"));
}

public int getAwardedCommentBackgroundColor() {
return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.AWARDED_COMMENT_BACKGROUND_COLOR,
getDefaultColor("#FFFFFF", "#242424", "#000000"));
}

public int getNavBarColor() {
return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.NAV_BAR_COLOR,
getDefaultColor("#FFFFFF", "#121212", "#000000"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public class CustomThemeSharedPreferencesUtils {
public static final String NSFW_TEXT_COLOR = "nsfwTextColor";
public static final String FLAIR_BACKGROUND_COLOR = "flairBackgroundColor";
public static final String FLAIR_TEXT_COLOR = "flairTextColor";
public static final String AWARDS_BACKGROUND_COLOR = "awardsBackgroundColor";
public static final String AWARDS_TEXT_COLOR = "awardsTextColor";
private static final String AWARDS_BACKGROUND_COLOR = "awardsBackgroundColor";
private static final String AWARDS_TEXT_COLOR = "awardsTextColor";
public static final String ARCHIVED_ICON_TINT = "archivedIconTint";
public static final String LOCKED_ICON_TINT = "lockedIconTint";
public static final String CROSSPOST_ICON_TINT = "crosspostIconTint";
Expand Down Expand Up @@ -96,7 +96,7 @@ public class CustomThemeSharedPreferencesUtils {
public static final String SENT_MESSAGE_BACKGROUND_COLOR = "sentMessageBackgroundColor";
public static final String SEND_MESSAGE_ICON_COLOR = "sentMessageIconColor";
public static final String FULLY_COLLAPSED_COMMENT_BACKGROUND_COLOR = "fullyCollapsedCommentBackgroundColor";
public static final String AWARDED_COMMENT_BACKGROUND_COLOR = "awardedCommentBackgroundColor";
private static final String AWARDED_COMMENT_BACKGROUND_COLOR = "awardedCommentBackgroundColor";

public static void insertThemeToSharedPreferences(CustomTheme customTheme, SharedPreferences themeSharedPreferences) {
SharedPreferences.Editor editor = themeSharedPreferences.edit();
Expand Down
44 changes: 0 additions & 44 deletions app/src/main/res/layout/activity_customize_post_filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -635,50 +635,6 @@

</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"
android:paddingBottom="8dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/min_awards_text_input_edit_text_customize_post_filter_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="numberSigned"
android:fontFamily="?attr/font_family"
android:textSize="?attr/font_default"
android:hint="@string/min_awards_hint"
android:maxLines="1" />

</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"
android:paddingBottom="8dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/max_awards_text_input_edit_text_customize_post_filter_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="numberSigned"
android:fontFamily="?attr/font_family"
android:textSize="?attr/font_default"
android:hint="@string/max_awards_hint"
android:maxLines="1" />

</com.google.android.material.textfield.TextInputLayout>

</LinearLayout>

</androidx.core.widget.NestedScrollView>
Expand Down

0 comments on commit 5f1a23a

Please sign in to comment.