I'm attempted to develop an app for an Android smart watch (Android Wear), specifically the Fossil Sport watch.
In Android Device Manager, I've set the base device to Android Wear Round Chin and resolution to 320x320.
When running my code, the emulator looks like:
However when deployed to the watch, it looks like this:
Please ignore the actual text as the number is randomised however, why would the circle be cropped on the actual watch?
There are other minor difference such as text appearing on one line in the emulator sometimes spans two lines. How can I emulate the actual size of the watch face as I'm currently having to deploy to the watch and test on the watch directly.
Code:
<?xml version="1.0" encoding="utf-8"?>
<android.support.wear.widget.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/box_inset_layout_padding"
tools:deviceIds="wear">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:padding="@dimen/inner_frame_layout_padding"
app:boxedEdges="all">
...
...
...
</FrameLayout>
</android.support.wear.widget.BoxInsetLayout>
Just remove BoxInsetLayout
wrapper and set the appropriate size of the inner view.
BoxInsetLayout
layout will scale your inner view to an inscribed rectangle to make sure your view won't be clipped by screen. But at the same time your available space will be reduced. In this case, there is not enough space to display the progress bar.
Because your emulator has enough space so inner view can be shown fully.
Alternative: It seems that you use a custom view, try to modify it to reduce minimum space requirement. Then your progress bar can fit into the reduced space.