Merge "Cancel divider dragging if IME showing" into tm-qpr-dev
This commit is contained in:
@@ -76,6 +76,7 @@ public class DividerView extends FrameLayout implements View.OnTouchListener {
|
|||||||
private GestureDetector mDoubleTapDetector;
|
private GestureDetector mDoubleTapDetector;
|
||||||
private boolean mInteractive;
|
private boolean mInteractive;
|
||||||
private boolean mSetTouchRegion = true;
|
private boolean mSetTouchRegion = true;
|
||||||
|
private int mLastDraggingPosition;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tracks divider bar visible bounds in screen-based coordination. Used to calculate with
|
* 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) {
|
if (mMoving) {
|
||||||
final int position = mSplitLayout.getDividePosition() + touchPos - mStartPos;
|
final int position = mSplitLayout.getDividePosition() + touchPos - mStartPos;
|
||||||
|
mLastDraggingPosition = position;
|
||||||
mSplitLayout.updateDivideBounds(position);
|
mSplitLayout.updateDivideBounds(position);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -372,6 +374,15 @@ public class DividerView extends FrameLayout implements View.OnTouchListener {
|
|||||||
"Set divider bar %s from %s", interactive ? "interactive" : "non-interactive",
|
"Set divider bar %s from %s", interactive ? "interactive" : "non-interactive",
|
||||||
from);
|
from);
|
||||||
mInteractive = interactive;
|
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();
|
releaseTouching();
|
||||||
mHandle.setVisibility(mInteractive ? View.VISIBLE : View.INVISIBLE);
|
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_DISMISSING = 1;
|
||||||
public static final int PARALLAX_ALIGN_CENTER = 2;
|
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_SWITCH_DURATION = 350;
|
||||||
private static final int FLING_ENTER_DURATION = 450;
|
private static final int FLING_ENTER_DURATION = 450;
|
||||||
private static final int FLING_EXIT_DURATION = 450;
|
private static final int FLING_EXIT_DURATION = 450;
|
||||||
|
|||||||
Reference in New Issue
Block a user