mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-01-05 21:39:24 +01:00
Added 'downloaded' imageview to episodes list
This commit is contained in:
parent
e67dab5ab2
commit
481d3ea24a
@ -56,18 +56,29 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtvLenSize"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/txtvFeedname"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_toLeftOf="@id/butAction"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_toRightOf="@id/imgvFeedimage"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:attr/textColorTertiary"
|
||||
android:textSize="@dimen/text_size_micro" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imgvDownloaded"
|
||||
android:layout_width="@dimen/enc_icons_size"
|
||||
android:layout_height="@dimen/enc_icons_size"
|
||||
android:layout_below="@id/txtvFeedname"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_toLeftOf="@id/butAction"
|
||||
android:src="?attr/av_download" />
|
||||
|
||||
</RelativeLayout>
|
@ -98,6 +98,8 @@ public class ExternalEpisodesListAdapter extends BaseExpandableListAdapter {
|
||||
.findViewById(R.id.txtvFeedname);
|
||||
holder.lenSize = (TextView) convertView
|
||||
.findViewById(R.id.txtvLenSize);
|
||||
holder.downloaded = (ImageView) convertView
|
||||
.findViewById(R.id.imgvDownloaded);
|
||||
holder.feedImage = (ImageView) convertView
|
||||
.findViewById(R.id.imgvFeedimage);
|
||||
holder.butAction = (ImageButton) convertView
|
||||
@ -113,14 +115,17 @@ public class ExternalEpisodesListAdapter extends BaseExpandableListAdapter {
|
||||
if (media != null) {
|
||||
holder.lenSize.setVisibility(View.VISIBLE);
|
||||
if (!media.isDownloaded()) {
|
||||
holder.downloaded.setVisibility(View.GONE);
|
||||
holder.lenSize.setText(context.getString(R.string.size_prefix)
|
||||
+ Converter.byteToString(media.getSize()));
|
||||
} else {
|
||||
holder.downloaded.setVisibility(View.VISIBLE);
|
||||
holder.lenSize.setText(context
|
||||
.getString(R.string.length_prefix)
|
||||
+ Converter.getDurationStringLong(media.getDuration()));
|
||||
}
|
||||
} else {
|
||||
holder.downloaded.setVisibility(View.GONE);
|
||||
holder.lenSize.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
@ -147,6 +152,7 @@ public class ExternalEpisodesListAdapter extends BaseExpandableListAdapter {
|
||||
TextView title;
|
||||
TextView feedTitle;
|
||||
TextView lenSize;
|
||||
ImageView downloaded;
|
||||
ImageView feedImage;
|
||||
ImageButton butAction;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user