3
在開發Android Wear手錶時,如何檢測屏幕是圓的還是下巴(又稱扁平帶),如Moto 360? 我試過onSurfaceChanged
,但寬度和高度相同。檢測Android Wear屏幕是否有下巴(又名癟胎)
我想這在具有下巴模擬器,但仍無法檢測的下巴,與仿真器或我的代碼?:
@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;
}