Bug 1332546 - ensure ActionBar color is not translucent draft
authorJulian_Chu <walkingice0204@gmail.com>
Wed, 08 Mar 2017 11:13:48 +0800
changeset 499670 e49e29f0d0dc6dc4ef59656066f2e184113ed25b
parent 499669 46fed2d74416ae47dd2f0faecb91e98d97641003
child 499671 7a6da2e3632c70d8c3027ed1b2a1584e614af2cd
push id49471
push userbmo:walkingice0204@gmail.com
push dateThu, 16 Mar 2017 02:41:34 +0000
bugs1332546
milestone55.0a1
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
mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
--- 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);