问题
For those who dont know what ARC is: https://developer.chrome.com/apps/getstarted_arc
How does one manually set the size of the window depending on what activity is running or what layout is visible?
For instance this activity is too tall, and wide. While I would like the next activity to be full screen.
回答1:
The size of the window is not configurable per activity*, but the orientation is. The two options in ARC Welder that control the window are:
- Orientation: This is either landscape or portrait, which will be the default orientation for your app. However, if you set a screenOrientation on your Android activity, this can override the orientation per activity, with the window rotating to compensate. There is a performance cost to rotating this way because the plugin will be rotated via CSS.
- Form Factor: This is one of phone, tablet, or maximized. This controls the overall size of your app globally.
* but for Chrome 42 and up you can use the metadata {"resize": "reconfigure"}
to allow arbitrary user resizing. Your app must be able to relayout with a variety of aspect ratios and resolutions in this mode.
回答2:
you can also set the app fullscreen globally with"formFactor": "fullscreen"
though i'm not user if this can be triggered by the user like "resize":"reconfigure"
来源:https://stackoverflow.com/questions/29421771/android-arc-app-for-chrome-set-size-of-windows-for-different-activities-layouts