4

When building layouts for Glass using Activity and Fragment it seems that some additional layout margins on top, left, right and bottom are present. Is there any way to reset that?

2 Answers2

0

Do you also see these margins if you do screencast to yout mobile phone? In my case if i don't set any margin to the main layout of my activity, i can see some margin like you say, but if i do screencast to my mobile (with MyGlass app) I check that there isn't margin.

Bae
  • 892
  • 3
  • 12
  • 26
0

By convention there is a 40px margin round everything on a screen for glass, see the design guidelines or the developers site with example code

However you don't have to use them, by default the margins should be 0, so if you have a layout like:

<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
    <ImageView
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:src="@drawable/bg" 
    />
</AbsoluteLayout>

It will show the image 'edge-to-edge' (640x350).

Of course with the screen on Glass it's hard to see where the actual edge is, so you really need to check a screen cast to check it's performing as expected.

Ben
  • 1,767
  • 16
  • 32
  • The problem is that when I have a blank ViewGroup in Activity, I still have this margins around it. –  May 13 '14 at 13:28
  • can you edit your question to include the code sample? – Ben May 14 '14 at 15:50