Merge "Fixing state not set properly when configuration changes and remote animation callback comes after threshold is crossed" into ub-launcher3-master
This commit is contained in:
commit
30dfe8add3
|
@ -540,7 +540,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {
|
||||||
public void updateDisplacement(float displacement) {
|
public void updateDisplacement(float displacement) {
|
||||||
// We are moving in the negative x/y direction
|
// We are moving in the negative x/y direction
|
||||||
displacement = -displacement;
|
displacement = -displacement;
|
||||||
if (displacement > mTransitionDragLength) {
|
if (displacement > mTransitionDragLength && mTransitionDragLength > 0) {
|
||||||
mCurrentShift.updateValue(1);
|
mCurrentShift.updateValue(1);
|
||||||
|
|
||||||
if (!mBgLongSwipeMode) {
|
if (!mBgLongSwipeMode) {
|
||||||
|
@ -815,8 +815,12 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {
|
||||||
long startMillis = SystemClock.uptimeMillis();
|
long startMillis = SystemClock.uptimeMillis();
|
||||||
executeOnUiThread(() -> {
|
executeOnUiThread(() -> {
|
||||||
// Animate the launcher components at the same time as the window, always on UI thread.
|
// Animate the launcher components at the same time as the window, always on UI thread.
|
||||||
if (mLauncherTransitionController != null && !mWasLauncherAlreadyVisible
|
if (mLauncherTransitionController == null) {
|
||||||
&& start != end && duration > 0) {
|
return;
|
||||||
|
}
|
||||||
|
if (start == end || duration <= 0) {
|
||||||
|
mLauncherTransitionController.getAnimationPlayer().end();
|
||||||
|
} else {
|
||||||
// Adjust start progress and duration in case we are on a different thread.
|
// Adjust start progress and duration in case we are on a different thread.
|
||||||
long elapsedMillis = SystemClock.uptimeMillis() - startMillis;
|
long elapsedMillis = SystemClock.uptimeMillis() - startMillis;
|
||||||
elapsedMillis = Utilities.boundToRange(elapsedMillis, 0, duration);
|
elapsedMillis = Utilities.boundToRange(elapsedMillis, 0, duration);
|
||||||
|
|
Loading…
Reference in New Issue