Note that there are some explanatory texts on larger screens.

plurals
  1. PODifferent display of SmartWatch control screen
    primarykey
    data
    text
    <p>My app presents a simple screen of the numbers 1-9, in a simple grid of 3x3. You can see how this looks on my SmartWatch here: <a href="https://www.youtube.com/watch?v=ijh5EOTTR-w" rel="nofollow">https://www.youtube.com/watch?v=ijh5EOTTR-w</a></p> <p>Now, that is all correct. The problem is that a user reported very different display of the same app on his device, which could be seen here: <a href="https://docs.google.com/open?id=0BwywSxPvL53dcmlwd0RJQWhVa0E" rel="nofollow">https://docs.google.com/open?id=0BwywSxPvL53dcmlwd0RJQWhVa0E</a></p> <p>Both SmartWatches are running on the same versions:</p> <ul> <li>Smartwatch version 0.1.A.3.7 </li> <li>Host application 1.2.37</li> </ul> <p>The only difference is the phone model: the problem occurs on Sony Xperia S, while on the Sony Xperia Sola all is working fine. Both phones run Sony's stock Android Gingerbread (on the Sola all continues to work fine after the upgrade to ICS).</p> <p>I tried specifying the numbers' (text) size in different ways, using dip, px, mm, but in all cases on the Sola they were presented much smaller in dimensions than on the Xperia S.</p> <p>I have no idea what could be making this significant difference, and would appreciate any hints or help. Thank you!</p> <p>P.S. I'm not using any drawables.</p> <p>Here's my code to make things even more clear:</p> <p>1) The grid holding the values:</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" android:layout_width="@dimen/smart_watch_control_height" android:layout_height="@dimen/smart_watch_control_width" xmlns:tools="http://schemas.android.com/tools" tools:ignore="PxUsage"&gt; &lt;GridView android:id="@+id/grid" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginRight="0px" android:layout_marginTop="-13px" android:columnWidth="40px" android:gravity="center" android:horizontalSpacing="0dip" android:numColumns="3" android:padding="0dip" android:stretchMode="none" android:verticalSpacing="0dip" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>2) Into each cell of the grid goes one of these elements:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="16dip" android:textStyle="bold" android:textColor="#0000FF" android:gravity="center" android:padding="0dip" /&gt; </code></pre> <p>3) The drawing logic in the control:</p> <pre><code>// Create background bitmap for animation. background = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); // Set default density to avoid scaling. background.setDensity(DisplayMetrics.DENSITY_DEFAULT); LinearLayout root = new LinearLayout(mContext); root.setLayoutParams(new LayoutParams(width, height)); LinearLayout sampleLayout= (LinearLayout) LinearLayout.inflate(mContext, R.layout.speed_dial_control, root); // draw on the sampleLayout GridView gridView = (GridView) sampleLayout.findViewById(R.id.grid); gridView.setAdapter(adapter); // adjust the size sampleLayout.measure(width, height); sampleLayout.layout(0, 0, sampleLayout.getMeasuredWidth(), sampleLayout.getMeasuredHeight()); // Draw on canvas Canvas canvas = new Canvas(background); sampleLayout.draw(canvas); // Send bitmap to accessory showBitmap(background); </code></pre>
    singulars
    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.
 

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