diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2015-03-05 09:42:46 +0100 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2015-03-05 09:42:46 +0100 |
commit | 2ce366da6418dfed08447cf100fd8af39345bcea (patch) | |
tree | 9f02b131f3eca8432dbfafc2c7839ecaf9e045ff /app | |
parent | 9444f266730b4b2b2a064a3d2557962d5db16a5f (diff) | |
download | AntennaPod-2ce366da6418dfed08447cf100fd8af39345bcea.zip |
Show duration and pubDate on episode display
... which was - despite the commit message - missing from last commit...
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java | 13 | ||||
-rw-r--r-- | app/src/main/res/layout/feeditem_fragment_header.xml | 25 |
2 files changed, 36 insertions, 2 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 ac9e744ed..e80bf5f14 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -16,6 +16,7 @@ import android.support.v4.util.Pair; import android.support.v7.widget.PopupMenu; import android.support.v7.widget.Toolbar; import android.text.TextUtils; +import android.text.format.DateUtils; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; @@ -49,6 +50,7 @@ import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.storage.DownloadRequestException; import de.danoeh.antennapod.core.storage.DownloadRequester; +import de.danoeh.antennapod.core.util.Converter; import de.danoeh.antennapod.core.util.QueueAccess; import de.danoeh.antennapod.core.util.playback.Timeline; import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler; @@ -91,6 +93,8 @@ public class ItemFragment extends Fragment implements LoaderManager.LoaderCallba private View header; private WebView webvDescription; private TextView txtvTitle; + private TextView txtvDuration; + private TextView txtvPublished; private ImageView imgvCover; private ProgressBar progbarDownload; private ProgressBar progbarLoading; @@ -166,6 +170,8 @@ public class ItemFragment extends Fragment implements LoaderManager.LoaderCallba header = inflater.inflate(R.layout.feeditem_fragment_header, toolbar, false); root = (ViewGroup) layout.findViewById(R.id.content_root); txtvTitle = (TextView) header.findViewById(R.id.txtvTitle); + txtvDuration = (TextView) header.findViewById(R.id.txtvDuration); + txtvPublished = (TextView) header.findViewById(R.id.txtvPublished); if (Build.VERSION.SDK_INT >= 14) { // ellipsize is causing problems on old versions, see #448 txtvTitle.setEllipsize(TextUtils.TruncateAt.END); } @@ -313,6 +319,8 @@ public class ItemFragment extends Fragment implements LoaderManager.LoaderCallba private void updateAppearance() { txtvTitle.setText(item.getTitle()); + txtvPublished.setText(DateUtils.formatDateTime(getActivity(), item.getPubDate().getTime(), DateUtils.FORMAT_ABBREV_ALL)); + Picasso.with(getActivity()).load(item.getImageUri()) .fit() .into(imgvCover); @@ -348,7 +356,10 @@ public class ItemFragment extends Fragment implements LoaderManager.LoaderCallba } drawables.recycle(); - } else { + } else {if(media.getDuration() > 0) { + txtvDuration.setText(Converter.getDurationStringLong(media.getDuration())); + } + boolean isDownloading = DownloadRequester.getInstance().isDownloadingFile(media); TypedArray drawables = getActivity().obtainStyledAttributes(new int[]{R.attr.av_play, R.attr.av_download, R.attr.action_stream, R.attr.content_discard, R.attr.navigation_cancel}); diff --git a/app/src/main/res/layout/feeditem_fragment_header.xml b/app/src/main/res/layout/feeditem_fragment_header.xml index 5956ae062..a21488306 100644 --- a/app/src/main/res/layout/feeditem_fragment_header.xml +++ b/app/src/main/res/layout/feeditem_fragment_header.xml @@ -16,7 +16,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:orientation="horizontal" - android:paddingBottom="8dp"> + android:paddingBottom="0dp"> <ImageView android:id="@+id/imgvCover" @@ -59,6 +59,29 @@ android:maxLines="5" tools:text="Podcast title" tools:background="@android:color/holo_green_dark" /> + + <TextView + android:id="@+id/txtvDuration" + style="@style/AntennaPod.TextView.ListItemSecondaryTitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_toRightOf="@id/imgvCover" + android:layout_below="@id/txtvTitle" + android:layout_marginLeft="16dp" + tools:text="00:42:23" + tools:background="@android:color/holo_green_dark"/> + + <TextView + android:id="@+id/txtvPublished" + style="@style/AntennaPod.TextView.ListItemSecondaryTitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_toLeftOf="@id/butMoreActions" + android:layout_marginRight="8dp" + tools:text="Jan 23" + tools:background="@android:color/holo_green_dark" + android:layout_below="@+id/txtvTitle"/> + </RelativeLayout> <ProgressBar |