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

Commit 378d327a authored by Jim Miller's avatar Jim Miller Committed by The Android Automerger
Browse files

Fix 6398209: SearchPanel gesture improvements

This fixes a few recent regressions caused by other bug fixes:
- add new flags to animateCollapse() so we can selectively close panels. Fixes regression caused by attempt to close recent apps from startAssistActivity() which had the side effect of closing the search panel before the animation completes.
- adds tuneable holdoff delay for responding to home key press.
- minor tweaks to MultiWaveView animations.

Change-Id: Ia48434b8d59e7b0290a5e9783960c2f684068218
parent 0f738cd5
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -519,6 +519,10 @@ public class MultiWaveView extends View {
            // Inform listener of any active targets.  Typically only one will be active.
            deactivateHandle(RETURN_TO_HOME_DURATION, RETURN_TO_HOME_DELAY, 0.0f, mResetListener);
            dispatchTriggerEvent(activeTarget);
            if (!mAlwaysTrackFinger) {
                // Force ring and targets to finish animation to final expanded state
                mTargetAnimations.stop();
            }
        } else {
            // Animate handle back to the center based on current state.
            deactivateHandle(HIDE_ANIMATION_DURATION, HIDE_ANIMATION_DELAY, 1.0f,
@@ -542,7 +546,6 @@ public class MultiWaveView extends View {
                mTargetDrawables.get(i).setAlpha(0.0f);
            }
        }
        mOuterRing.setAlpha(0.0f);
    }

    private void hideTargets(boolean animate, boolean expanded) {
@@ -809,7 +812,6 @@ public class MultiWaveView extends View {
        switchToState(STATE_START, eventX, eventY);
        if (!trySwitchToFirstTouchState(eventX, eventY)) {
            mDragging = false;
            mTargetAnimations.cancel();
            ping();
        }
    }
+3 −0
Original line number Diff line number Diff line
@@ -57,6 +57,9 @@
    <!-- Show rotation lock button in phone-style notification panel. -->
    <bool name="config_showRotationLock">true</bool>

    <!-- Amount of time to hold off before showing the search panel when the user presses home -->
    <integer name="config_show_search_delay">200</integer>

    <!-- Vibration duration for MultiWaveView used in SearchPanelView -->
    <integer translatable="false" name="config_vibration_duration">20</integer>
</resources>
+6 −7
Original line number Diff line number Diff line
@@ -16,9 +16,7 @@

package com.android.systemui;

import android.animation.Animator;
import android.animation.LayoutTransition;
import android.app.ActivityManagerNative;
import android.app.ActivityOptions;
import android.app.SearchManager;
import android.content.ActivityNotFoundException;
@@ -40,6 +38,7 @@ import com.android.internal.widget.multiwaveview.MultiWaveView.OnTriggerListener
import com.android.systemui.R;
import com.android.systemui.recent.StatusBarTouchProxy;
import com.android.systemui.statusbar.BaseStatusBar;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.phone.PhoneStatusBar;
import com.android.systemui.statusbar.tablet.StatusBarPanel;
import com.android.systemui.statusbar.tablet.TabletStatusBar;
@@ -49,7 +48,7 @@ public class SearchPanelView extends FrameLayout implements
    private static final int SEARCH_PANEL_HOLD_DURATION = 500;
    static final String TAG = "SearchPanelView";
    static final boolean DEBUG = TabletStatusBar.DEBUG || PhoneStatusBar.DEBUG || false;
    private Context mContext;
    private final Context mContext;
    private BaseStatusBar mBar;
    private StatusBarTouchProxy mStatusBarTouchProxy;

@@ -106,7 +105,7 @@ public class SearchPanelView extends FrameLayout implements

    private void startAssistActivity() {
        // Close Recent Apps if needed
        mBar.animateCollapse();
        mBar.animateCollapse(CommandQueue.FLAG_EXCLUDE_SEARCH_PANEL);
        // Launch Assist
        Intent intent = getAssistIntent();
        try {
@@ -160,7 +159,7 @@ public class SearchPanelView extends FrameLayout implements
    protected void onFinishInflate() {
        super.onFinishInflate();
        mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        mSearchTargetsContainer = (ViewGroup) findViewById(R.id.search_panel_container);
        mSearchTargetsContainer = findViewById(R.id.search_panel_container);
        mStatusBarTouchProxy = (StatusBarTouchProxy) findViewById(R.id.status_bar_touch_proxy);
        // TODO: fetch views
        mMultiWaveView = (MultiWaveView) findViewById(R.id.multi_wave_view);
@@ -186,7 +185,7 @@ public class SearchPanelView extends FrameLayout implements
        }
    }

    private OnPreDrawListener mPreDrawListener = new ViewTreeObserver.OnPreDrawListener() {
    private final OnPreDrawListener mPreDrawListener = new ViewTreeObserver.OnPreDrawListener() {
        public boolean onPreDraw() {
            getViewTreeObserver().removeOnPreDrawListener(this);
            mMultiWaveView.resumeAnimations();
@@ -219,7 +218,7 @@ public class SearchPanelView extends FrameLayout implements
    public void hide(boolean animate) {
        if (mBar != null) {
            // This will indirectly cause show(false, ...) to get called
            mBar.animateCollapse();
            mBar.animateCollapse(CommandQueue.FLAG_EXCLUDE_NONE);
        } else {
            setVisibility(View.INVISIBLE);
        }
+3 −2
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ import android.widget.TextView;

import com.android.systemui.R;
import com.android.systemui.statusbar.BaseStatusBar;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.phone.PhoneStatusBar;
import com.android.systemui.statusbar.tablet.StatusBarPanel;
import com.android.systemui.statusbar.tablet.TabletStatusBar;
@@ -368,7 +369,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener
        }
        if (mBar != null) {
            // This will indirectly cause show(false, ...) to get called
            mBar.animateCollapse();
            mBar.animateCollapse(CommandQueue.FLAG_EXCLUDE_NONE);
        }
    }

@@ -822,7 +823,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener
                    if (viewHolder != null) {
                        final TaskDescription ad = viewHolder.taskDescription;
                        startApplicationDetailsActivity(ad.packageName);
                        mBar.animateCollapse();
                        mBar.animateCollapse(CommandQueue.FLAG_EXCLUDE_NONE);
                    } else {
                        throw new IllegalStateException("Oops, no tag on view " + selectedView);
                    }
+3 −3
Original line number Diff line number Diff line
@@ -268,7 +268,7 @@ public abstract class BaseStatusBar extends SystemUI implements
                    public boolean onMenuItemClick(MenuItem item) {
                        if (item.getItemId() == R.id.notification_inspect_item) {
                            startApplicationDetailsActivity(packageNameF);
                            animateCollapse();
                            animateCollapse(CommandQueue.FLAG_EXCLUDE_NONE);
                        } else {
                            return false;
                        }
@@ -618,7 +618,7 @@ public abstract class BaseStatusBar extends SystemUI implements
            }

            // close the shade if it was open
            animateCollapse();
            animateCollapse(CommandQueue.FLAG_EXCLUDE_NONE);
            visibilityChanged(false);

            // If this click was on the intruder alert, hide that instead
Loading