长按和捏和的动作都会调出小部件和壁纸的功能,所以两者都要去掉
7.1 版本:
packages/apps/Launcher3/src/com/android/launcher3/Launcher.java
* Shows the overview button.
*/
public void showOverviewMode(boolean animated) {
+ //showOverviewMode(animated, false);//这里是去掉长按longpress的动作,屏蔽掉动画就可以
- showOverviewMode(animated, false);//
}
下面的是去掉捏和的动作
packages/apps/Launcher3/src/com/android/launcher3/PinchAnimationManager.java
public void setAnimationProgress(float interpolatedProgress) {
float interpolatedScale = interpolatedProgress * (1f - mOverviewScale) + mOverviewScale;
float interpolatedTranslationY = (1f - interpolatedProgress) * mOverviewTranslationY;
- mWorkspace.setScaleX(interpolatedScale);
+ //modify by for 20180613 begin
+ /*mWorkspace.setScaleX(interpolatedScale);
mWorkspace.setScaleY(interpolatedScale);
mWorkspace.setTranslationY(interpolatedTranslationY);
- setOverviewPanelsAlpha(1f - interpolatedProgress, 0);
+ setOverviewPanelsAlpha(1f - interpolatedProgress, 0);*/
+ //modify by for 20180613 end
}
/**
@@ -145,7 +147,8 @@ public class PinchAnimationManager {
*/
public void animateThreshold(float threshold, Workspace.State startState,
Workspace.State goingTowards) {
- if (threshold == PinchThresholdManager.THRESHOLD_ONE) {
+ //modify by for 20180613 begin
+ /*if (threshold == PinchThresholdManager.THRESHOLD_ONE) {
if (startState == OVERVIEW) {
animateOverviewPanelButtons(goingTowards == OVERVIEW);
} else if (startState == NORMAL) {
@@ -169,7 +172,8 @@ public class PinchAnimationManager {
}
} else {
Log.e(TAG, "Received unknown threshold to animate: " + threshold);
- }
+ }*/
+ //modify by for 20180613 end
}
6.0版本:
packages/apps/Launcher3/src/com/android/launcher3/Launcher.java
if (!mWorkspace.isInOverviewMode()) {
if (!mWorkspace.isTouchActive()) {
showOverviewMode(true);
- mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
- HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
+ //mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
+ // HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
return true;
} else {
return false;
@@ -3164,8 +3164,8 @@ public class Launcher extends Activity
if (!mDragController.isDragging()) {
if (itemUnderLongClick == null) {
// User long pressed on empty space
- mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
- HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
+ //mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
+ // HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
if (mWorkspace.isInOverviewMode()) {
mWorkspace.startReordering(v);
} else {
@@ -3301,12 +3301,12 @@ public class Launcher extends Activity
}
void showOverviewMode(boolean animated) {
- mWorkspace.setVisibility(View.VISIBLE);
- mStateTransitionAnimation.startAnimationToWorkspace(mState, mWorkspace.getState(),
- Workspace.State.OVERVIEW,
- WorkspaceStateTransitionAnimation.SCROLL_TO_CURRENT_PAGE, animated,
- null /* onCompleteRunnable */);
- mState = State.WORKSPACE;
+ //mWorkspace.setVisibility(View.VISIBLE);
+ //mStateTransitionAnimation.startAnimationToWorkspace(mState, mWorkspace.getState(),
+ // Workspace.State.OVERVIEW,
+ // WorkspaceStateTransitionAnimation.SCROLL_TO_CURRENT_PAGE, animated,
+ // null /* onCompleteRunnable */);
+ //mState = State.WORKSPACE;
}