I am developing a watch face using CanvasWatchFaceService.Engine
I need to detect if watch is round or square.
I overrided onApplyWindowInsets, but it is not called.
Shall I set a specific listener or something like that?
I am developing a watch face using CanvasWatchFaceService.Engine
I need to detect if watch is round or square.
I overrided onApplyWindowInsets, but it is not called.
Shall I set a specific listener or something like that?
In my experience, onApplywindowInsets
only gets called when you're using Theme.DeviceDefault
, or a theme descending from it. It won't get called if you're using a completely custom theme.
So in the manifest for your watch face, your application
tag needs to look something like this:
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.DeviceDefault" >
Or if you have a theme for the watch face service, that will override it.
In my experience, onApplyWindowInsets is not called unless android:
isScrollContainer = "true"
is set to any view in layout.