I'd like to view my layouts in full screen in the layout editor. I'm using the eclipse plugin.
I've already hidden the ActionBar by selecting a *NoActionBar
theme in the combo, but the navigation bar is a different story. AFAIK it can only be hidden using flags in code.
I need to make continuous tweaks in the activity xml files, and testing it in the emulator is a real pain, when not directly impossible (my PC can't run a full HD emulator, and I'd need to SSH another machine). Needless to say I dont have the real device.
Is there a way of viewing layouts in true full screen?
Unfortunately seems there's no way of doing this. Such a basic feature should have been added long ago, IMHO this has higher priority than the fancy things we're shown at Google IOs. But anyway the layout editor usually breaks or throws exceptions. I'm not sure if this happens only in eclipse, as I'm not using Android Studio yet.
Workarounds
Example:
to emulate a 5 inch HD screen we would have created this device definition:
If we create an AVD with this definition and preview it in the layout editor in landscape mode, we'll see the dreaded black bar in the right side, which is eating up screen space and prevents correct visualization of views whose width is gravity dependent. To be able to view a free area of 1920x1080px, we can make a screen capture and measure with an image editor how much width is the black bar taking. In my case it was a 6.22%, so to have 1920px free width we need about 120 extra px, that sums a total of 2040px.
We now know our device must be 2040x1080, and we can use the Pythagorean theorem to calculate the diagonal in inches. In our example the new device definition would be:
This gives us a free area whose proportions are w/h=1.77, which is roughly 16:9.