Fix some issues of custom theme.

This commit is contained in:
Alex Ning 2020-03-27 19:22:26 +08:00
parent 1cfdaf41fa
commit 7e222091c8
4 changed files with 5 additions and 9 deletions

View File

@ -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);

View File

@ -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());
}

View File

@ -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" />
</com.google.android.material.appbar.CollapsingToolbarLayout>

View File

@ -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" />