aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Mok <kmok@cyngn.com>2016-05-05 14:48:40 -0700
committerKeith Mok <kmok@cyngn.com>2016-05-05 14:48:40 -0700
commitfb5b91434a10910ce29395293f8430b0eb9a10c6 (patch)
treeb78f8033e519325ac82da5c06b28c108c9391f7d
parent7c7584cdcb9c4a7433359906b7ad20b9772df460 (diff)
downloadandroid_packages_apps_CMFileManager-fb5b91434a10910ce29395293f8430b0eb9a10c6.tar.gz
android_packages_apps_CMFileManager-fb5b91434a10910ce29395293f8430b0eb9a10c6.tar.bz2
android_packages_apps_CMFileManager-fb5b91434a10910ce29395293f8430b0eb9a10c6.zip
CMFileManager: Fix problem when "Use swipe gestures" on
When "Use swipe gestures" is on, click on listview item has no effects. Since ev.getX() or ev.getY() is returning floating point, while the previous touch location is stored as fixed point. When there is fractional parts in getX(), it will always return false when it compares to the previous touch point, making the flinger logic to think the touch does moved while it is actually not. FEIJ-290 Change-Id: Ib208b6115c0758facf29461ef45f6ffd5c67adce
-rwxr-xr-xsrc/com/cyanogenmod/filemanager/ui/widgets/FlingerListView.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/cyanogenmod/filemanager/ui/widgets/FlingerListView.java b/src/com/cyanogenmod/filemanager/ui/widgets/FlingerListView.java
index bdf20690..9a5ca528 100755
--- a/src/com/cyanogenmod/filemanager/ui/widgets/FlingerListView.java
+++ b/src/com/cyanogenmod/filemanager/ui/widgets/FlingerListView.java
@@ -375,7 +375,7 @@ public class FlingerListView extends ListView {
if (this.mFlingingView != null) {
// Only if event has changed (and only to the right and if not scrolling)
if (!this.mScrolling) {
- if (ev.getX() >= this.mStartX && (ev.getX() - this.mCurrentX != 0)) {
+ if ((int)ev.getX() >= this.mStartX && ((int)ev.getX() - this.mCurrentX != 0)) {
this.mCurrentX = (int)ev.getX();
this.mTranslationX = this.mCurrentX - this.mStartX;
this.mFlingingView.setTranslationX(this.mTranslationX);