diff --git a/AndroidManifest.xml b/AndroidManifest.xml index abf8675d8..d20a1f91d 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -228,6 +228,7 @@ + \ No newline at end of file diff --git a/res/values/ids.xml b/res/values/ids.xml index 2b107e7dd..c29674052 100644 --- a/res/values/ids.xml +++ b/res/values/ids.xml @@ -2,12 +2,13 @@ - - - - + + + + - + + \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index 1d7fffc6c..62d60c5ac 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -112,9 +112,8 @@ Show player - Move up - Move down Clear queue + Organize queue Flattr sign-in diff --git a/src/de/danoeh/antennapod/activity/OrganizeQueueActivity.java b/src/de/danoeh/antennapod/activity/OrganizeQueueActivity.java new file mode 100644 index 000000000..b77921241 --- /dev/null +++ b/src/de/danoeh/antennapod/activity/OrganizeQueueActivity.java @@ -0,0 +1,51 @@ +package de.danoeh.antennapod.activity; + +import android.content.res.TypedArray; +import android.os.Bundle; + +import com.actionbarsherlock.app.SherlockListActivity; +import com.actionbarsherlock.view.Menu; +import com.actionbarsherlock.view.MenuItem; + +import de.danoeh.antennapod.PodcastApp; +import de.danoeh.antennapod.R; + +public class OrganizeQueueActivity extends SherlockListActivity { + private static final String TAG = "OrganizeQueueActivity"; + + private static final int MENU_ID_ACCEPT = 2; + + @Override + protected void onCreate(Bundle savedInstanceState) { + setTheme(PodcastApp.getThemeResourceId()); + super.onCreate(savedInstanceState); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + super.onCreateOptionsMenu(menu); + TypedArray drawables = obtainStyledAttributes(new int[] { R.attr.navigation_accept }); + menu.add(Menu.NONE, MENU_ID_ACCEPT, Menu.NONE, R.string.confirm_label) + .setIcon(drawables.getDrawable(0)) + .setShowAsAction( + MenuItem.SHOW_AS_ACTION_IF_ROOM + | MenuItem.SHOW_AS_ACTION_WITH_TEXT); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + finish(); + return true; + case MENU_ID_ACCEPT: + finish(); + return true; + default: + return false; + } + } + +} diff --git a/src/de/danoeh/antennapod/fragment/EpisodesFragment.java b/src/de/danoeh/antennapod/fragment/EpisodesFragment.java index 1ea0011ef..967cfd2bc 100644 --- a/src/de/danoeh/antennapod/fragment/EpisodesFragment.java +++ b/src/de/danoeh/antennapod/fragment/EpisodesFragment.java @@ -21,6 +21,7 @@ import com.actionbarsherlock.view.Menu; import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.ItemviewActivity; +import de.danoeh.antennapod.activity.OrganizeQueueActivity; import de.danoeh.antennapod.adapter.ActionButtonCallback; import de.danoeh.antennapod.adapter.ExternalEpisodesListAdapter; import de.danoeh.antennapod.dialog.DownloadRequestErrorDialogCreator; @@ -60,7 +61,7 @@ public class EpisodesFragment extends SherlockFragment { filter.addAction(FeedManager.ACTION_QUEUE_UPDATE); filter.addAction(FeedManager.ACTION_UNREAD_ITEMS_UPDATE); filter.addAction(FeedManager.ACTION_FEED_LIST_UPDATE); - + getActivity().registerReceiver(contentUpdate, filter); } @@ -158,6 +159,8 @@ public class EpisodesFragment extends SherlockFragment { }, selectedItem, false); } else if (selectedGroupId == ExternalEpisodesListAdapter.GROUP_POS_QUEUE) { + menu.add(Menu.NONE, R.id.organize_queue_item, Menu.NONE, + R.string.organize_queue_label); menu.add(Menu.NONE, R.id.clear_queue_item, Menu.NONE, getActivity() .getString(R.string.clear_queue_label)); menu.add(Menu.NONE, R.id.download_all_item, Menu.NONE, @@ -187,6 +190,10 @@ public class EpisodesFragment extends SherlockFragment { } else if (selectedGroupId == ExternalEpisodesListAdapter.GROUP_POS_QUEUE) { handled = true; switch (item.getItemId()) { + case R.id.organize_queue_item: + startActivity(new Intent(getActivity(), + OrganizeQueueActivity.class)); + break; case R.id.clear_queue_item: manager.clearQueue(getActivity()); break;