aboutsummaryrefslogtreecommitdiff
path: root/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-10-24 21:12:03 -0700
committerScott Jackson <daneren2005@gmail.com>2013-10-24 21:12:03 -0700
commit8eae024258e37b5cad467ffdb220c261461554eb (patch)
treed95c1d49337b9a7fb133a3e0a5c01439546ad00f /src/github
parent55fe550103bc117fe5d6e899b1833ef9481ad658 (diff)
downloaddsub-8eae024258e37b5cad467ffdb220c261461554eb.tar.gz
dsub-8eae024258e37b5cad467ffdb220c261461554eb.tar.bz2
dsub-8eae024258e37b5cad467ffdb220c261461554eb.zip
Make the activities look and act the same
Diffstat (limited to 'src/github')
-rw-r--r--src/github/daneren2005/dsub/activity/DownloadActivity.java20
-rw-r--r--src/github/daneren2005/dsub/activity/EqualizerActivity.java2
-rw-r--r--src/github/daneren2005/dsub/activity/SearchActivity.java20
-rw-r--r--src/github/daneren2005/dsub/activity/SubsonicActivity.java10
-rw-r--r--src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java3
5 files changed, 11 insertions, 44 deletions
diff --git a/src/github/daneren2005/dsub/activity/DownloadActivity.java b/src/github/daneren2005/dsub/activity/DownloadActivity.java
index 44a7a0ff..e302d59e 100644
--- a/src/github/daneren2005/dsub/activity/DownloadActivity.java
+++ b/src/github/daneren2005/dsub/activity/DownloadActivity.java
@@ -54,19 +54,6 @@ public class DownloadActivity extends SubsonicActivity {
}
@Override
- public boolean onOptionsItemSelected(MenuItem item) {
- if(item.getItemId() == android.R.id.home) {
- Intent i = new Intent();
- i.setClass(this, SubsonicFragmentActivity.class);
- i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(i);
- return true;
- } else {
- return super.onOptionsItemSelected(item);
- }
- }
-
- @Override
public boolean onTouchEvent(MotionEvent me) {
if(currentFragment != null) {
return ((DownloadFragment)currentFragment).getGestureDetector().onTouchEvent(me);
@@ -74,11 +61,4 @@ public class DownloadActivity extends SubsonicActivity {
return false;
}
}
-
- @Override
- public void onBackPressed() {
- if(onBackPressedSupport()) {
- super.onBackPressed();
- }
- }
}
diff --git a/src/github/daneren2005/dsub/activity/EqualizerActivity.java b/src/github/daneren2005/dsub/activity/EqualizerActivity.java
index d9605fc5..fd0a548d 100644
--- a/src/github/daneren2005/dsub/activity/EqualizerActivity.java
+++ b/src/github/daneren2005/dsub/activity/EqualizerActivity.java
@@ -47,7 +47,7 @@ import github.daneren2005.dsub.util.Util;
* @author Sindre Mehus
* @version $Id$
*/
-public class EqualizerActivity extends Activity {
+public class EqualizerActivity extends SubsonicActivity {
private static final String TAG = EqualizerActivity.class.getSimpleName();
private static final int MENU_GROUP_PRESET = 100;
diff --git a/src/github/daneren2005/dsub/activity/SearchActivity.java b/src/github/daneren2005/dsub/activity/SearchActivity.java
index 7e558b20..2f3a4a46 100644
--- a/src/github/daneren2005/dsub/activity/SearchActivity.java
+++ b/src/github/daneren2005/dsub/activity/SearchActivity.java
@@ -62,27 +62,7 @@ public class SearchActivity extends SubsonicActivity {
}
}
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- if(item.getItemId() == android.R.id.home) {
- Intent i = new Intent();
- i.setClass(this, SubsonicFragmentActivity.class);
- i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(i);
- return true;
- } else {
- return super.onOptionsItemSelected(item);
- }
- }
-
public void onSupportNewIntent(Intent intent) {
onNewIntent(intent);
}
-
- @Override
- public void onBackPressed() {
- if(onBackPressedSupport()) {
- super.onBackPressed();
- }
- }
} \ No newline at end of file
diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java
index 07c35336..34ce6fde 100644
--- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java
+++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java
@@ -241,6 +241,9 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
public boolean onOptionsItemSelected(MenuItem item) {
if(drawerToggle.onOptionsItemSelected(item)) {
return true;
+ } else if(item.getItemId() == android.R.id.home) {
+ finish();
+ return true;
}
return currentFragment.onOptionsItemSelected(item);
@@ -326,6 +329,13 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
return true;
}
}
+
+ @Override
+ public void onBackPressed() {
+ if(onBackPressedSupport()) {
+ super.onBackPressed();
+ }
+ }
public void replaceFragment(SubsonicFragment fragment, int id, int tag) {
if(currentFragment != null) {
diff --git a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
index adb0eb62..e3975703 100644
--- a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
+++ b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
@@ -253,9 +253,6 @@ public class SubsonicFragmentActivity extends SubsonicActivity {
public boolean onOptionsItemSelected(MenuItem item) {
if(super.onOptionsItemSelected(item)) {
return true;
- } else if(item.getItemId() == android.R.id.home) {
- startActivity(SubsonicFragmentActivity.class);
- return true;
} else {
return false;
}