Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So, another answer, since the first answer is still relevant - for drawables.</p> <p>First of all, you want to use PX since the SmartWatch display is built up by 128x128 pixels. Density should not be applied.</p> <p>I have modified your xmls a bit. Mostly I have removed unnecessary definitions.</p> <p>The grid:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;!-- px is used since this is a layout for the accessory display. --&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="@dimen/smart_watch_control_height" android:layout_height="@dimen/smart_watch_control_width" tools:ignore="PxUsage" &gt; &lt;GridView android:id="@+id/grid" android:layout_width="fill_parent" android:layout_height="fill_parent" android:numColumns="3" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>As you can see, I have left out most of your original xml. You really just need to define the grid and the number of columns. The rest will take care of itself - i.e. the grid will be distributed evenly in the parent layout (128x128).</p> <p>The cell:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@android:id/text1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:textColor="#0000FF" android:textSize="26px" android:textStyle="bold" tools:ignore="PxUsage" /&gt; </code></pre> <p>Here I changed the textSize to pixels, and removed the padding, since you do not need to state it.</p> <p>This should do the trick for you. I tested on different phone models - works out nicely. If it doesn't, your adapter could be the problem. For testing, I used a simple ArrayAdapter, like this:</p> <pre><code>String[] numbers = new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(mContext, R.layout.cell, numbers); </code></pre> <p>Cheers!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload