aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-07-12 12:17:38 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-07-12 12:17:38 +0000
commit8c89603f198c0912d926018c26f8856c3b59c1cd (patch)
treecf343a3b4f89de04890ae6becf995da80385a2d7 /app
parent67d4d9cc4f887a87450bbdca041a75a41a103d2b (diff)
downloadinfinity-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')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java18
-rw-r--r--app/src/main/res/layout/activity_view_post_detail.xml18
-rw-r--r--app/src/main/res/layout/exo_playback_control_view.xml4
-rw-r--r--app/src/main/res/values/strings.xml2
4 files changed, 31 insertions, 11 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
diff --git a/app/src/main/res/layout/activity_view_post_detail.xml b/app/src/main/res/layout/activity_view_post_detail.xml
index f44fd823..3a7cbf3c 100644
--- a/app/src/main/res/layout/activity_view_post_detail.xml
+++ b/app/src/main/res/layout/activity_view_post_detail.xml
@@ -65,7 +65,6 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
-
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingStart="16dp"
@@ -78,15 +77,16 @@
android:layout_height="wrap_content"
android:fontFamily="?attr/font_family"
android:textSize="?attr/font_default"
- android:hint="@string/post_filter_name_hint" />
+ android:hint="@string/search_comments" />
</com.google.android.material.textfield.TextInputLayout>
<ImageView
android:id="@+id/previous_result_image_view_view_post_detail_activity"
- android:layout_width="24dp"
- android:layout_height="24dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
+ android:padding="8dp"
android:src="@drawable/ic_arrow_upward_black_24dp"
android:background="?actionBarItemBackground"
android:clickable="true"
@@ -94,9 +94,10 @@
<ImageView
android:id="@+id/next_result_image_view_view_post_detail_activity"
- android:layout_width="24dp"
- android:layout_height="24dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
+ android:padding="8dp"
android:src="@drawable/ic_arrow_downward_black_24dp"
android:background="?actionBarItemBackground"
android:clickable="true"
@@ -104,9 +105,10 @@
<ImageView
android:id="@+id/close_search_panel_image_view_view_post_detail_activity"
- android:layout_width="24dp"
- android:layout_height="24dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
+ android:padding="8dp"
android:src="@drawable/ic_close_black_24dp"
android:background="?actionBarItemBackground"
android:clickable="true"
diff --git a/app/src/main/res/layout/exo_playback_control_view.xml b/app/src/main/res/layout/exo_playback_control_view.xml
index dd9bef64..17b332ef 100644
--- a/app/src/main/res/layout/exo_playback_control_view.xml
+++ b/app/src/main/res/layout/exo_playback_control_view.xml
@@ -58,7 +58,7 @@
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:includeFontPadding="false"
- android:textColor="#FFBEBEBE"
+ android:textColor="#FFFFFF"
android:fontFamily="?attr/font_family" />
<com.google.android.exoplayer2.ui.DefaultTimeBar
@@ -78,7 +78,7 @@
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:includeFontPadding="false"
- android:textColor="#FFBEBEBE"
+ android:textColor="#FFFFFF"
android:fontFamily="?attr/font_family" />
</LinearLayout>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index aad47bf1..df5ae856 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1133,4 +1133,6 @@
<string name="parse_rpan_broadcasts_failed">Cannot parse RPAN broadcasts</string>
<string name="parse_rpan_broadcast_failed">Cannot parse RPAN broadcast</string>
+ <string name="search_comments">Search Comments</string>
+
</resources>