Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47ae0914 authored by Mateusz Cicheński's avatar Mateusz Cicheński Committed by Automerger Merge Worker
Browse files

Merge "Add system property to enable/disable fling to dismiss for PiP and...

Merge "Add system property to enable/disable fling to dismiss for PiP and Bubbles." into tm-qpr-dev am: 65fced03

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19608172



Change-Id: Ic7b922d801d6edbb3250cf5dd3dcbb3c3b351cba
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 9ed16537 65fced03
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -111,6 +111,9 @@ public class BubbleStackView extends FrameLayout
    public static final boolean HOME_GESTURE_ENABLED =
            SystemProperties.getBoolean("persist.wm.debug.bubbles_home_gesture", true);

    public static final boolean ENABLE_FLING_TO_DISMISS_BUBBLE =
            SystemProperties.getBoolean("persist.wm.debug.fling_to_dismiss_bubble", true);

    private static final String TAG = TAG_WITH_CLASS_NAME ? "BubbleStackView" : TAG_BUBBLES;

    /** How far the flyout needs to be dragged before it's dismissed regardless of velocity. */
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.wm.shell.bubbles.animation;
import static android.view.View.LAYOUT_DIRECTION_RTL;

import static com.android.wm.shell.bubbles.BubblePositioner.NUM_VISIBLE_WHEN_RESTING;
import static com.android.wm.shell.bubbles.BubbleStackView.ENABLE_FLING_TO_DISMISS_BUBBLE;
import static com.android.wm.shell.bubbles.BubbleStackView.HOME_GESTURE_ENABLED;

import android.content.res.Resources;
@@ -366,6 +367,7 @@ public class ExpandedAnimationController
        mMagnetizedBubbleDraggingOut.setMagnetListener(listener);
        mMagnetizedBubbleDraggingOut.setHapticsEnabled(true);
        mMagnetizedBubbleDraggingOut.setFlingToTargetMinVelocity(FLING_TO_DISMISS_MIN_VELOCITY);
        mMagnetizedBubbleDraggingOut.setFlingToTargetEnabled(ENABLE_FLING_TO_DISMISS_BUBBLE);
    }

    private void springBubbleTo(View bubble, float x, float y) {
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.wm.shell.bubbles.animation;

import static com.android.wm.shell.bubbles.BubblePositioner.NUM_VISIBLE_WHEN_RESTING;
import static com.android.wm.shell.bubbles.BubbleStackView.ENABLE_FLING_TO_DISMISS_BUBBLE;

import android.content.ContentResolver;
import android.content.res.Resources;
@@ -1028,6 +1029,7 @@ public class StackAnimationController extends
            };
            mMagnetizedStack.setHapticsEnabled(true);
            mMagnetizedStack.setFlingToTargetMinVelocity(FLING_TO_DISMISS_MIN_VELOCITY);
            mMagnetizedStack.setFlingToTargetEnabled(ENABLE_FLING_TO_DISMISS_BUBBLE);
        }

        final ContentResolver contentResolver = mLayout.getContext().getContentResolver();
+4 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.content.Context;
import android.graphics.PointF;
import android.graphics.Rect;
import android.os.Debug;
import android.os.SystemProperties;

import com.android.internal.protolog.common.ProtoLog;
import com.android.wm.shell.R;
@@ -58,6 +59,8 @@ import kotlin.jvm.functions.Function0;
public class PipMotionHelper implements PipAppOpsListener.Callback,
        FloatingContentCoordinator.FloatingContent {

    public static final boolean ENABLE_FLING_TO_DISMISS_PIP =
            SystemProperties.getBoolean("persist.wm.debug.fling_to_dismiss_pip", true);
    private static final String TAG = "PipMotionHelper";
    private static final boolean DEBUG = false;

@@ -704,6 +707,7 @@ public class PipMotionHelper implements PipAppOpsListener.Callback,
                    loc[1] = animatedPipBounds.top;
                }
            };
            mMagnetizedPip.setFlingToTargetEnabled(ENABLE_FLING_TO_DISMISS_PIP);
        }

        return mMagnetizedPip;