Android ARC app for chrome, set size of windows for different Activities/Layouts

旧巷老猫 提交于 2019-11-30 18:37:55

问题


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:

  1. 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.
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!