Merge "Cancel divider dragging if IME showing" into tm-qpr-dev am: 90f48266bb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20516286 Change-Id: I0d23a16651ed619ac98d8869c98418a789c624ff Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -76,6 +76,7 @@ public class DividerView extends FrameLayout implements View.OnTouchListener {
|
||||
private GestureDetector mDoubleTapDetector;
|
||||
private boolean mInteractive;
|
||||
private boolean mSetTouchRegion = true;
|
||||
private int mLastDraggingPosition;
|
||||
|
||||
/**
|
||||
* Tracks divider bar visible bounds in screen-based coordination. Used to calculate with
|
||||
@@ -298,6 +299,7 @@ public class DividerView extends FrameLayout implements View.OnTouchListener {
|
||||
}
|
||||
if (mMoving) {
|
||||
final int position = mSplitLayout.getDividePosition() + touchPos - mStartPos;
|
||||
mLastDraggingPosition = position;
|
||||
mSplitLayout.updateDivideBounds(position);
|
||||
}
|
||||
break;
|
||||
@@ -372,6 +374,15 @@ public class DividerView extends FrameLayout implements View.OnTouchListener {
|
||||
"Set divider bar %s from %s", interactive ? "interactive" : "non-interactive",
|
||||
from);
|
||||
mInteractive = interactive;
|
||||
if (!mInteractive && mMoving) {
|
||||
final int position = mSplitLayout.getDividePosition();
|
||||
mSplitLayout.flingDividePosition(
|
||||
mLastDraggingPosition,
|
||||
position,
|
||||
mSplitLayout.FLING_RESIZE_DURATION,
|
||||
() -> mSplitLayout.setDividePosition(position, true /* applyLayoutChange */));
|
||||
mMoving = false;
|
||||
}
|
||||
releaseTouching();
|
||||
mHandle.setVisibility(mInteractive ? View.VISIBLE : View.INVISIBLE);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
|
||||
public static final int PARALLAX_DISMISSING = 1;
|
||||
public static final int PARALLAX_ALIGN_CENTER = 2;
|
||||
|
||||
private static final int FLING_RESIZE_DURATION = 250;
|
||||
public static final int FLING_RESIZE_DURATION = 250;
|
||||
private static final int FLING_SWITCH_DURATION = 350;
|
||||
private static final int FLING_ENTER_DURATION = 450;
|
||||
private static final int FLING_EXIT_DURATION = 450;
|
||||
|
||||
Reference in New Issue
Block a user