|
|
@ -179,6 +179,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
private int mOriginalOrientation; |
|
|
|
private int mOriginalOrientation; |
|
|
|
private int mBackgroundColor; |
|
|
|
private int mBackgroundColor; |
|
|
|
private int mIconColor; |
|
|
|
private int mIconColor; |
|
|
|
|
|
|
|
private int mDisabledIconColor; |
|
|
|
private int mCurrentUiColor = Color.BLACK; |
|
|
|
private int mCurrentUiColor = Color.BLACK; |
|
|
|
private String mSearchText; |
|
|
|
private String mSearchText; |
|
|
|
private String mUntitledTitle; |
|
|
|
private String mUntitledTitle; |
|
|
@ -258,6 +259,8 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
//TODO make sure dark theme flag gets set correctly
|
|
|
|
//TODO make sure dark theme flag gets set correctly
|
|
|
|
mDarkTheme = mPreferences.getUseTheme() != 0 || isIncognito(); |
|
|
|
mDarkTheme = mPreferences.getUseTheme() != 0 || isIncognito(); |
|
|
|
mIconColor = mDarkTheme ? ThemeUtils.getIconDarkThemeColor(this) : ThemeUtils.getIconLightThemeColor(this); |
|
|
|
mIconColor = mDarkTheme ? ThemeUtils.getIconDarkThemeColor(this) : ThemeUtils.getIconLightThemeColor(this); |
|
|
|
|
|
|
|
mDisabledIconColor = mDarkTheme ? ContextCompat.getColor(this, R.color.icon_dark_theme_disabled) : |
|
|
|
|
|
|
|
ContextCompat.getColor(this, R.color.icon_light_theme_disabled); |
|
|
|
mShowTabsInDrawer = mPreferences.getShowTabsInDrawer(!isTablet()); |
|
|
|
mShowTabsInDrawer = mPreferences.getShowTabsInDrawer(!isTablet()); |
|
|
|
|
|
|
|
|
|
|
|
// initialize background ColorDrawable
|
|
|
|
// initialize background ColorDrawable
|
|
|
@ -1360,14 +1363,45 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
mDrawerLayout.closeDrawers(); |
|
|
|
mDrawerLayout.closeDrawers(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void setForwardButtonEnabled(boolean enabled) { |
|
|
|
|
|
|
|
if (mForwardMenuItem != null && mForwardMenuItem.getIcon() != null) { |
|
|
|
|
|
|
|
int colorFilter; |
|
|
|
|
|
|
|
if (enabled) { |
|
|
|
|
|
|
|
colorFilter = mIconColor; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
colorFilter = mDisabledIconColor; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
mForwardMenuItem.getIcon().setColorFilter(colorFilter, PorterDuff.Mode.SRC_IN); |
|
|
|
|
|
|
|
mForwardMenuItem.setIcon(mForwardMenuItem.getIcon()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void setBackButtonEnabled(boolean enabled) { |
|
|
|
|
|
|
|
if (mBackMenuItem != null && mBackMenuItem.getIcon() != null) { |
|
|
|
|
|
|
|
int colorFilter; |
|
|
|
|
|
|
|
if (enabled) { |
|
|
|
|
|
|
|
colorFilter = mIconColor; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
colorFilter = mDisabledIconColor; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
mBackMenuItem.getIcon().setColorFilter(colorFilter, PorterDuff.Mode.SRC_IN); |
|
|
|
|
|
|
|
mBackMenuItem.setIcon(mBackMenuItem.getIcon()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private MenuItem mBackMenuItem; |
|
|
|
|
|
|
|
private MenuItem mForwardMenuItem; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean onCreateOptionsMenu(Menu menu) { |
|
|
|
public boolean onCreateOptionsMenu(Menu menu) { |
|
|
|
MenuItem back = menu.findItem(R.id.action_back); |
|
|
|
mBackMenuItem = menu.findItem(R.id.action_back); |
|
|
|
MenuItem forward = menu.findItem(R.id.action_forward); |
|
|
|
mForwardMenuItem = menu.findItem(R.id.action_forward); |
|
|
|
if (back != null && back.getIcon() != null) |
|
|
|
if (mBackMenuItem != null && mBackMenuItem.getIcon() != null) |
|
|
|
back.getIcon().setColorFilter(mIconColor, PorterDuff.Mode.SRC_IN); |
|
|
|
mBackMenuItem.getIcon().setColorFilter(mIconColor, PorterDuff.Mode.SRC_IN); |
|
|
|
if (forward != null && forward.getIcon() != null) |
|
|
|
if (mForwardMenuItem != null && mForwardMenuItem.getIcon() != null) |
|
|
|
forward.getIcon().setColorFilter(mIconColor, PorterDuff.Mode.SRC_IN); |
|
|
|
mForwardMenuItem.getIcon().setColorFilter(mIconColor, PorterDuff.Mode.SRC_IN); |
|
|
|
return super.onCreateOptionsMenu(menu); |
|
|
|
return super.onCreateOptionsMenu(menu); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|