diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-07-12 12:17:38 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-07-12 12:17:38 +0000 |
commit | 8c89603f198c0912d926018c26f8856c3b59c1cd (patch) | |
tree | cf343a3b4f89de04890ae6becf995da80385a2d7 /app/src/main/java | |
parent | 67d4d9cc4f887a87450bbdca041a75a41a103d2b (diff) | |
download | infinity-for-reddit-8c89603f198c0912d926018c26f8856c3b59c1cd.tar infinity-for-reddit-8c89603f198c0912d926018c26f8856c3b59c1cd.tar.gz infinity-for-reddit-8c89603f198c0912d926018c26f8856c3b59c1cd.tar.bz2 infinity-for-reddit-8c89603f198c0912d926018c26f8856c3b59c1cd.tar.lz infinity-for-reddit-8c89603f198c0912d926018c26f8856c3b59c1cd.tar.xz infinity-for-reddit-8c89603f198c0912d926018c26f8856c3b59c1cd.tar.zst infinity-for-reddit-8c89603f198c0912d926018c26f8856c3b59c1cd.zip |
Apply custom theme to the search panel in ViewPostDetailActivity.
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java index a00f4c8d..3dd98593 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java @@ -3,6 +3,7 @@ package ml.docilealligator.infinityforreddit.activities; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; +import android.content.res.ColorStateList; import android.os.Build; import android.os.Bundle; import android.os.Handler; @@ -176,6 +177,11 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) fab.getLayoutParams(); params.bottomMargin += navBarHeight; fab.setLayoutParams(params); + + searchPanelMaterialCardView.setContentPadding(searchPanelMaterialCardView.getPaddingStart(), + searchPanelMaterialCardView.getPaddingTop(), + searchPanelMaterialCardView.getPaddingEnd(), + searchPanelMaterialCardView.getPaddingBottom() + navBarHeight); } } } @@ -272,6 +278,14 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele mCoordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); applyAppBarLayoutAndToolbarTheme(mAppBarLayout, mToolbar); applyFABTheme(fab); + searchPanelMaterialCardView.setBackgroundTintList(ColorStateList.valueOf(mCustomThemeWrapper.getColorPrimary())); + int searchPanelTextAndIconColor = mCustomThemeWrapper.getToolbarPrimaryTextAndIconColor(); + searchTextInputLayout.setBoxStrokeColor(searchPanelTextAndIconColor); + searchTextInputLayout.setDefaultHintTextColor(ColorStateList.valueOf(searchPanelTextAndIconColor)); + searchTextInputEditText.setTextColor(searchPanelTextAndIconColor); + previousResultImageView.setColorFilter(searchPanelTextAndIconColor, android.graphics.PorterDuff.Mode.SRC_IN); + nextResultImageView.setColorFilter(searchPanelTextAndIconColor, android.graphics.PorterDuff.Mode.SRC_IN); + closeSearchPanelImageView.setColorFilter(searchPanelTextAndIconColor, android.graphics.PorterDuff.Mode.SRC_IN); } private void checkNewAccountAndBindView(Bundle savedInstanceState) { @@ -419,7 +433,9 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele } public void searchComment(ViewPostDetailFragment fragment, boolean searchNextComment) { - fragment.searchComment(searchTextInputEditText.getText().toString(), searchNextComment); + if (!searchTextInputEditText.getText().toString().isEmpty()) { + fragment.searchComment(searchTextInputEditText.getText().toString(), searchNextComment); + } } @Subscribe |