RK6.0 7.1 去掉launcher 长按和捏和 功能

长按和捏和的动作都会调出小部件和壁纸的功能,所以两者都要去掉

 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;
         }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

心有纤纤结

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值