Wednesday, 15 September 2010

android - Some Moto 360 doesn't load rounded layout -



android - Some Moto 360 doesn't load rounded layout -

i wrote application run on round , square watches, 2 layouts , watchviewstub. since moto 360 sold on europe have many reports moto 360 doesn't load rounded layout. emulator, can't reproduce behavior if alter locale explain here : https://developer.android.com/guide/topics/resources/localization.html#testing guess it's code ...

here's how i've implemented :

<android.support.wearable.view.watchviewstub xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/watch_view_stub" android:layout_width="match_parent" android:layout_height="match_parent" app:rectlayout="@layout/rect_activity_camera" app:roundlayout="@layout/round_activity_camera">

then in fragment inflate watchviewstub

@override public void onactivitycreated(bundle savedinstancestate) { super.onactivitycreated(savedinstancestate); final watchviewstub stub = (watchviewstub) getview().findviewbyid(r.id.watch_view_stub); stub.setonlayoutinflatedlistener(new watchviewstub.onlayoutinflatedlistener() { @override public void onlayoutinflated(watchviewstub stub) { ... } }

the fragment used in fragmentviewpager/fragmentgridpageradapter. until moto 360, ideas on how can debug ?

edit

watchviewstub sample in wear sdk has 2 different behavior depends on language settings fill issue : https://code.google.com/p/android/issues/detail?id=77642

important

this issue discussed on different posts. avoid repeating updated info issue on google code updated, , i'll finish posts 1 time issue solved : https://code.google.com/p/android/issues/detail?id=77642

there many problems inflating layouts caused not correctly using watchviewstub. don't see plenty code above know exactly, 1 mutual issue when register listener watch insets:

final watchviewstub stub = (watchviewstub) findviewbyid(r.id.watch_view_stub); stub.setonapplywindowinsetslistener(new view.onapplywindowinsetslistener() { @override public windowinsets onapplywindowinsets(view view, windowinsets windowinsets) { // need phone call original insets since have overridden original // https://developer.android.com/reference/android/view/view.onapplywindowinsetslistener.html stub.onapplywindowinsets(windowinsets); homecoming windowinsets; } });

i see cases people forget homecoming windowinsets, or forget phone call stub.onapplywindowinsets(). has effect of giving square layout instead of round layout.

other issues caused forgetting set same xml elements round.xml square.xml.

what error message getting in adb logcat?

android android-wear

No comments:

Post a Comment