Make sure DividerFreeSnapMode work as expected

Fix crash if enable config_dockedStackDividerFreeSnapMode flag
and make sure its behavior work as expeceted.

Fix: 279026441
Test: set the flag to ture and manual test resize split.
Test: pass existing tests
Change-Id: Idf0a404af19aec7a2611b5d716080dd61108eaaa
This commit is contained in:
Tony Huang
2023-07-04 18:02:59 +08:00
parent 8e94c2816c
commit 0255707ef6
3 changed files with 6 additions and 5 deletions

View File

@@ -434,7 +434,7 @@ public class DividerView extends FrameLayout implements View.OnTouchListener {
"Set divider bar %s from %s", interactive ? "interactive" : "non-interactive",
from);
mInteractive = interactive;
if (!mInteractive && mMoving) {
if (!mInteractive && hideHandle && mMoving) {
final int position = mSplitLayout.getDividePosition();
mSplitLayout.flingDividePosition(
mLastDraggingPosition,

View File

@@ -323,7 +323,11 @@ public class SplitDecorManager extends WindowlessWindowManager {
}
}
if (mShown) {
fadeOutDecor(()-> animFinishedCallback.accept(true));
fadeOutDecor(()-> {
if (mRunningAnimationCount == 0 && animFinishedCallback != null) {
animFinishedCallback.accept(true);
}
});
} else {
// Decor surface is hidden so release it directly.
releaseDecor(t);

View File

@@ -593,9 +593,6 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
void flingDividePosition(int from, int to, int duration,
@Nullable Runnable flingFinishedCallback) {
if (from == to) {
// No animation run, still callback to stop resizing.
mSplitLayoutHandler.onLayoutSizeChanged(this);
if (flingFinishedCallback != null) {
flingFinishedCallback.run();
}