Merge "Merge "Add setTriggerBack interface to BackCallback." into tm-qpr-dev am: baa507a5f8" into tm-qpr-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
281e7f69c4
@@ -61,5 +61,13 @@ public interface NavigationEdgeBackPlugin extends Plugin {
|
|||||||
|
|
||||||
/** Indicates that the gesture was cancelled and the system should not go back. */
|
/** Indicates that the gesture was cancelled and the system should not go back. */
|
||||||
void cancelBack();
|
void cancelBack();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if back will be triggered if committed in current state.
|
||||||
|
*
|
||||||
|
* @param triggerBack if back will be triggered in current state.
|
||||||
|
*/
|
||||||
|
// TODO(b/247883311): Remove default impl once SwipeBackGestureHandler overrides this.
|
||||||
|
default void setTriggerBack(boolean triggerBack) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -303,6 +303,13 @@ public class EdgeBackGestureHandler extends CurrentUserTracker
|
|||||||
mOverviewProxyService.notifyBackAction(false, (int) mDownPoint.x,
|
mOverviewProxyService.notifyBackAction(false, (int) mDownPoint.x,
|
||||||
(int) mDownPoint.y, false /* isButton */, !mIsOnLeftEdge);
|
(int) mDownPoint.y, false /* isButton */, !mIsOnLeftEdge);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setTriggerBack(boolean triggerBack) {
|
||||||
|
if (mBackAnimation != null) {
|
||||||
|
mBackAnimation.setTriggerBack(triggerBack);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private final SysUiState.SysUiStateCallback mSysUiStateCallback =
|
private final SysUiState.SysUiStateCallback mSysUiStateCallback =
|
||||||
|
|||||||
@@ -880,6 +880,7 @@ public class NavigationBarEdgePanel extends View implements NavigationEdgeBackPl
|
|||||||
// Whenever the trigger back state changes the existing translation animation should be
|
// Whenever the trigger back state changes the existing translation animation should be
|
||||||
// cancelled
|
// cancelled
|
||||||
mTranslationAnimation.cancel();
|
mTranslationAnimation.cancel();
|
||||||
|
mBackCallback.setTriggerBack(mTriggerBack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user