summaryrefslogtreecommitdiff
path: root/src/de/danoeh
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/danoeh')
-rw-r--r--src/de/danoeh/antennapod/adapter/ActionButtonUtils.java10
-rw-r--r--src/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java5
-rw-r--r--src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java7
-rw-r--r--src/de/danoeh/antennapod/adapter/NewEpisodesListAdapter.java10
-rw-r--r--src/de/danoeh/antennapod/adapter/QueueListAdapter.java25
5 files changed, 7 insertions, 50 deletions
diff --git a/src/de/danoeh/antennapod/adapter/ActionButtonUtils.java b/src/de/danoeh/antennapod/adapter/ActionButtonUtils.java
index 78d62a8de..17c61a86c 100644
--- a/src/de/danoeh/antennapod/adapter/ActionButtonUtils.java
+++ b/src/de/danoeh/antennapod/adapter/ActionButtonUtils.java
@@ -23,7 +23,7 @@ public class ActionButtonUtils {
if (context == null) throw new IllegalArgumentException("context = null");
this.context = context;
drawables = context.obtainStyledAttributes(new int[]{
- R.attr.av_play, R.attr.navigation_cancel, R.attr.av_download});
+ R.attr.av_play, R.attr.navigation_cancel, R.attr.av_download, R.attr.navigation_chapters});
labels = new int[]{R.string.play_label, R.string.cancel_download_label, R.string.download_label};
}
@@ -52,8 +52,12 @@ public class ActionButtonUtils {
} else {
// item is not being downloaded
butSecondary.setVisibility(View.VISIBLE);
- butSecondary
- .setImageDrawable(drawables.getDrawable(0));
+ if (media.isPlaying()) {
+ butSecondary.setImageDrawable(drawables.getDrawable(3));
+ } else {
+ butSecondary
+ .setImageDrawable(drawables.getDrawable(0));
+ }
butSecondary.setContentDescription(context.getString(labels[0]));
}
} else {
diff --git a/src/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java b/src/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java
index e873a9e5a..5a357da44 100644
--- a/src/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java
+++ b/src/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java
@@ -60,8 +60,6 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter {
.findViewById(R.id.txtvPublished);
holder.butSecondary = (ImageButton) convertView
.findViewById(R.id.butSecondaryAction);
- holder.statusPlaying = (ImageView) convertView
- .findViewById(R.id.statusPlaying);
holder.imageView = (ImageView) convertView.findViewById(R.id.imgvImage);
holder.txtvSize = (TextView) convertView.findViewById(R.id.txtvSize);
convertView.setTag(holder);
@@ -75,11 +73,9 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter {
FeedItem.State state = item.getState();
if (state == FeedItem.State.PLAYING) {
- holder.statusPlaying.setVisibility(View.VISIBLE);
holder.butSecondary.setEnabled(false);
} else {
holder.butSecondary.setEnabled(true);
- holder.statusPlaying.setVisibility(View.INVISIBLE);
}
holder.butSecondary.setFocusable(false);
@@ -109,7 +105,6 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter {
TextView title;
TextView pubDate;
ImageView imageView;
- ImageView statusPlaying;
TextView txtvSize;
ImageButton butSecondary;
}
diff --git a/src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java b/src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java
index 356d75d99..736b65d24 100644
--- a/src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java
+++ b/src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java
@@ -58,8 +58,6 @@ public class InternalFeedItemlistAdapter extends DefaultFeedItemlistAdapter {
holder.inPlaylist = (ImageView) convertView
.findViewById(R.id.imgvInPlaylist);
holder.type = (ImageView) convertView.findViewById(R.id.imgvType);
- holder.statusPlaying = (View) convertView
- .findViewById(R.id.statusPlaying);
holder.statusUnread = (View) convertView
.findViewById(R.id.statusUnread);
holder.episodeProgress = (ProgressBar) convertView
@@ -89,21 +87,17 @@ public class InternalFeedItemlistAdapter extends DefaultFeedItemlistAdapter {
FeedItem.State state = item.getState();
switch (state) {
case PLAYING:
- holder.statusPlaying.setVisibility(View.VISIBLE);
holder.statusUnread.setVisibility(View.GONE);
holder.episodeProgress.setVisibility(View.VISIBLE);
break;
case IN_PROGRESS:
- holder.statusPlaying.setVisibility(View.GONE);
holder.statusUnread.setVisibility(View.GONE);
holder.episodeProgress.setVisibility(View.VISIBLE);
break;
case NEW:
- holder.statusPlaying.setVisibility(View.GONE);
holder.statusUnread.setVisibility(View.VISIBLE);
break;
default:
- holder.statusPlaying.setVisibility(View.GONE);
holder.statusUnread.setVisibility(View.GONE);
break;
}
@@ -202,7 +196,6 @@ public class InternalFeedItemlistAdapter extends DefaultFeedItemlistAdapter {
ImageView inPlaylist;
ImageButton butAction;
View statusUnread;
- View statusPlaying;
ProgressBar episodeProgress;
}
diff --git a/src/de/danoeh/antennapod/adapter/NewEpisodesListAdapter.java b/src/de/danoeh/antennapod/adapter/NewEpisodesListAdapter.java
index d13314b0b..9d5f5220d 100644
--- a/src/de/danoeh/antennapod/adapter/NewEpisodesListAdapter.java
+++ b/src/de/danoeh/antennapod/adapter/NewEpisodesListAdapter.java
@@ -113,8 +113,6 @@ public class NewEpisodesListAdapter extends BaseAdapter {
.findViewById(R.id.butSecondaryAction);
holder.queueStatus = (ImageView) convertView
.findViewById(R.id.imgvInPlaylist);
- holder.statusPlaying = (ImageView) convertView
- .findViewById(R.id.statusPlaying);
holder.downloadProgress = (ProgressBar) convertView
.findViewById(R.id.pbar_download_progress);
holder.imageView = (ImageView) convertView.findViewById(R.id.imgvImage);
@@ -126,13 +124,6 @@ public class NewEpisodesListAdapter extends BaseAdapter {
holder.title.setText(item.getTitle());
holder.pubDate.setText(DateUtils.formatDateTime(context, item.getPubDate().getTime(), DateUtils.FORMAT_SHOW_DATE));
- FeedItem.State state = item.getState();
-
- if (state == FeedItem.State.PLAYING) {
- holder.statusPlaying.setVisibility(View.VISIBLE);
- } else {
- holder.statusPlaying.setVisibility(View.INVISIBLE);
- }
FeedMedia media = item.getMedia();
if (media != null) {
@@ -195,7 +186,6 @@ public class NewEpisodesListAdapter extends BaseAdapter {
TextView pubDate;
ImageView queueStatus;
ImageView imageView;
- ImageView statusPlaying;
ProgressBar downloadProgress;
TextView txtvDuration;
ImageButton butSecondary;
diff --git a/src/de/danoeh/antennapod/adapter/QueueListAdapter.java b/src/de/danoeh/antennapod/adapter/QueueListAdapter.java
index c671f4a5c..fb6848a1e 100644
--- a/src/de/danoeh/antennapod/adapter/QueueListAdapter.java
+++ b/src/de/danoeh/antennapod/adapter/QueueListAdapter.java
@@ -1,7 +1,6 @@
package de.danoeh.antennapod.adapter;
import android.content.Context;
-import android.text.format.DateUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -11,7 +10,6 @@ import de.danoeh.antennapod.asynctask.ImageLoader;
import de.danoeh.antennapod.feed.FeedItem;
import de.danoeh.antennapod.feed.FeedMedia;
import de.danoeh.antennapod.storage.DownloadRequester;
-import de.danoeh.antennapod.util.Converter;
/**
* List adapter for the queue.
@@ -61,46 +59,26 @@ public class QueueListAdapter extends BaseAdapter {
convertView = inflater.inflate(R.layout.queue_listitem,
null);
holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
- holder.pubDate = (TextView) convertView
- .findViewById(R.id.txtvPublished);
holder.butSecondary = (ImageButton) convertView
.findViewById(R.id.butSecondaryAction);
- holder.statusPlaying = (ImageView) convertView
- .findViewById(R.id.statusPlaying);
holder.downloadProgress = (ProgressBar) convertView
.findViewById(R.id.pbar_download_progress);
holder.imageView = (ImageView) convertView.findViewById(R.id.imgvImage);
- holder.txtvDuration = (TextView) convertView.findViewById(R.id.txtvDuration);
convertView.setTag(holder);
} else {
holder = (Holder) convertView.getTag();
}
holder.title.setText(item.getTitle());
- holder.pubDate.setText(DateUtils.formatDateTime(context, item.getPubDate().getTime(), DateUtils.FORMAT_SHOW_DATE));
- FeedItem.State state = item.getState();
-
- if (state == FeedItem.State.PLAYING) {
- holder.statusPlaying.setVisibility(View.VISIBLE);
- } else {
- holder.statusPlaying.setVisibility(View.INVISIBLE);
- }
FeedMedia media = item.getMedia();
if (media != null) {
final boolean isDownloadingMedia = DownloadRequester.getInstance().isDownloadingFile(media);
- if (media.getDuration() > 0) {
- holder.txtvDuration.setText(Converter.getDurationStringLong(media.getDuration()));
- } else {
- holder.txtvDuration.setText("");
- }
if (isDownloadingMedia) {
holder.downloadProgress.setVisibility(View.VISIBLE);
- holder.txtvDuration.setVisibility(View.GONE);
} else {
- holder.txtvDuration.setVisibility(View.VISIBLE);
holder.downloadProgress.setVisibility(View.GONE);
}
if (!media.isDownloaded()) {
@@ -137,11 +115,8 @@ public class QueueListAdapter extends BaseAdapter {
static class Holder {
TextView title;
- TextView pubDate;
ImageView imageView;
- ImageView statusPlaying;
ProgressBar downloadProgress;
- TextView txtvDuration;
ImageButton butSecondary;
}