|
|
@ -5,18 +5,25 @@ import android.content.res.Configuration; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.support.v7.app.AppCompatActivity; |
|
|
|
import android.support.v7.app.AppCompatActivity; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.inject.Inject; |
|
|
|
|
|
|
|
|
|
|
|
import acr.browser.lightning.R; |
|
|
|
import acr.browser.lightning.R; |
|
|
|
|
|
|
|
import acr.browser.lightning.app.BrowserApp; |
|
|
|
import acr.browser.lightning.preference.PreferenceManager; |
|
|
|
import acr.browser.lightning.preference.PreferenceManager; |
|
|
|
|
|
|
|
|
|
|
|
public abstract class ThemableBrowserActivity extends AppCompatActivity { |
|
|
|
public abstract class ThemableBrowserActivity extends AppCompatActivity { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Inject |
|
|
|
|
|
|
|
PreferenceManager mPreferences; |
|
|
|
|
|
|
|
|
|
|
|
private int mTheme; |
|
|
|
private int mTheme; |
|
|
|
private boolean mShowTabsInDrawer; |
|
|
|
private boolean mShowTabsInDrawer; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void onCreate(Bundle savedInstanceState) { |
|
|
|
protected void onCreate(Bundle savedInstanceState) { |
|
|
|
mTheme = 0; //PreferenceManager.getInstance().getUseTheme();
|
|
|
|
BrowserApp.getAppComponent().inject(this); |
|
|
|
mShowTabsInDrawer = false; // PreferenceManager.getInstance().getShowTabsInDrawer(!isTablet());
|
|
|
|
mTheme = mPreferences.getUseTheme(); |
|
|
|
|
|
|
|
mShowTabsInDrawer = mPreferences.getShowTabsInDrawer(!isTablet()); |
|
|
|
|
|
|
|
|
|
|
|
// set the theme
|
|
|
|
// set the theme
|
|
|
|
if (mTheme == 1) { |
|
|
|
if (mTheme == 1) { |
|
|
@ -30,8 +37,8 @@ public abstract class ThemableBrowserActivity extends AppCompatActivity { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void onResume() { |
|
|
|
protected void onResume() { |
|
|
|
super.onResume(); |
|
|
|
super.onResume(); |
|
|
|
int theme = 0; // PreferenceManager.getInstance().getUseTheme();
|
|
|
|
int theme = mPreferences.getUseTheme(); |
|
|
|
boolean drawerTabs = false; // PreferenceManager.getInstance().getShowTabsInDrawer(!isTablet());
|
|
|
|
boolean drawerTabs = mPreferences.getShowTabsInDrawer(!isTablet()); |
|
|
|
if (theme != mTheme || mShowTabsInDrawer != drawerTabs) { |
|
|
|
if (theme != mTheme || mShowTabsInDrawer != drawerTabs) { |
|
|
|
restart(); |
|
|
|
restart(); |
|
|
|
} |
|
|
|
} |
|
|
|