diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-04-18 18:33:25 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-04-18 18:33:25 -0700 |
commit | f875b73b57da0156714cde8a2a086821a803daef (patch) | |
tree | e72e94724f647aef9ba57833b00c4183eabcc408 /subsonic-android/src | |
parent | e6641440c4184316a69d4c7ed67080ecb8242f33 (diff) | |
download | dsub-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.java | 10 | ||||
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java | 10 |
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) {
|