Merge pull request #825 from TomHennen/fix_822_with_play_progress
Download and playback progress now displayed in All/New Episodes
This commit is contained in:
commit
dc010d01d5
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="de.danoeh.antennapod"
|
||||
android:versionCode="51"
|
||||
android:versionCode="52"
|
||||
android:versionName="1.2">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
@ -80,8 +80,8 @@ public class AllEpisodesListAdapter extends BaseAdapter {
|
||||
.findViewById(R.id.butSecondaryAction);
|
||||
holder.queueStatus = (ImageView) convertView
|
||||
.findViewById(R.id.imgvInPlaylist);
|
||||
holder.downloadProgress = (ProgressBar) convertView
|
||||
.findViewById(R.id.pbar_download_progress);
|
||||
holder.progress = (ProgressBar) convertView
|
||||
.findViewById(R.id.pbar_progress);
|
||||
holder.imageView = (ImageView) convertView.findViewById(R.id.imgvImage);
|
||||
holder.txtvDuration = (TextView) convertView.findViewById(R.id.txtvDuration);
|
||||
convertView.setTag(holder);
|
||||
@ -109,24 +109,24 @@ public class AllEpisodesListAdapter extends BaseAdapter {
|
||||
holder.txtvDuration.setText("");
|
||||
}
|
||||
|
||||
FeedItem.State state = item.getState();
|
||||
if (isDownloadingMedia) {
|
||||
holder.downloadProgress.setVisibility(View.VISIBLE);
|
||||
holder.txtvDuration.setVisibility(View.GONE);
|
||||
holder.pubDate.setVisibility(View.GONE);
|
||||
holder.progress.setVisibility(View.VISIBLE);
|
||||
// item is being downloaded
|
||||
holder.progress.setProgress(itemAccess.getItemDownloadProgressPercent(item));
|
||||
} else if (state == FeedItem.State.PLAYING
|
||||
|| state == FeedItem.State.IN_PROGRESS) {
|
||||
if (media.getDuration() > 0) {
|
||||
int progress = (int) (100.0 * media.getPosition() / media.getDuration());
|
||||
holder.progress.setProgress(progress);
|
||||
holder.progress.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
holder.txtvDuration.setVisibility(View.VISIBLE);
|
||||
holder.pubDate.setVisibility(View.VISIBLE);
|
||||
holder.downloadProgress.setVisibility(View.GONE);
|
||||
holder.progress.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (!media.isDownloaded()) {
|
||||
if (isDownloadingMedia) {
|
||||
// item is being downloaded
|
||||
holder.downloadProgress.setProgress(itemAccess.getItemDownloadProgressPercent(item));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
holder.downloadProgress.setVisibility(View.GONE);
|
||||
holder.progress.setVisibility(View.GONE);
|
||||
holder.txtvDuration.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ public class AllEpisodesListAdapter extends BaseAdapter {
|
||||
View statusUnread;
|
||||
ImageView queueStatus;
|
||||
ImageView imageView;
|
||||
ProgressBar downloadProgress;
|
||||
ProgressBar progress;
|
||||
TextView txtvDuration;
|
||||
ImageButton butSecondary;
|
||||
}
|
||||
|
@ -43,7 +43,7 @@
|
||||
<TextView
|
||||
android:id="@+id/txtvTitle"
|
||||
style="@style/AntennaPod.TextView.ListItemPrimaryTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
@ -55,10 +55,10 @@
|
||||
android:id="@+id/bottom_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/txtvTitle"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="16dp"
|
||||
tools:background="@android:color/holo_red_light" >
|
||||
|
||||
<TextView
|
||||
@ -93,14 +93,12 @@
|
||||
tools:background="@android:color/holo_green_dark" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pbar_download_progress"
|
||||
android:id="@+id/pbar_progress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_toLeftOf="@id/txtvPublished"
|
||||
android:layout_toRightOf="@id/txtvDuration"
|
||||
android:layout_below="@id/txtvDuration"
|
||||
android:layout_marginTop="-2dp"
|
||||
android:max="100" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
Loading…
x
Reference in New Issue
Block a user