From 7e222091c8ae8619c8f3bed297bb248f07177261 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Fri, 27 Mar 2020 19:22:26 +0800 Subject: Fix some issues of custom theme. --- .../infinityforreddit/Activity/AccountSavedThingActivity.java | 7 ------- .../docilealligator/infinityforreddit/Activity/RulesActivity.java | 3 +++ app/src/main/res/layout/activity_account_saved_thing.xml | 3 ++- app/src/main/res/layout/activity_rules.xml | 1 - 4 files changed, 5 insertions(+), 9 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountSavedThingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountSavedThingActivity.java index d95a1735..11062a31 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountSavedThingActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountSavedThingActivity.java @@ -107,13 +107,6 @@ public class AccountSavedThingActivity extends BaseActivity { } } - int statusBarResourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); - if (statusBarResourceId > 0) { - ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams(); - params.topMargin = getResources().getDimensionPixelSize(statusBarResourceId); - toolbar.setLayoutParams(params); - } - setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/RulesActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/RulesActivity.java index 99027e23..925efd0e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/RulesActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/RulesActivity.java @@ -1,6 +1,7 @@ package ml.docilealligator.infinityforreddit.Activity; import android.content.SharedPreferences; +import android.content.res.ColorStateList; import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; @@ -105,6 +106,7 @@ public class RulesActivity extends BaseActivity { } } + appBarLayout.setBackgroundColor(mCustomThemeWrapper.getColorPrimary()); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); @@ -131,6 +133,7 @@ public class RulesActivity extends BaseActivity { protected void applyCustomTheme() { coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); + progressBar.setIndeterminateTintList(ColorStateList.valueOf(mCustomThemeWrapper.getColorAccent())); errorTextView.setTextColor(mCustomThemeWrapper.getSecondaryTextColor()); } diff --git a/app/src/main/res/layout/activity_account_saved_thing.xml b/app/src/main/res/layout/activity_account_saved_thing.xml index 351c716f..4fb26ebe 100644 --- a/app/src/main/res/layout/activity_account_saved_thing.xml +++ b/app/src/main/res/layout/activity_account_saved_thing.xml @@ -29,7 +29,8 @@ android:layout_height="?attr/actionBarSize" app:layout_collapseMode="pin" app:layout_scrollFlags="scroll|enterAlways" - app:popupTheme="@style/AppTheme.PopupOverlay" /> + app:popupTheme="@style/AppTheme.PopupOverlay" + app:navigationIcon="?attr/homeAsUpIndicator" /> diff --git a/app/src/main/res/layout/activity_rules.xml b/app/src/main/res/layout/activity_rules.xml index 91f35cf2..4012d419 100644 --- a/app/src/main/res/layout/activity_rules.xml +++ b/app/src/main/res/layout/activity_rules.xml @@ -26,7 +26,6 @@ android:id="@+id/toolbar_rules_activity" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" - android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" app:navigationIcon="?attr/homeAsUpIndicator" /> -- cgit v1.2.3