Added icon to Feeditemlist to show whether an item is in the queue

This commit is contained in:
daniel oeh 2012-07-11 13:05:13 +02:00
parent fae73dfe2f
commit 1e275fecb3
6 changed files with 16 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 874 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -70,6 +70,13 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
<ImageView
android:id="@+id/imgvInPlaylist"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/stat_playlist"
android:visibility="gone" />
<ImageView <ImageView
android:id="@+id/imgvDownloaded" android:id="@+id/imgvDownloaded"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -4,6 +4,7 @@ import java.text.DateFormat;
import java.util.List; import java.util.List;
import de.podfetcher.feed.FeedItem; import de.podfetcher.feed.FeedItem;
import de.podfetcher.feed.FeedManager;
import de.podfetcher.util.Converter; import de.podfetcher.util.Converter;
import de.podfetcher.R; import de.podfetcher.R;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
@ -55,6 +56,8 @@ public class FeedItemlistAdapter extends ArrayAdapter<FeedItem> {
.findViewById(R.id.butAction); .findViewById(R.id.butAction);
holder.published = (TextView) convertView holder.published = (TextView) convertView
.findViewById(R.id.txtvPublished); .findViewById(R.id.txtvPublished);
holder.inPlaylist = (ImageView) convertView
.findViewById(R.id.imgvInPlaylist);
holder.downloaded = (ImageView) convertView holder.downloaded = (ImageView) convertView
.findViewById(R.id.imgvDownloaded); .findViewById(R.id.imgvDownloaded);
holder.type = (ImageView) convertView.findViewById(R.id.imgvType); holder.type = (ImageView) convertView.findViewById(R.id.imgvType);
@ -99,6 +102,11 @@ public class FeedItemlistAdapter extends ArrayAdapter<FeedItem> {
holder.encInfo.setVisibility(View.GONE); holder.encInfo.setVisibility(View.GONE);
} else { } else {
holder.encInfo.setVisibility(View.VISIBLE); holder.encInfo.setVisibility(View.VISIBLE);
if (FeedManager.getInstance().isInQueue(item)) {
holder.inPlaylist.setVisibility(View.VISIBLE);
} else {
holder.inPlaylist.setVisibility(View.GONE);
}
if (item.getMedia().isDownloaded()) { if (item.getMedia().isDownloaded()) {
holder.lenSize.setText(Converter.getDurationStringShort(item holder.lenSize.setText(Converter.getDurationStringShort(item
.getMedia().getDuration())); .getMedia().getDuration()));
@ -138,6 +146,7 @@ public class FeedItemlistAdapter extends ArrayAdapter<FeedItem> {
TextView feedtitle; TextView feedtitle;
TextView published; TextView published;
TextView lenSize; TextView lenSize;
ImageView inPlaylist;
ImageView downloaded; ImageView downloaded;
ImageView type; ImageView type;
ImageView downloading; ImageView downloading;