diff options
author | daneren2005 <daneren2005@gmail.com> | 2013-11-05 14:07:58 -0800 |
---|---|---|
committer | daneren2005 <daneren2005@gmail.com> | 2013-11-05 14:07:58 -0800 |
commit | 1f6fda047412a78f5bd7ae51978cfc7d8c315e1e (patch) | |
tree | d78c1f7f8cbf0018645098e186adc8fdbd2514c2 | |
parent | 9d74a08da5250744ede0492b66dcdcf6d9e687b6 (diff) | |
download | dsub-1f6fda047412a78f5bd7ae51978cfc7d8c315e1e.tar.gz dsub-1f6fda047412a78f5bd7ae51978cfc7d8c315e1e.tar.bz2 dsub-1f6fda047412a78f5bd7ae51978cfc7d8c315e1e.zip |
Attempt to fix crash using drawer in DownloadActivity
-rw-r--r-- | src/github/daneren2005/dsub/activity/SubsonicActivity.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java index b99055de..68f398bc 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -70,6 +70,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte protected static String theme;
private String[] drawerItemsDescriptions;
private String[] drawerItems;
+ private boolean drawerIdle = true;
private boolean[] enabledItems = {true, true};
private boolean destroyed = false;
private boolean finished = false;
@@ -182,6 +183,8 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte @Override
public void onDrawerClosed(View view) {
setTitle(currentFragment.getTitle());
+
+ drawerIdle = true;
}
@Override
@@ -193,6 +196,14 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte getSupportActionBar().setTitle(R.string.common_appname);
getSupportActionBar().setDisplayShowCustomEnabled(false);
+
+ drawerIdle = true;
+ }
+
+ @Override
+ public void onDrawerSlide(View drawerView, float slideOffset) {
+ super.onDrawerSlide(drawerView, slideOffset);
+ drawerIdle = false;
}
};
drawer.setDrawerListener(drawerToggle);
@@ -200,7 +211,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte drawer.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
- if (currentFragment != null && currentFragment.getGestureDetector() != null) {
+ if (drawerIdle && currentFragment != null && currentFragment.getGestureDetector() != null) {
return currentFragment.getGestureDetector().onTouchEvent(event);
} else {
return false;
|