Bug 1369815 - Set the display mode for standalone PWA r=droeh

MozReview-Commit-ID: EGCskj6pwkC
This commit is contained in:
James Willcox 2017-08-10 11:56:17 -05:00
Родитель 76a0cb3576
Коммит 4f083f1cd5
1 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -182,6 +182,29 @@ public class WebAppActivity extends AppCompatActivity
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) {