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: https://www.youtube.com/watch?v=ijh5EOTTR-w
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: https://docs.google.com/open?id=0BwywSxPvL53dcmlwd0RJQWhVa0E
Both SmartWatches are running on the same versions:
- Smartwatch version 0.1.A.3.7
- Host application 1.2.37
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).
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.
I have no idea what could be making this significant difference, and would appreciate any hints or help. Thank you!
P.S. I'm not using any drawables.
Here's my code to make things even more clear:
1) The grid holding the values:
<?xml version="1.0" encoding="utf-8"?>
<!-- px is used since this is a layout for the accessory display. -->
<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">
<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" />
</RelativeLayout>
2) Into each cell of the grid goes one of these elements:
<?xml version="1.0" encoding="utf-8"?>
<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"
/>
3) The drawing logic in the control:
// 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);