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

Commit 87cbf34f authored by Matthew Ng's avatar Matthew Ng
Browse files

Fixes quickstep gestures when screen in pinned.

Intercept the gesture calls when screen is currently being pinned.
Screen pinning dialog will take the current icons from nav bar.

Change-Id: I49a79a857311253ecc4eb103bc1dd5a618d71bc0
Fixes: 73361404
Test: pin an app and try to swipe up or use quick scrub
parent 961b465a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@
            android:src="@drawable/screen_pinning_bg_circ" />

        <ImageView
            android:id="@+id/screen_pinning_back_icon"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:paddingEnd="@dimen/screen_pinning_request_nav_side_padding"
@@ -105,6 +106,7 @@
            android:src="@drawable/screen_pinning_bg_circ" />

        <ImageView
            android:id="@+id/screen_pinning_home_icon"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:paddingEnd="@dimen/screen_pinning_request_nav_side_padding"
+2 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@
            android:src="@drawable/screen_pinning_bg_circ" />

        <ImageView
            android:id="@+id/screen_pinning_back_icon"
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:scaleType="center"
@@ -99,6 +100,7 @@
            android:src="@drawable/screen_pinning_bg_circ" />

        <ImageView
            android:id="@+id/screen_pinning_home_icon"
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:scaleType="center"
+2 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@
            android:src="@drawable/screen_pinning_bg_circ" />

        <ImageView
            android:id="@+id/screen_pinning_back_icon"
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:scaleType="center"
@@ -103,6 +104,7 @@
            android:src="@drawable/screen_pinning_bg_circ" />

        <ImageView
            android:id="@+id/screen_pinning_home_icon"
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:scaleType="center"
+6 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import android.view.accessibility.AccessibilityManager;
import android.view.animation.DecelerateInterpolator;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

@@ -255,6 +256,11 @@ public class ScreenPinningRequest implements View.OnClickListener {
                        : R.string.screen_pinning_description_recents_invisible;
            }

            ((ImageView) mLayout.findViewById(R.id.screen_pinning_back_icon))
                    .setImageDrawable(navigationBarView.getBackDrawable(mContext));
            ((ImageView) mLayout.findViewById(R.id.screen_pinning_home_icon))
                    .setImageDrawable(navigationBarView.getHomeDrawable(mContext));

            ((TextView) mLayout.findViewById(R.id.screen_pinning_description))
                    .setText(descriptionStringResId);
            final int backBgVisibility = touchExplorationEnabled ? View.INVISIBLE : View.VISIBLE;
+8 −0
Original line number Diff line number Diff line
@@ -149,6 +149,10 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture
    }

    public boolean onInterceptTouchEvent(MotionEvent event) {
        if (mNavigationBarView.inScreenPinning()) {
            return false;
        }

        int action = event.getActionMasked();
        switch (action) {
            case MotionEvent.ACTION_DOWN: {
@@ -177,6 +181,10 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture
    }

    public boolean onTouchEvent(MotionEvent event) {
        if (mNavigationBarView.inScreenPinning()) {
            return false;
        }

        // The same down event was just sent on intercept and therefore can be ignored here
        boolean ignoreProxyDownEvent = event.getAction() == MotionEvent.ACTION_DOWN
                && mOverviewProxyService.getProxy() != null;
Loading