am 5191861c: Merge "Increasing the min swipe thresholds for the nav bar gestures. (Bug 17109581)" into lmp-mr1-dev
* commit '5191861c8896bf4ceaca2dc210423a7f86924644': Increasing the min swipe thresholds for the nav bar gestures. (Bug 17109581)
This commit is contained in:
@@ -63,6 +63,8 @@
|
|||||||
|
|
||||||
<!-- thickness (height) of the navigation bar on phones that require it -->
|
<!-- thickness (height) of the navigation bar on phones that require it -->
|
||||||
<dimen name="navigation_bar_size">@*android:dimen/navigation_bar_height</dimen>
|
<dimen name="navigation_bar_size">@*android:dimen/navigation_bar_height</dimen>
|
||||||
|
<!-- Minimum swipe distance to catch the swipe gestures to invoke assist or switch tasks. -->
|
||||||
|
<dimen name="navigation_bar_min_swipe_distance">48dp</dimen>
|
||||||
|
|
||||||
<!-- thickness (height) of the dead zone at the top of the navigation bar,
|
<!-- thickness (height) of the dead zone at the top of the navigation bar,
|
||||||
reducing false presses on navbar buttons; approx 2mm -->
|
reducing false presses on navbar buttons; approx 2mm -->
|
||||||
|
|||||||
@@ -17,10 +17,11 @@
|
|||||||
package com.android.systemui.statusbar;
|
package com.android.systemui.statusbar;
|
||||||
|
|
||||||
import android.app.StatusBarManager;
|
import android.app.StatusBarManager;
|
||||||
|
import android.content.res.Resources;
|
||||||
import android.graphics.RectF;
|
import android.graphics.RectF;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewConfiguration;
|
import com.android.systemui.R;
|
||||||
|
|
||||||
public class DelegateViewHelper {
|
public class DelegateViewHelper {
|
||||||
private View mDelegateView;
|
private View mDelegateView;
|
||||||
@@ -106,8 +107,8 @@ public class DelegateViewHelper {
|
|||||||
public void setSourceView(View view) {
|
public void setSourceView(View view) {
|
||||||
mSourceView = view;
|
mSourceView = view;
|
||||||
if (mSourceView != null) {
|
if (mSourceView != null) {
|
||||||
mTriggerThreshhold =
|
Resources r = mSourceView.getContext().getResources();
|
||||||
ViewConfiguration.get(mSourceView.getContext()).getScaledPagingTouchSlop();
|
mTriggerThreshhold = r.getDimensionPixelSize(R.dimen.navigation_bar_min_swipe_distance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,11 @@
|
|||||||
package com.android.systemui.statusbar.phone;
|
package com.android.systemui.statusbar.phone;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.res.Resources;
|
||||||
import android.view.GestureDetector;
|
import android.view.GestureDetector;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.ViewConfiguration;
|
import android.view.ViewConfiguration;
|
||||||
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.statusbar.BaseStatusBar;
|
import com.android.systemui.statusbar.BaseStatusBar;
|
||||||
|
|
||||||
public class NavigationBarViewTaskSwitchHelper extends GestureDetector.SimpleOnGestureListener {
|
public class NavigationBarViewTaskSwitchHelper extends GestureDetector.SimpleOnGestureListener {
|
||||||
@@ -36,7 +38,8 @@ public class NavigationBarViewTaskSwitchHelper extends GestureDetector.SimpleOnG
|
|||||||
|
|
||||||
public NavigationBarViewTaskSwitchHelper(Context context) {
|
public NavigationBarViewTaskSwitchHelper(Context context) {
|
||||||
ViewConfiguration configuration = ViewConfiguration.get(context);
|
ViewConfiguration configuration = ViewConfiguration.get(context);
|
||||||
mScrollTouchSlop = 4 * configuration.getScaledTouchSlop();
|
Resources r = context.getResources();
|
||||||
|
mScrollTouchSlop = r.getDimensionPixelSize(R.dimen.navigation_bar_min_swipe_distance);
|
||||||
mMinFlingVelocity = configuration.getScaledMinimumFlingVelocity();
|
mMinFlingVelocity = configuration.getScaledMinimumFlingVelocity();
|
||||||
mTaskSwitcherDetector = new GestureDetector(context, this);
|
mTaskSwitcherDetector = new GestureDetector(context, this);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user