зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1369815 - Set the display mode for standalone PWA r=droeh
MozReview-Commit-ID: EGCskj6pwkC
This commit is contained in:
Родитель
76a0cb3576
Коммит
4f083f1cd5
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче