зеркало из https://github.com/mozilla/gecko-dev.git
Bug 716673 - Collapse unused WAITING_TO_SNAP and SNAPPING flingstates into STOPPED. r=pcwalton
This commit is contained in:
Родитель
45e0c4fb28
Коммит
cb0894c39b
|
@ -464,7 +464,6 @@ public class PanZoomController
|
||||||
}
|
}
|
||||||
|
|
||||||
mState = PanZoomState.FLING;
|
mState = PanZoomState.FLING;
|
||||||
mX.setFlingState(Axis.FlingStates.SNAPPING); mY.setFlingState(Axis.FlingStates.SNAPPING);
|
|
||||||
Log.d(LOGTAG, "end bounce at " + metrics);
|
Log.d(LOGTAG, "end bounce at " + metrics);
|
||||||
|
|
||||||
startAnimationTimer(new BounceRunnable(bounceStartMetrics, metrics));
|
startAnimationTimer(new BounceRunnable(bounceStartMetrics, metrics));
|
||||||
|
@ -690,8 +689,6 @@ public class PanZoomController
|
||||||
STOPPED,
|
STOPPED,
|
||||||
PANNING,
|
PANNING,
|
||||||
FLINGING,
|
FLINGING,
|
||||||
WAITING_TO_SNAP,
|
|
||||||
SNAPPING,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum Overscroll {
|
public enum Overscroll {
|
||||||
|
@ -716,10 +713,7 @@ public class PanZoomController
|
||||||
|
|
||||||
public float displacement;
|
public float displacement;
|
||||||
|
|
||||||
private int mSnapFrame;
|
public Axis() {}
|
||||||
private float mSnapPos, mSnapEndPos;
|
|
||||||
|
|
||||||
public Axis() { mSnapFrame = -1; }
|
|
||||||
|
|
||||||
public FlingStates getFlingState() { return mFlingState; }
|
public FlingStates getFlingState() { return mFlingState; }
|
||||||
|
|
||||||
|
@ -808,15 +802,11 @@ public class PanZoomController
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startFling(boolean stopped) {
|
public void startFling(boolean stopped) {
|
||||||
if (!stopped) {
|
if (stopped) {
|
||||||
setFlingState(FlingStates.FLINGING);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (disableSnap || FloatUtils.fuzzyEquals(getExcess(), 0.0f))
|
|
||||||
setFlingState(FlingStates.STOPPED);
|
setFlingState(FlingStates.STOPPED);
|
||||||
else
|
} else {
|
||||||
setFlingState(FlingStates.WAITING_TO_SNAP);
|
setFlingState(FlingStates.FLINGING);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Advances a fling animation by one step. */
|
/* Advances a fling animation by one step. */
|
||||||
|
@ -847,7 +837,7 @@ public class PanZoomController
|
||||||
|
|
||||||
if (Math.abs(velocity) < 0.3f) {
|
if (Math.abs(velocity) < 0.3f) {
|
||||||
velocity = 0.0f;
|
velocity = 0.0f;
|
||||||
setFlingState(FlingStates.WAITING_TO_SNAP);
|
setFlingState(FlingStates.STOPPED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче