mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 1612785 - GVE should set WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_* via onMetaViewportFitChange. r=geckoview-reviewers,snorp
This is follow up of bug 1574307 (and bug 1503656). Differential Revision: https://phabricator.services.mozilla.com/D61431 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
1852a29c3b
commit
494b9d8d45
@ -1135,6 +1135,22 @@ public class GeckoViewActivity
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMetaViewportFitChange(final GeckoSession session, final String viewportFit) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
|
||||
return;
|
||||
}
|
||||
WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
|
||||
if (viewportFit.equals("cover")) {
|
||||
layoutParams.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
|
||||
} else if (viewportFit.equals("contain")) {
|
||||
layoutParams.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER;
|
||||
} else {
|
||||
layoutParams.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT;
|
||||
}
|
||||
getWindow().setAttributes(layoutParams);
|
||||
}
|
||||
}
|
||||
|
||||
private class ExampleProgressDelegate implements GeckoSession.ProgressDelegate {
|
||||
|
Loading…
Reference in New Issue
Block a user