aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-04-18 18:33:25 -0700
committerScott Jackson <daneren2005@gmail.com>2013-04-18 18:33:25 -0700
commitf875b73b57da0156714cde8a2a086821a803daef (patch)
treee72e94724f647aef9ba57833b00c4183eabcc408 /subsonic-android/src
parente6641440c4184316a69d4c7ed67080ecb8242f33 (diff)
downloaddsub-f875b73b57da0156714cde8a2a086821a803daef.tar.gz
dsub-f875b73b57da0156714cde8a2a086821a803daef.tar.bz2
dsub-f875b73b57da0156714cde8a2a086821a803daef.zip
Fix gestures on DownloadFragment
Diffstat (limited to 'subsonic-android/src')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java10
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java10
2 files changed, 15 insertions, 5 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java
index 81312aa6..a85fa139 100644
--- a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java
+++ b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java
@@ -20,6 +20,7 @@ package github.daneren2005.dsub.activity;
import github.daneren2005.dsub.R;
import android.os.Bundle;
+import android.view.MotionEvent;
import github.daneren2005.dsub.fragments.DownloadFragment;
public class DownloadActivity extends SubsonicActivity {
@@ -39,4 +40,13 @@ public class DownloadActivity extends SubsonicActivity {
getSupportFragmentManager().beginTransaction().add(R.id.download_container, fragment).commit();
}
}
+
+ @Override
+ public boolean onTouchEvent(MotionEvent me) {
+ if(fragment != null) {
+ return fragment.getGestureDetector().onTouchEvent(me);
+ } else {
+ return false;
+ }
+ }
}
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java
index 3a05b059..4e73a72b 100644
--- a/subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java
+++ b/subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java
@@ -1107,16 +1107,15 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
}
}
- /*@Override
- public boolean onTouchEvent(MotionEvent me) {
- return gestureScanner.onTouchEvent(me);
- }*/
-
@Override
public boolean onDown(MotionEvent me) {
setControlsVisible(true);
return false;
}
+
+ public GestureDetector getGestureDetector() {
+ return gestureScanner;
+ }
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
@@ -1124,6 +1123,7 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
if (downloadService == null) {
return false;
}
+ Log.d(TAG, "onFling");
// Right to Left swipe
if (e1.getX() - e2.getX() > swipeDistance && Math.abs(velocityX) > swipeVelocity) {