Apply theme color to navigation bar

This commit is contained in:
seven332 committed 2018-12-14 20:20:22 +08:00
1 parent e8de8ac5c8
commit 419405f4e2
9 files changed
+40

No files matched your search

@@ -17,14 +17,17 @@
package com.hippo.ehviewer.ui;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.annotation.StyleRes;
import android.support.v7.app.AppCompatActivity;
import android.view.WindowManager;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.hippo.android.resource.AttrResources;
import com.hippo.content.ContextLocalWrapper;
import com.hippo.ehviewer.EhApplication;
import com.hippo.ehviewer.R;
import com.hippo.ehviewer.Settings;
import java.util.Locale;
@@ -44,6 +47,10 @@ public abstract class EhActivity extends AppCompatActivity {
if (Settings.getEnableAnalytics()) {
FirebaseAnalytics.getInstance(this);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && Settings.getApplyNavBarThemeColor()) {
getWindow().setNavigationBarColor(AttrResources.getAttrColor(this, R.attr.colorPrimaryDark));
}
}
@Override