RK6.0 7.1 去掉launcher 長按和捏和 功能
阿新 • • 發佈:2018-12-14
長按和捏和的動作都會調出小部件和桌布的功能,所以兩者都要去掉
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; }