While developing Android Wear watch face, how can one detect if screen is round and has chin (aka flat tire band), like Moto 360?
I tried onSurfaceChanged
, but width and height are identical overthere.
I tried this on emulator having chin, but still can't detect chin, is the problem with emulator or my code?:
@Override
void onApplyWindowInsets(WindowInsets insets) {
super.onApplyWindowInsets(insets);
// check if MOTO360 or other Chin layouts
Log.d(TAG,String.format("isRound : %s, BottomInset :%d",insets.isRound()?"YES":"NO",insets.getStableInsetBottom()));
// LOG OUTPUT : isRound : YES, BottomInset :0
if (insets.isRound() && insets.getStableInsetBottom() > 0)
ClockPaintingRoutines.flat_display_mode=true;
}
I am using:
insets.getSystemWindowInsetBottom() > 0
This is working for me on the emulator, but I don't have a real device to test it on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With