Loading packages/SystemUI/src/com/android/systemui/ExpandHelper.java +39 −27 Original line number Diff line number Diff line Loading @@ -27,13 +27,12 @@ import android.util.Slog; import android.view.Gravity; import android.view.MotionEvent; import android.view.ScaleGestureDetector; import android.view.ScaleGestureDetector.OnScaleGestureListener; import android.view.View; import android.view.ViewConfiguration; import android.view.ViewGroup; import android.view.View.OnClickListener; import java.util.Stack; public class ExpandHelper implements Gefingerpoken, OnClickListener { public interface Callback { View getChildAtRawPosition(float x, float y); Loading Loading @@ -110,6 +109,32 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { private View mScrollView; private OnScaleGestureListener mScaleGestureListener = new ScaleGestureDetector.SimpleOnScaleGestureListener() { @Override public boolean onScaleBegin(ScaleGestureDetector detector) { if (DEBUG_SCALE) Slog.v(TAG, "onscalebegin()"); float focusX = detector.getFocusX(); float focusY = detector.getFocusY(); final View underFocus = findView(focusX, focusY); if (underFocus != null) { startExpanding(underFocus, STRETCH); } return mExpanding; } @Override public boolean onScale(ScaleGestureDetector detector) { if (DEBUG_SCALE) Slog.v(TAG, "onscale() on " + mCurrView); return true; } @Override public void onScaleEnd(ScaleGestureDetector detector) { } }; private class ViewScaler { View mView; Loading Loading @@ -201,31 +226,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { final ViewConfiguration configuration = ViewConfiguration.get(mContext); mTouchSlop = configuration.getScaledTouchSlop(); mSGD = new ScaleGestureDetector(context, new ScaleGestureDetector.SimpleOnScaleGestureListener() { @Override public boolean onScaleBegin(ScaleGestureDetector detector) { if (DEBUG_SCALE) Slog.v(TAG, "onscalebegin()"); float focusX = detector.getFocusX(); float focusY = detector.getFocusY(); final View underFocus = findView(focusX, focusY); if (underFocus != null) { startExpanding(underFocus, STRETCH); } return mExpanding; } @Override public boolean onScale(ScaleGestureDetector detector) { if (DEBUG_SCALE) Slog.v(TAG, "onscale() on " + mCurrView); return true; } @Override public void onScaleEnd(ScaleGestureDetector detector) { } }); mSGD = new ScaleGestureDetector(context, mScaleGestureListener); } private void updateExpansion() { Loading Loading @@ -586,6 +587,17 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { clearView(); } /** * Use this to abort any pending expansions in progress. */ public void cancel() { finishExpanding(true); clearView(); // reset the gesture detector mSGD = new ScaleGestureDetector(mContext, mScaleGestureListener); } /** * Triggers haptic feedback. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +1 −0 Original line number Diff line number Diff line Loading @@ -1373,6 +1373,7 @@ public class PhoneStatusBar extends BaseStatusBar { mHandler.sendEmptyMessage(MSG_CLOSE_SEARCH_PANEL); } mStatusBarWindow.cancelExpandHelper(); mStatusBarView.collapseAllPanels(true); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +4 −0 Original line number Diff line number Diff line Loading @@ -119,5 +119,9 @@ public class StatusBarWindowView extends FrameLayout canvas.drawRect(0, 0, canvas.getWidth(), canvas.getHeight(), pt); } } public void cancelExpandHelper() { mExpandHelper.cancel(); } } Loading
packages/SystemUI/src/com/android/systemui/ExpandHelper.java +39 −27 Original line number Diff line number Diff line Loading @@ -27,13 +27,12 @@ import android.util.Slog; import android.view.Gravity; import android.view.MotionEvent; import android.view.ScaleGestureDetector; import android.view.ScaleGestureDetector.OnScaleGestureListener; import android.view.View; import android.view.ViewConfiguration; import android.view.ViewGroup; import android.view.View.OnClickListener; import java.util.Stack; public class ExpandHelper implements Gefingerpoken, OnClickListener { public interface Callback { View getChildAtRawPosition(float x, float y); Loading Loading @@ -110,6 +109,32 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { private View mScrollView; private OnScaleGestureListener mScaleGestureListener = new ScaleGestureDetector.SimpleOnScaleGestureListener() { @Override public boolean onScaleBegin(ScaleGestureDetector detector) { if (DEBUG_SCALE) Slog.v(TAG, "onscalebegin()"); float focusX = detector.getFocusX(); float focusY = detector.getFocusY(); final View underFocus = findView(focusX, focusY); if (underFocus != null) { startExpanding(underFocus, STRETCH); } return mExpanding; } @Override public boolean onScale(ScaleGestureDetector detector) { if (DEBUG_SCALE) Slog.v(TAG, "onscale() on " + mCurrView); return true; } @Override public void onScaleEnd(ScaleGestureDetector detector) { } }; private class ViewScaler { View mView; Loading Loading @@ -201,31 +226,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { final ViewConfiguration configuration = ViewConfiguration.get(mContext); mTouchSlop = configuration.getScaledTouchSlop(); mSGD = new ScaleGestureDetector(context, new ScaleGestureDetector.SimpleOnScaleGestureListener() { @Override public boolean onScaleBegin(ScaleGestureDetector detector) { if (DEBUG_SCALE) Slog.v(TAG, "onscalebegin()"); float focusX = detector.getFocusX(); float focusY = detector.getFocusY(); final View underFocus = findView(focusX, focusY); if (underFocus != null) { startExpanding(underFocus, STRETCH); } return mExpanding; } @Override public boolean onScale(ScaleGestureDetector detector) { if (DEBUG_SCALE) Slog.v(TAG, "onscale() on " + mCurrView); return true; } @Override public void onScaleEnd(ScaleGestureDetector detector) { } }); mSGD = new ScaleGestureDetector(context, mScaleGestureListener); } private void updateExpansion() { Loading Loading @@ -586,6 +587,17 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { clearView(); } /** * Use this to abort any pending expansions in progress. */ public void cancel() { finishExpanding(true); clearView(); // reset the gesture detector mSGD = new ScaleGestureDetector(mContext, mScaleGestureListener); } /** * Triggers haptic feedback. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +1 −0 Original line number Diff line number Diff line Loading @@ -1373,6 +1373,7 @@ public class PhoneStatusBar extends BaseStatusBar { mHandler.sendEmptyMessage(MSG_CLOSE_SEARCH_PANEL); } mStatusBarWindow.cancelExpandHelper(); mStatusBarView.collapseAllPanels(true); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +4 −0 Original line number Diff line number Diff line Loading @@ -119,5 +119,9 @@ public class StatusBarWindowView extends FrameLayout canvas.drawRect(0, 0, canvas.getWidth(), canvas.getHeight(), pt); } } public void cancelExpandHelper() { mExpandHelper.cancel(); } }