From 21c47eaa4c3cffe0965447e2d7fb7d1cb964b720 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Wed, 18 Mar 2020 09:19:26 +0800 Subject: Still implementing custom themes. --- .../infinityforreddit/Activity/LoginActivity.java | 9 --------- .../infinityforreddit/Activity/SearchActivity.java | 5 +++++ .../Adapter/CommentAndPostRecyclerViewAdapter.java | 4 ---- .../CustomTheme/CustomThemeWrapper.java | 4 ++-- app/src/main/res/layout/activity_login.xml | 20 +++++--------------- 5 files changed, 12 insertions(+), 30 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java index 78e67281..8ed1df56 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java @@ -5,7 +5,6 @@ import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Bitmap; import android.net.Uri; -import android.os.Build; import android.os.Bundle; import android.view.MenuItem; import android.webkit.CookieManager; @@ -15,7 +14,6 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; -import androidx.coordinatorlayout.widget.CoordinatorLayout; import com.google.android.material.appbar.AppBarLayout; @@ -46,8 +44,6 @@ import retrofit2.Retrofit; public class LoginActivity extends BaseActivity { - @BindView(R.id.coordinator_layout_login_activity) - CoordinatorLayout coordinatorLayout; @BindView(R.id.appbar_layout_login_activity) AppBarLayout appBarLayout; @BindView(R.id.toolbar_login_activity) @@ -80,10 +76,6 @@ public class LoginActivity extends BaseActivity { applyCustomTheme(); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && isChangeStatusBarIconColor()) { - addOnOffsetChangedListener(appBarLayout); - } - setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); @@ -222,7 +214,6 @@ public class LoginActivity extends BaseActivity { @Override protected void applyCustomTheme() { - coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchActivity.java index 2fab7727..e075d9a5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchActivity.java @@ -192,6 +192,11 @@ public class SearchActivity extends BaseActivity { coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); simpleSearchView.setSearchBackground(new ColorDrawable(mCustomThemeWrapper.getColorPrimary())); + int toolbarPrimaryTextAndIconColorColor = mCustomThemeWrapper.getToolbarPrimaryTextAndIconColor(); + simpleSearchView.setIconsColor(toolbarPrimaryTextAndIconColorColor); + simpleSearchView.setTextColor(toolbarPrimaryTextAndIconColorColor); + simpleSearchView.setBackIconColor(toolbarPrimaryTextAndIconColorColor); + simpleSearchView.setHintTextColor(mCustomThemeWrapper.getSecondaryTextColor()); searchInTextView.setTextColor(mCustomThemeWrapper.getColorAccent()); subredditNameTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor()); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java index a9c48b31..75564f05 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java @@ -2169,7 +2169,6 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter mCommentRecyclerViewAdapterCallback.retryFetchingComments()); - itemView.setBackgroundColor(mCommentBackgroundColor); errorTextView.setTextColor(mSecondaryTextColor); } } @@ -2181,7 +2180,6 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter mCommentRecyclerViewAdapterCallback.retryFetchingMoreComments()); - itemView.setBackgroundColor(mCommentBackgroundColor); errorTextView.setTextColor(mSecondaryTextColor); retryButton.setBackgroundTintList(ColorStateList.valueOf(mColorPrimaryLightTheme)); retryButton.setTextColor(mButtonTextColor); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeWrapper.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeWrapper.java index 2ce1c90e..7c0e5bd5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeWrapper.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeWrapper.java @@ -122,12 +122,12 @@ public class CustomThemeWrapper { public int getPostIconAndInfoColor() { return themeSharedPreferences.getInt(CustomThemeSharedPreferencesUtils.POST_ICON_AND_INFO_COLOR, - getDefaultColor("#808080", "#808080", "#808080")); + getDefaultColor("#8A000000", "#B3FFFFFF", "#B3FFFFFF")); } public int getCommentIconAndInfoColor() { return themeSharedPreferences.getInt(CustomThemeSharedPreferencesUtils.COMMENT_ICON_AND_INFO_COLOR, - getDefaultColor("#808080", "#808080", "#808080")); + getDefaultColor("#8A000000", "#B3FFFFFF", "#B3FFFFFF")); } public int getToolbarPrimaryTextAndIconColor() { diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml index a23e580c..dbf51b4c 100644 --- a/app/src/main/res/layout/activity_login.xml +++ b/app/src/main/res/layout/activity_login.xml @@ -4,7 +4,6 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:id="@+id/coordinator_layout_login_activity" android:background="?attr/backgroundColor" tools:application="ml.docilealligator.infinityforreddit.Activity.LoginActivity"> @@ -15,21 +14,12 @@ android:background="?attr/toolbarAndTabBackgroundColor" android:theme="@style/AppTheme.AppBarOverlay"> - - - - - + android:layout_height="?attr/actionBarSize" + app:popupTheme="@style/AppTheme.PopupOverlay" + app:navigationIcon="?attr/homeAsUpIndicator" /> -- cgit v1.2.3