Bug 1400334 - Guard against no theme color in standalone webapp r=nechen
MozReview-Commit-ID: C9LfdSvujS9
--- a/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
@@ -272,23 +272,27 @@ public class WebAppActivity extends AppC
}
if (mManifest.isInScope(url) && where != TargetWindow.NEW) {
// This is in scope and wants to load in the same frame, so
// let Gecko handle it.
return false;
}
- CustomTabsIntent tab = new CustomTabsIntent.Builder()
+ final CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder()
.addDefaultShareMenuItem()
- .setToolbarColor(mManifest.getThemeColor())
.setStartAnimations(this, R.anim.slide_in_right, R.anim.slide_out_left)
- .setExitAnimations(this, R.anim.slide_in_left, R.anim.slide_out_right)
- .build();
+ .setExitAnimations(this, R.anim.slide_in_left, R.anim.slide_out_right);
+ final Integer themeColor = mManifest.getThemeColor();
+ if (themeColor != null) {
+ builder.setToolbarColor(themeColor);
+ }
+
+ final CustomTabsIntent tab = builder.build();
tab.intent.setClass(this, CustomTabsActivity.class);
tab.launchUrl(this, url);
return true;
}
private void updateFullScreen() {
boolean fullScreen = mIsFullScreenContent || mIsFullScreenMode;
if (ActivityUtils.isFullScreen(this) == fullScreen) {