I agree that good mobile UI should be responsive. I'm thinking this feature would be useful for testing your app on those wide range of mobile screen sizes. Right now, it's difficult to test apps made with gomobile because the viewport needs to be resized manually to see all the content.
1. Would it be realistic to pass a flag like: gomobile build -target=ios -viewport=1125x2001 golang.org/x/mobile/example/basic 2. Or, could we enable an API where developers could use /pkg/flag to enable flags on the mobile binary itself and adjust the viewport programmatically like: ./myNewMobileApp -viewport=1125x2001 I've heard of several people running into this problem trying to test GoMobile apps. If there's another, easier way to run test the UI on gomobile apps, then we might need to just educate the community on best practices there. On Thu, Jun 9, 2016 at 7:45 PM Nigel Tao <nigel...@golang.org> wrote: > On Tue, Jun 7, 2016 at 9:38 AM, Andy Brewer <a...@ever.io> wrote: > > Basically, GoMobile binaries are always rendered in an 800x800 window. > The > > window can be resized, but only manually, not through code. Apparently, > the > > 800x800 value is hard coded. Is there a reason for this, or is there an > > opportunity for a patch that will allow users to modify the window size > so > > it can be easily set to common mobile device sizes? > > The x/mobile repo is meant for apps that run on mobile devices: phones > and tablets. Unlike desktop apps, mobile apps (whether written in Go > or not) generally don't have a say in what their window size will be, > as they generally run full-screen, and screens have different sizes. > Even Apple devices have different aspect ratios. Accordingly, a good > mobile app's UI should be usable in a range of window sizes, so I am > hesitant to add an API feature that encourages building a > pixel-perfect UI for one specific window size. > > I'd consider a patch that changed the hard-coded value to a more > phone-like aspect ratio instead of 1:1. Maybe 4:3 or 5:3 or 3:2 or > 16:9 but as you can see there are multiple bike-shedding options and > no single one is obviously 'correct'. > > If you must change this for your own workflow, and you're on a Mac, > you want to change the > NSRect rect = NSMakeRect(0, 0, 400, 400); > line in x/mobile/app/darwin_amd64.m. The doubling from 400 to 800 is > done by the OS, because you're presumably on a Retina display. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.