Fix showing black background when resizing the divider bar.

Reports resizing state to WM core so that app client could apply bigger
visible bounds while resizing splits. Also moves DividerHandleView to
more generic package.

Fix: 172704238
Test: manul check divider behavior
Test: atest WMShellUnitTests
Change-Id: I1656c86de9a0b5dfe5e6da57ccc9d5f6e467843a
This commit is contained in:
Jerry Chang
2020-12-04 16:11:15 +08:00
parent 519fb38710
commit 2c8ea7b021
10 changed files with 116 additions and 58 deletions

View File

@@ -75,15 +75,16 @@ public class SplitLayoutTests extends ShellTestCase {
}
@Test
@UiThreadTest
public void testSnapToTarget() {
DividerSnapAlgorithm.SnapTarget snapTarget = getSnapTarget(0 /* position */,
DividerSnapAlgorithm.SnapTarget.FLAG_NONE);
mSplitLayout.snapToTarget(0 /* currentPosition */, snapTarget);
verify(mLayoutChangeListener).onBoundsChanging(any(SplitLayout.class));
public void testSetDividePosition() {
mSplitLayout.setDividePosition(anyInt());
verify(mLayoutChangeListener).onBoundsChanged(any(SplitLayout.class));
}
@Test
@UiThreadTest
public void testSnapToDismissTarget() {
// verify it callbacks properly when the snap target indicates dismissing split.
snapTarget = getSnapTarget(0 /* position */,
DividerSnapAlgorithm.SnapTarget snapTarget = getSnapTarget(0 /* position */,
DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_START);
mSplitLayout.snapToTarget(0 /* currentPosition */, snapTarget);
verify(mLayoutChangeListener).onSnappedToDismiss(eq(false));