diff options
Diffstat (limited to 'src/com/android/launcher3/PagedView.java')
-rw-r--r-- | src/com/android/launcher3/PagedView.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index fb6a611e7..255677a53 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -50,6 +50,7 @@ import android.view.animation.Interpolator; import com.android.launcher3.anim.PropertyListBuilder; import com.android.launcher3.pageindicators.PageIndicator; import com.android.launcher3.util.LauncherEdgeEffect; +import com.android.launcher3.util.Themes; import com.android.launcher3.util.Thunk; import java.util.ArrayList; @@ -226,11 +227,10 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc mMinSnapVelocity = (int) (MIN_SNAP_VELOCITY * density); setOnHierarchyChangeListener(this); setWillNotDraw(false); - } - protected void setEdgeGlowColor(int color) { - mEdgeGlowLeft.setColor(color); - mEdgeGlowRight.setColor(color); + int edgeEffectColor = Themes.getAttrColor(getContext(), android.R.attr.colorEdgeEffect); + mEdgeGlowLeft.setColor(edgeEffectColor); + mEdgeGlowRight.setColor(edgeEffectColor); } protected void setDefaultInterpolator(Interpolator interpolator) { @@ -1599,7 +1599,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc mTotalMotionX += Math.abs(mLastMotionX + mLastMotionXRemainder - x); boolean isFling = mTotalMotionX > MIN_LENGTH_FOR_FLING && - Math.abs(velocityX) > mFlingThresholdVelocity; + shouldFlingForVelocity(velocityX); if (!mFreeScroll) { // In the case that the page is moved far to one direction and then is flung @@ -1705,6 +1705,10 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc return true; } + protected boolean shouldFlingForVelocity(int velocityX) { + return Math.abs(velocityX) > mFlingThresholdVelocity; + } + private void resetTouchState() { releaseVelocityTracker(); endReordering(); |