Merge "Fix stalled gesture navigation tutorial." into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
405400c2fe
@@ -59,7 +59,7 @@ final class BackGestureTutorialController extends TutorialController {
|
||||
|
||||
@Override
|
||||
public void onBackGestureAttempted(BackGestureResult result) {
|
||||
if (mGestureCompleted) {
|
||||
if (isGestureCompleted()) {
|
||||
return;
|
||||
}
|
||||
switch (mTutorialType) {
|
||||
@@ -101,7 +101,7 @@ final class BackGestureTutorialController extends TutorialController {
|
||||
|
||||
@Override
|
||||
public void onNavBarGestureAttempted(NavBarGestureResult result, PointF finalVelocity) {
|
||||
if (mGestureCompleted) {
|
||||
if (isGestureCompleted()) {
|
||||
return;
|
||||
}
|
||||
if (mTutorialType == BACK_NAVIGATION_COMPLETE) {
|
||||
|
||||
@@ -48,7 +48,7 @@ final class HomeGestureTutorialController extends SwipeUpGestureTutorialControll
|
||||
|
||||
@Override
|
||||
public void onBackGestureAttempted(BackGestureResult result) {
|
||||
if (mGestureCompleted) {
|
||||
if (isGestureCompleted()) {
|
||||
return;
|
||||
}
|
||||
switch (mTutorialType) {
|
||||
@@ -73,7 +73,7 @@ final class HomeGestureTutorialController extends SwipeUpGestureTutorialControll
|
||||
|
||||
@Override
|
||||
public void onNavBarGestureAttempted(NavBarGestureResult result, PointF finalVelocity) {
|
||||
if (mGestureCompleted) {
|
||||
if (isGestureCompleted()) {
|
||||
return;
|
||||
}
|
||||
switch (mTutorialType) {
|
||||
|
||||
+2
-2
@@ -55,7 +55,7 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont
|
||||
|
||||
@Override
|
||||
public void onBackGestureAttempted(BackGestureResult result) {
|
||||
if (mGestureCompleted) {
|
||||
if (isGestureCompleted()) {
|
||||
return;
|
||||
}
|
||||
switch (mTutorialType) {
|
||||
@@ -80,7 +80,7 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont
|
||||
|
||||
@Override
|
||||
public void onNavBarGestureAttempted(NavBarGestureResult result, PointF finalVelocity) {
|
||||
if (mGestureCompleted) {
|
||||
if (isGestureCompleted()) {
|
||||
return;
|
||||
}
|
||||
switch (mTutorialType) {
|
||||
|
||||
+2
-2
@@ -214,7 +214,7 @@ abstract class SwipeUpGestureTutorialController extends TutorialController {
|
||||
|
||||
@Override
|
||||
public void setNavBarGestureProgress(@Nullable Float displacement) {
|
||||
if (mGestureCompleted) {
|
||||
if (isGestureCompleted()) {
|
||||
return;
|
||||
}
|
||||
if (mTutorialType == HOME_NAVIGATION_COMPLETE
|
||||
@@ -235,7 +235,7 @@ abstract class SwipeUpGestureTutorialController extends TutorialController {
|
||||
|
||||
@Override
|
||||
public void onMotionPaused(boolean unused) {
|
||||
if (mGestureCompleted) {
|
||||
if (isGestureCompleted()) {
|
||||
return;
|
||||
}
|
||||
if (mShowTasks) {
|
||||
|
||||
@@ -95,7 +95,7 @@ abstract class TutorialController implements BackGestureAttemptCallback,
|
||||
final ImageView mFingerDotView;
|
||||
private final AlertDialog mSkipTutorialDialog;
|
||||
|
||||
protected boolean mGestureCompleted = false;
|
||||
private boolean mGestureCompleted = false;
|
||||
|
||||
// These runnables should be used when posting callbacks to their views and cleared from their
|
||||
// views before posting new callbacks.
|
||||
@@ -286,6 +286,10 @@ abstract class TutorialController implements BackGestureAttemptCallback,
|
||||
mFeedbackView.post(mFeedbackViewCallback);
|
||||
}
|
||||
|
||||
public boolean isGestureCompleted() {
|
||||
return mGestureCompleted;
|
||||
}
|
||||
|
||||
void hideFeedback() {
|
||||
cancelQueuedGestureAnimation();
|
||||
mFeedbackView.clearAnimation();
|
||||
|
||||
@@ -237,7 +237,7 @@ abstract class TutorialFragment extends Fragment implements OnTouchListener {
|
||||
}
|
||||
|
||||
void releaseFeedbackAnimation() {
|
||||
if (mTutorialController != null) {
|
||||
if (mTutorialController != null && !mTutorialController.isGestureCompleted()) {
|
||||
mTutorialController.cancelQueuedGestureAnimation();
|
||||
}
|
||||
if (mGestureAnimation != null && mGestureAnimation.isRunning()) {
|
||||
|
||||
Reference in New Issue
Block a user