diff options
author | Riddle Hsu <riddlehsu@google.com> | 2020-01-30 00:51:14 +0800 |
---|---|---|
committer | Riddle Hsu <riddlehsu@google.com> | 2020-01-29 17:01:25 +0000 |
commit | 7d5780c351dd110980eccb59f8fb9b7511226402 (patch) | |
tree | 38ac7159e2fcdacad418963f46957e8946ec0aa9 /tools/aapt2/java/JavaClassGenerator_test.cpp | |
parent | bbc9afbca70b97d5741b314c1f0f1c01862d7bda (diff) |
Fix no-op traversal requested in traversal before layout
Commit f64e134 (2652da8) eliminates the unconditional resize from
the first layout. But IME window may rely on the additional resize
to trigger the 3rd layout pass to compute its final size, otherwise
the height of navigation bar isn’t accounted for IME window.
The layout steps of initializing IME window:
a. Add root view (ViewRootImpl setView -> requestLayout).
b. Layout pass 1: apply window insets (WindowInsetsListener of
InputMethodService ~ DecorView#updateColorViews
-> addView (navigation bar background) -> requestLayout).
c. Layout pass 2: almost no-op because pass 1 cleared
ViewRootImpl#mLayoutRequested (performLayout is called
after dispatchApplyInsets).
So if pass 2 performs measure and layout correctly, the 3rd layout
pass is not needed. As the comment of the first place that clears
mLayoutRequested (in ViewRootImpl#performTraversals), the layout
request during traversal should be caught for performing next full
layout pass.
Fix: 147857963
Test: atest OnScreenPositionTest#testImeIsNotBehindNavBar
Change-Id: Ib9c116fb81cd41c2df30ab81c0f0594c489cebf9
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions