Add mSideHint to InsetsSource
When calculating insets, if the relative frame is fully covered by the
insets source frame, we provided the insets to the top side previously.
That could be an unexpected side. For example, IME might expect the
navigation bar at the bottom as well as the IME caption bar. If IME
receives navigation bar insets from the opposite side, IME might add
wrong paddings to the top, and then cause the layout unstable.
This CLs introduces a new field: InsetsSource#mSideHint. It is used to
decide which side of the relative frame should receive insets when the
frame fully covers the relative frame. It is based on the insets
provided to the containing bounds.
This CL also refactors the InternalInsetsSide:
- It is moved from InsetsState to InsetsSource because InsetsState is
like a container of InsetsSource, so InsetsState doesn't have to be
known by InsetsSource.
- The prefix "ISIDE_" are renamed to "SIDE_" by dropping the "I".
- ISIDE_FLOATING is renamed to SIDE_NONE to reflect the truth.
- Rearrange the value of each constant.
Fix: 306114031
Bug: 320325449
Test: InsetsStateTest SizeCompatTests WindowInsetsAnimationImeTests
Change-Id: I7210fc38b70742ca2e45810641ab44c62dc589c8
8 files changed