diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2016-03-27 16:02:41 +0200 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2016-03-28 15:17:31 +0200 |
commit | 82f73a0af8495e4291c9d44d7d50a8c3ebddc314 (patch) | |
tree | 2e92e9302836ea324c0a12752f84ad619e824ca9 /app/src/main/java | |
parent | bbf1c43294a927f01cd262e7d109c66f86114a0e (diff) | |
download | AntennaPod-82f73a0af8495e4291c9d44d7d50a8c3ebddc314.zip |
Episode view: Open podcast menu or click on cover or podcast title
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java index 92f4a9f7c..4042e3b53 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -137,6 +137,7 @@ public class ItemFragment extends Fragment { root = (ViewGroup) layout.findViewById(R.id.content_root); txtvPodcast = (TextView) layout.findViewById(R.id.txtvPodcast); + txtvPodcast.setOnClickListener(v -> openPodcast()); txtvTitle = (TextView) layout.findViewById(R.id.txtvTitle); txtvDuration = (TextView) layout.findViewById(R.id.txtvDuration); txtvPublished = (TextView) layout.findViewById(R.id.txtvPublished); @@ -169,6 +170,7 @@ public class ItemFragment extends Fragment { registerForContextMenu(webvDescription); imgvCover = (ImageView) layout.findViewById(R.id.imgvCover); + imgvCover.setOnClickListener(v -> openPodcast()); progbarDownload = (ProgressBar) layout.findViewById(R.id.progbarDownload); progbarLoading = (ProgressBar) layout.findViewById(R.id.progbarLoading); butAction1 = (IconButton) layout.findViewById(R.id.butAction1); @@ -263,12 +265,18 @@ public class ItemFragment extends Fragment { @Override public boolean onOptionsItemSelected(MenuItem menuItem) { - try { - return FeedItemMenuHandler.onMenuItemClicked(getActivity(), menuItem.getItemId(), item); - } catch (DownloadRequestException e) { - e.printStackTrace(); - Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_LONG).show(); - return true; + switch(menuItem.getItemId()) { + case R.id.open_podcast: + openPodcast(); + return true; + default: + try { + return FeedItemMenuHandler.onMenuItemClicked(getActivity(), menuItem.getItemId(), item); + } catch (DownloadRequestException e) { + e.printStackTrace(); + Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_LONG).show(); + return true; + } } } @@ -456,6 +464,10 @@ public class ItemFragment extends Fragment { } } + private void openPodcast() { + ((MainActivity)getActivity()).loadFeedFragmentById(item.getFeedId(), null); + } + public void onEventMainThread(QueueEvent event) { if(event.contains(itemID)) { load(); |