Bug 1332546 - ensure ActionBar color is not translucent r=sebastian
authorJulian_Chu <walkingice0204@gmail.com>
Wed, 08 Mar 2017 11:13:48 +0800
changeset 348313 b296196d185933d6fc4b893c9b9054a6883ea0e3
parent 348312 b65a8df84b11fd53edb97b72a2e78faeeabe3546
child 348314 4796c44dda66b89f59c9a40a85534061d7aed578
push id88187
push userarchaeopteryx@coole-files.de
push dateSat, 18 Mar 2017 15:27:00 +0000
treeherdermozilla-inbound@0b1d3324cffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1332546
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1332546 - ensure ActionBar color is not translucent r=sebastian 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);