diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-09-04 21:04:53 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-09-04 21:04:53 +0200 |
commit | 09977992bfaa12838872615b81b1374cfa3420b4 (patch) | |
tree | 2a669c97156f557abbb06eaa6d1ec993f49dd2da /src/de/danoeh/antennapod | |
parent | 8d94bf9e67fbc6496074ec14236f4de35503013e (diff) | |
download | AntennaPod-09977992bfaa12838872615b81b1374cfa3420b4.zip |
Added missing up-navigation buttons
Diffstat (limited to 'src/de/danoeh/antennapod')
5 files changed, 71 insertions, 1 deletions
diff --git a/src/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java b/src/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java index 0aa4c55c5..bb56b1d12 100644 --- a/src/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java +++ b/src/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java @@ -2,7 +2,10 @@ package de.danoeh.antennapod.activity; import android.content.Context; import android.os.AsyncTask; +import android.os.Bundle; +import android.support.v4.app.NavUtils; import android.view.LayoutInflater; +import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.ImageView; @@ -33,6 +36,22 @@ public class DefaultOnlineFeedViewActivity extends OnlineFeedViewActivity { private Button subscribeButton; @Override + protected void onCreate(Bundle arg0) { + super.onCreate(arg0); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + finish(); + return true; + } + return super.onOptionsItemSelected(item); + } + + @Override protected void loadData() { super.loadData(); feeds = DBReader.getFeedList(this); diff --git a/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java b/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java index 94f3d5527..d355a7826 100644 --- a/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java +++ b/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java @@ -5,9 +5,11 @@ import android.content.Intent; import android.content.res.Configuration; import android.os.AsyncTask; import android.os.Bundle; +import android.support.v4.app.NavUtils; import android.support.v7.app.ActionBarActivity; import android.util.Log; import android.view.LayoutInflater; +import android.view.MenuItem; import android.view.View; import android.widget.*; import de.danoeh.antennapod.AppConfig; @@ -55,6 +57,7 @@ public class GpodnetAuthenticationActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); setTheme(UserPreferences.getTheme()); setContentView(R.layout.gpodnetauth_activity); @@ -83,6 +86,16 @@ public class GpodnetAuthenticationActivity extends ActionBarActivity { } @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + NavUtils.navigateUpFromSameTask(this); + return true; + } + return super.onOptionsItemSelected(item); + } + + @Override public void onConfigurationChanged(Configuration newConfig) { } diff --git a/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetMainActivity.java b/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetMainActivity.java index 17b46ae9d..9535e9d32 100644 --- a/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetMainActivity.java +++ b/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetMainActivity.java @@ -4,7 +4,9 @@ import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; +import android.support.v4.app.NavUtils; import android.support.v4.view.ViewPager; +import android.view.MenuItem; import de.danoeh.antennapod.R; import de.danoeh.antennapod.fragment.gpodnet.PodcastTopListFragment; import de.danoeh.antennapod.fragment.gpodnet.SuggestionListFragment; @@ -24,12 +26,22 @@ public class GpodnetMainActivity extends GpodnetActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - + getSupportActionBar().setDisplayHomeAsUpEnabled(true); setContentView(R.layout.gpodnet_main); ViewPager viewpager = (ViewPager) findViewById(R.id.viewpager); viewpager.setAdapter(new PagerAdapter(getSupportFragmentManager())); } + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + NavUtils.navigateUpFromSameTask(this); + return true; + } + return super.onOptionsItemSelected(item); + } + private class PagerAdapter extends FragmentStatePagerAdapter { private static final int NUM_PAGES_LOGGED_OUT = 2; diff --git a/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetSearchActivity.java b/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetSearchActivity.java index e0e3f822a..199b45dc9 100644 --- a/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetSearchActivity.java +++ b/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetSearchActivity.java @@ -4,6 +4,8 @@ import android.app.SearchManager; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentTransaction; +import android.support.v4.app.NavUtils; +import android.view.MenuItem; import de.danoeh.antennapod.R; import de.danoeh.antennapod.fragment.gpodnet.SearchListFragment; import org.apache.commons.lang3.StringUtils; @@ -18,6 +20,7 @@ public class GpodnetSearchActivity extends GpodnetActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); setContentView(R.layout.gpodnet_search); } @@ -47,4 +50,14 @@ public class GpodnetSearchActivity extends GpodnetActivity { searchFragment.changeQuery(query); } } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + NavUtils.navigateUpFromSameTask(this); + return true; + } + return super.onOptionsItemSelected(item); + } } diff --git a/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetTagActivity.java b/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetTagActivity.java index aabd03685..f3922f7aa 100644 --- a/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetTagActivity.java +++ b/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetTagActivity.java @@ -3,6 +3,8 @@ package de.danoeh.antennapod.activity.gpoddernet; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; +import android.support.v4.app.NavUtils; +import android.view.MenuItem; import de.danoeh.antennapod.R; import de.danoeh.antennapod.fragment.gpodnet.PodcastListFragment; import de.danoeh.antennapod.fragment.gpodnet.SearchListFragment; @@ -26,6 +28,7 @@ public class GpodnetTagActivity extends GpodnetActivity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); setContentView(R.layout.gpodnet_tag_activity); if (!getIntent().hasExtra(ARG_TAGNAME)) { @@ -48,4 +51,14 @@ public class GpodnetTagActivity extends GpodnetActivity{ return service.getPodcastsForTag(tag, PODCAST_COUNT); } } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + NavUtils.navigateUpFromSameTask(this); + return true; + } + return super.onOptionsItemSelected(item); + } } |