Bug 1369815 - Set the display mode for standalone PWA r=droeh
MozReview-Commit-ID: EGCskj6pwkC
--- a/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
@@ -177,16 +177,39 @@ public class WebAppActivity extends AppC
GeckoScreenOrientation.ScreenOrientation orientation =
GeckoScreenOrientation.screenOrientationFromString(orientString);
int activityOrientation = GeckoScreenOrientation.screenOrientationToAndroidOrientation(orientation);
setRequestedOrientation(activityOrientation);
}
+ private void updateDisplayMode(JSONObject manifest) {
+ String displayMode = manifest.optString("display");
+
+ GeckoViewSettings.DisplayMode mode;
+ switch (displayMode) {
+ case "standalone":
+ mode = GeckoViewSettings.DisplayMode.STANDALONE;
+ break;
+ case "fullscreen":
+ mode = GeckoViewSettings.DisplayMode.FULLSCREEN;
+ break;
+ case "minimal-ui":
+ mode = GeckoViewSettings.DisplayMode.MINIMAL_UI;
+ break;
+ case "browser":
+ default:
+ mode = GeckoViewSettings.DisplayMode.BROWSER;
+ break;
+ }
+
+ mGeckoView.getSettings().setInt(GeckoViewSettings.USE_DISPLAY_MODE, mode.value());
+ }
+
private Integer readColorFromManifest(JSONObject manifest) {
final String colorStr = manifest.optString("theme_color", null);
if (colorStr != null) {
return ColorUtil.parseStringColor(colorStr);
}
return null;
}