Android Wear App rejected, need to implement Round screen compatibility? how?

315 views Asked by At

I've created an android wear game in unity, functions brilliantly for all intents and purposes except that it was rejected from the android wear store because it doesn't have compatibility for round screens.

According to my round emulator a significant bit is cut off because the game is actually based on a square board.

I would really appreciate some help with this, as I am very inexperienced in android studio and want to release this as soon as possible.

The simplest solution is the one I'm most likely going to want to go with if that's possible, I do hope there is a simple solution, I was thinking if I could detect when the watch is round, simply shrinking the app down to fit the circle could work; no idea how to do that.

Any help would be immensely appreciated and the user will be put in the game credits under "Special Thanks!"

Cheers

1

There are 1 answers

0
BrentM On

Using a BoxInsetLayout allows you to shrink a layout to fully appear on a round device.

enter image description here

In your layout XML code use the BoxInsetLayout as the root element and then add if you want to constrain some or all of the layout to within the bounds of the device add app:layout_box="all". Here is a sample XML layout:

<?xml version="1.0" encoding="utf-8"?>
<android.support.wearable.view.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_height="match_parent"
 android:layout_width="match_parent"
 tools:context=".MainActivity">

   <FrameLayout
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:padding="6dp"
     app:layout_box="all">

     <ImageView
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
         android:id="@+id/imageQR"
         android:layout_gravity="center"
         android:contentDescription="@string/qr_image_description" />
  </FrameLayout>
</android.support.wearable.view.BoxInsetLayout>

The Android documentation explains all about shape aware layouts and how to do this.

https://developer.android.com/training/wearables/ui/layouts.html

Take a look at this blog for an example project that implements a shape aware layout.