Skip to content

Commit e4cd3b0

Browse files
Jim MillerAndroid (Google) Code Review
authored andcommitted
Merge "Fix 6299832: Add search target swipe action to navigation bar on phones"
2 parents 97c03ca + e898ac5 commit e4cd3b0

32 files changed

+885
-33
lines changed

core/java/android/view/WindowManager.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,12 @@ public static class LayoutParams extends ViewGroup.LayoutParams
428428
*/
429429
public static final int TYPE_DREAM = FIRST_SYSTEM_WINDOW+23;
430430

431+
/**
432+
* Window type: Navigation bar panel (when navigation bar is distinct from status bar)
433+
* @hide
434+
*/
435+
public static final int TYPE_NAVIGATION_BAR_PANEL = FIRST_SYSTEM_WINDOW+24;
436+
431437
/**
432438
* End of types of system windows.
433439
*/

core/java/com/android/internal/widget/multiwaveview/MultiWaveView.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import android.content.res.TypedArray;
2828
import android.graphics.Canvas;
2929
import android.graphics.RectF;
30-
import android.graphics.drawable.Drawable;
3130
import android.os.Vibrator;
3231
import android.text.TextUtils;
3332
import android.util.AttributeSet;
@@ -142,6 +141,7 @@ public void onAnimationEnd(Animator animator) {
142141
private int mTargetResourceId;
143142
private int mTargetDescriptionsResourceId;
144143
private int mDirectionDescriptionsResourceId;
144+
private boolean mAlwaysTrackFinger;
145145

146146
public MultiWaveView(Context context) {
147147
this(context, null);
@@ -168,6 +168,7 @@ public MultiWaveView(Context context, AttributeSet attrs) {
168168
mTapRadius = mHandleDrawable.getWidth()/2;
169169
mOuterRing = new TargetDrawable(res,
170170
a.peekValue(R.styleable.MultiWaveView_waveDrawable).resourceId);
171+
mAlwaysTrackFinger = a.getBoolean(R.styleable.MultiWaveView_alwaysTrackFinger, false);
171172

172173
// Read chevron animation drawables
173174
final int chevrons[] = { R.styleable.MultiWaveView_leftChevronDrawable,
@@ -634,7 +635,6 @@ public void reset(boolean animate) {
634635
@Override
635636
public boolean onTouchEvent(MotionEvent event) {
636637
final int action = event.getAction();
637-
638638
boolean handled = false;
639639
switch (action) {
640640
case MotionEvent.ACTION_DOWN:
@@ -805,7 +805,7 @@ private boolean trySwitchToFirstTouchState(MotionEvent event) {
805805
final float y = event.getY();
806806
final float dx = x - mWaveCenterX;
807807
final float dy = y - mWaveCenterY;
808-
if (dist2(dx,dy) <= getScaledTapRadiusSquared()) {
808+
if (mAlwaysTrackFinger || dist2(dx,dy) <= getScaledTapRadiusSquared()) {
809809
if (DEBUG) Log.v(TAG, "** Handle HIT");
810810
switchToState(STATE_FIRST_TOUCH, x, y);
811811
moveHandleTo(x, y, false);
11.9 KB
Loading
21.7 KB
Loading
12 KB
Loading
6.89 KB
Loading
11.2 KB
Loading
6.37 KB
Loading
16.8 KB
Loading
30.9 KB
Loading

0 commit comments

Comments
 (0)