Bug 1332546 - ensure ActionBar color is not translucent
Translucent color cause some rendering problem in Toolbar. For example,
if we set translucent color to toolbar and changes title, we will see
new title convers the old-translucent title.
Since ActionBar is usually on the top and nothing behind it, it does not
make sense use translucent color as its background.
MozReview-Commit-ID: LdZyuYZ7IgX
--- a/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
@@ -65,16 +65,19 @@ public class CustomTabsActivity extends
if (savedInstanceState != null) {
toolbarColor = savedInstanceState.getInt(SAVED_TOOLBAR_COLOR, NO_COLOR);
toolbarTitle = savedInstanceState.getString(SAVED_TOOLBAR_TITLE, AppConstants.MOZ_APP_BASENAME);
} else {
toolbarColor = getIntent().getIntExtra(EXTRA_TOOLBAR_COLOR, NO_COLOR);
toolbarTitle = AppConstants.MOZ_APP_BASENAME;
}
+ // Translucent color does not make sense for toolbar color. Ensure it is 0xFF.
+ toolbarColor = 0xFF000000 | toolbarColor;
+
setThemeFromToolbarColor();
final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
final ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
bindNavigationCallback(toolbar);