I am using a WearableDrawerLayout
, and testing on a emulator with a chin. I am trying to have an element vertically centered. Instead what I see is that the element is centered in the area of "the screen minus the chin" - i.e. it is a bit shifted towards the top of the screen.
What I see:
What I should see:
From what I can tell in the (non public?) source of WearableDrawerLayout
I think this is due to this bit:
public WindowInsets onApplyWindowInsets(WindowInsets insets) {
this.mSystemWindowInsetBottom = insets.getSystemWindowInsetBottom();
if(this.mSystemWindowInsetBottom != 0) {
MarginLayoutParams layoutParams = (MarginLayoutParams)this.getLayoutParams();
layoutParams.bottomMargin = this.mSystemWindowInsetBottom;
this.setLayoutParams(layoutParams);
}
return super.onApplyWindowInsets(insets);
}
What can I do to not have this problem?
Edit: here is another example of layout that demonstrates the issue:
As you can see, the chin is not included in the available area, which means the BoxInsetLayout
has a height smaller than it should. As a consequence, its button children are too "high" - they're not bottom aligned.
Here's my edit (sorry about my Gimp skills), that shows the round display, and also where the BoxInsetLayout
and buttons should go.