diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-04-20 11:07:23 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-04-20 11:07:23 +0200 |
commit | 303e2a53df69ccf97bdfe8525e4aeee8ba18921f (patch) | |
tree | 7b547ca1cbfe78e53fa75f8f6722895f61037f80 /src/de/danoeh/antennapod | |
parent | 960dd3425ff43bf2bfe8f2b7fd5ea9100cbe21b6 (diff) | |
parent | ec1ff077022eec893c844dce0a7cba7a6cea1420 (diff) | |
download | AntennaPod-303e2a53df69ccf97bdfe8525e4aeee8ba18921f.zip |
Merge branch 'master' of git://github.com/hzulla/AntennaPod into hzulla-master
Diffstat (limited to 'src/de/danoeh/antennapod')
6 files changed, 21 insertions, 28 deletions
diff --git a/src/de/danoeh/antennapod/adapter/DefaultFeedItemlistAdapter.java b/src/de/danoeh/antennapod/adapter/DefaultFeedItemlistAdapter.java index b603bb54f..2b49795c3 100644 --- a/src/de/danoeh/antennapod/adapter/DefaultFeedItemlistAdapter.java +++ b/src/de/danoeh/antennapod/adapter/DefaultFeedItemlistAdapter.java @@ -1,7 +1,5 @@ package de.danoeh.antennapod.adapter; -import java.text.DateFormat; - import android.content.Context; import android.content.res.TypedArray; import android.text.format.DateUtils; @@ -75,10 +73,9 @@ public class DefaultFeedItemlistAdapter extends BaseAdapter { holder.title.setText(item.getTitle()); holder.published.setText(convertView.getResources().getString( R.string.published_prefix) - + DateUtils.formatSameDayTime(item.getPubDate().getTime(), - System.currentTimeMillis(), DateFormat.MEDIUM, - DateFormat.SHORT)); - + + DateUtils.getRelativeTimeSpanString( + item.getPubDate().getTime(), + System.currentTimeMillis(), 0, 0)); if (item.getMedia() == null) { holder.type.setVisibility(View.GONE); holder.lenSize.setVisibility(View.GONE); diff --git a/src/de/danoeh/antennapod/adapter/DownloadLogAdapter.java b/src/de/danoeh/antennapod/adapter/DownloadLogAdapter.java index c0ccdc7fe..f97210cf3 100644 --- a/src/de/danoeh/antennapod/adapter/DownloadLogAdapter.java +++ b/src/de/danoeh/antennapod/adapter/DownloadLogAdapter.java @@ -1,7 +1,5 @@ package de.danoeh.antennapod.adapter; -import java.text.DateFormat; - import android.content.Context; import android.text.format.DateUtils; import android.view.LayoutInflater; @@ -60,9 +58,9 @@ public class DownloadLogAdapter extends BaseAdapter { } else { holder.title.setText(R.string.download_log_title_unknown); } - holder.date.setText(DateUtils.formatSameDayTime(status - .getCompletionDate().getTime(), System.currentTimeMillis(), - DateFormat.SHORT, DateFormat.SHORT)); + holder.date.setText(DateUtils.getRelativeTimeSpanString( + status.getCompletionDate().getTime(), + System.currentTimeMillis(), 0, 0)); if (status.isSuccessful()) { holder.successful.setTextColor(convertView.getResources().getColor( R.color.download_success_green)); diff --git a/src/de/danoeh/antennapod/adapter/FeedlistAdapter.java b/src/de/danoeh/antennapod/adapter/FeedlistAdapter.java index d7ea0c160..df87a83c6 100644 --- a/src/de/danoeh/antennapod/adapter/FeedlistAdapter.java +++ b/src/de/danoeh/antennapod/adapter/FeedlistAdapter.java @@ -1,7 +1,5 @@ package de.danoeh.antennapod.adapter; -import java.text.DateFormat; - import android.content.Context; import android.text.format.DateUtils; import android.view.LayoutInflater; @@ -77,16 +75,19 @@ public class FeedlistAdapter extends BaseAdapter { } holder.title.setText(feed.getTitle()); + int numOfItems = feed.getNumOfItems(true); if (DownloadRequester.getInstance().isDownloadingFile(feed)) { holder.lastUpdate.setText(R.string.refreshing_label); } else { - holder.lastUpdate.setText(convertView.getResources().getString( - R.string.last_update_prefix) - + DateUtils.formatSameDayTime(feed.getLastUpdate() - .getTime(), System.currentTimeMillis(), - DateFormat.MEDIUM, DateFormat.SHORT)); + if (numOfItems > 0) { + holder.lastUpdate.setText(convertView.getResources().getString( + R.string.most_recent_prefix) + + DateUtils.getRelativeTimeSpanString( + feed.getItemAtIndex(true, 0).getPubDate().getTime(), + System.currentTimeMillis(), 0, 0)); + } } - holder.numberOfEpisodes.setText(feed.getNumOfItems(true) + holder.numberOfEpisodes.setText(numOfItems + convertView.getResources() .getString(R.string.episodes_suffix)); diff --git a/src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java b/src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java index 7b898385e..e5c12f018 100644 --- a/src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java +++ b/src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java @@ -1,7 +1,5 @@ package de.danoeh.antennapod.adapter; -import java.text.DateFormat; - import android.content.Context; import android.content.res.TypedArray; import android.text.format.DateUtils; @@ -122,9 +120,9 @@ public class InternalFeedItemlistAdapter extends DefaultFeedItemlistAdapter { holder.published.setText(convertView.getResources().getString( R.string.published_prefix) - + DateUtils.formatSameDayTime(item.getPubDate().getTime(), - System.currentTimeMillis(), DateFormat.MEDIUM, - DateFormat.SHORT)); + + DateUtils.getRelativeTimeSpanString( + item.getPubDate().getTime(), + System.currentTimeMillis(), 0, 0)); FeedMedia media = item.getMedia(); if (media == null) { diff --git a/src/de/danoeh/antennapod/adapter/MiroGuideItemlistAdapter.java b/src/de/danoeh/antennapod/adapter/MiroGuideItemlistAdapter.java index 4cee0a64a..f12345f84 100644 --- a/src/de/danoeh/antennapod/adapter/MiroGuideItemlistAdapter.java +++ b/src/de/danoeh/antennapod/adapter/MiroGuideItemlistAdapter.java @@ -1,6 +1,5 @@ package de.danoeh.antennapod.adapter; -import java.text.DateFormat; import java.util.List; import android.content.Context; @@ -42,9 +41,8 @@ public class MiroGuideItemlistAdapter extends ArrayAdapter<MiroGuideItem> { holder.title.setText(item.getName()); if (item.getDate() != null) { - holder.date.setText(DateUtils.formatSameDayTime(item.getDate() - .getTime(), System.currentTimeMillis(), DateFormat.SHORT, - DateFormat.SHORT)); + holder.date.setText(DateUtils.getRelativeTimeSpanString( + item.getDate().getTime(), System.currentTimeMillis(), 0, 0)); holder.date.setVisibility(View.VISIBLE); } else { holder.date.setVisibility(View.GONE); diff --git a/src/de/danoeh/antennapod/util/Converter.java b/src/de/danoeh/antennapod/util/Converter.java index f02e8ea69..6ef47af31 100644 --- a/src/de/danoeh/antennapod/util/Converter.java +++ b/src/de/danoeh/antennapod/util/Converter.java @@ -78,4 +78,5 @@ public final class Converter { return String.format("%02d:%02d", h, m); } + } |