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

Commit 5369d7a9 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Fix swipe up affordance bugs" into lmp-dev

parents 31e0ae0c 118aecea
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -115,9 +115,6 @@
    <!-- Diameter of outer shape drawable shown in navbar search. Should be 1/2 of above value -->
    <dimen name="navbar_search_outerring_radius">170dp</dimen>

    <!-- Threshold for swipe-up gesture to activate search dialog -->
    <dimen name="navbar_search_up_threshhold">40dip</dimen>

    <!-- Height of search panel including navigation bar height -->
    <dimen name="navbar_search_panel_height">230dip</dimen>

@@ -420,7 +417,7 @@
    <dimen name="search_card_peek_height">100dp</dimen>

    <!-- How far the user needs to drag up to invoke search. -->
    <dimen name="search_panel_threshold">150dp</dimen>
    <dimen name="search_panel_threshold">100dp</dimen>

    <!-- The width/height of the phone/camera/unlock icon on keyguard. -->
    <dimen name="keyguard_affordance_height">56dp</dimen>
+1 −3
Original line number Diff line number Diff line
@@ -1323,10 +1323,8 @@ public class KeyguardViewMediator extends SystemUI {
                // (like recents). Temporary enable/disable (e.g. the "back" button) are
                // done in KeyguardHostView.
                flags |= StatusBarManager.DISABLE_RECENT;
                if (!isAssistantAvailable()) {
                flags |= StatusBarManager.DISABLE_SEARCH;
            }
            }
            if (isShowingAndNotOccluded()) {
                flags |= StatusBarManager.DISABLE_HOME;
            }
+3 −10
Original line number Diff line number Diff line
@@ -114,7 +114,6 @@ public abstract class BaseStatusBar extends SystemUI implements
    protected static final int MSG_CANCEL_PRELOAD_RECENT_APPS = 1023;
    protected static final int MSG_SHOW_NEXT_AFFILIATED_TASK = 1024;
    protected static final int MSG_SHOW_PREV_AFFILIATED_TASK = 1025;
    protected static final int MSG_OPEN_SEARCH_PANEL = 1026;
    protected static final int MSG_CLOSE_SEARCH_PANEL = 1027;
    protected static final int MSG_SHOW_HEADS_UP = 1028;
    protected static final int MSG_HIDE_HEADS_UP = 1029;
@@ -751,9 +750,9 @@ public abstract class BaseStatusBar extends SystemUI implements

    @Override
    public void showSearchPanel() {
        int msg = MSG_OPEN_SEARCH_PANEL;
        mHandler.removeMessages(msg);
        mHandler.sendEmptyMessage(msg);
        if (mSearchPanelView != null && mSearchPanelView.isAssistantAvailable()) {
            mSearchPanelView.show(true, true);
        }
    }

    @Override
@@ -966,12 +965,6 @@ public abstract class BaseStatusBar extends SystemUI implements
             case MSG_SHOW_PREV_AFFILIATED_TASK:
                  showRecentsPreviousAffiliatedTask();
                  break;
             case MSG_OPEN_SEARCH_PANEL:
                 if (DEBUG) Log.d(TAG, "opening search panel");
                 if (mSearchPanelView != null && mSearchPanelView.isAssistantAvailable()) {
                     mSearchPanelView.show(true, true);
                 }
                 break;
             case MSG_CLOSE_SEARCH_PANEL:
                 if (DEBUG) Log.d(TAG, "closing search panel");
                 if (mSearchPanelView != null && mSearchPanelView.isShowing()) {
+3 −4
Original line number Diff line number Diff line
@@ -20,8 +20,7 @@ import android.app.StatusBarManager;
import android.graphics.RectF;
import android.view.MotionEvent;
import android.view.View;

import com.android.systemui.R;
import android.view.ViewConfiguration;

public class DelegateViewHelper {
    private View mDelegateView;
@@ -107,8 +106,8 @@ public class DelegateViewHelper {
    public void setSourceView(View view) {
        mSourceView = view;
        if (mSourceView != null) {
            mTriggerThreshhold = mSourceView.getContext().getResources()
                    .getDimension(R.dimen.navbar_search_up_threshhold);
            mTriggerThreshhold =
                    ViewConfiguration.get(mSourceView.getContext()).getScaledPagingTouchSlop();
        }
    }

+9 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ public class NavigationBarViewTaskSwitchHelper extends GestureDetector.SimpleOnG
    private final int mMinFlingVelocity;
    private boolean mInterceptTouches;
    private int mTouchDownX;
    private int mTouchDownY;

    public NavigationBarViewTaskSwitchHelper(Context context) {
        ViewConfiguration configuration = ViewConfiguration.get(context);
@@ -58,12 +59,19 @@ public class NavigationBarViewTaskSwitchHelper extends GestureDetector.SimpleOnG
        switch (action & MotionEvent.ACTION_MASK) {
            case MotionEvent.ACTION_DOWN: {
                mTouchDownX = (int) event.getX();
                mTouchDownY = (int) event.getY();
                mInterceptTouches = false;
                break;
            }
            case MotionEvent.ACTION_MOVE: {
                int x = (int) event.getX();
                if (Math.abs(x - mTouchDownX) > mScrollTouchSlop) {
                int y = (int) event.getY();
                int xDiff = Math.abs(x - mTouchDownX);
                int yDiff = Math.abs(y - mTouchDownY);
                boolean exceededTouchSlop = !mIsVertical
                        ? xDiff > mScrollTouchSlop && xDiff > yDiff
                        : yDiff > mScrollTouchSlop && yDiff > xDiff;
                if (exceededTouchSlop) {
                    mInterceptTouches = true;
                    return true;
                }