Merge pull request #3894 from ByteHamster/no-media-items
Fixed items without media showing video icon
This commit is contained in:
commit
d360ab2925
|
@ -119,6 +119,10 @@ public class EpisodeItemViewHolder extends FeedComponentViewHolder
|
||||||
bind(item.getMedia());
|
bind(item.getMedia());
|
||||||
} else {
|
} else {
|
||||||
secondaryActionProgress.setPercentage(0, item);
|
secondaryActionProgress.setPercentage(0, item);
|
||||||
|
isVideo.setVisibility(View.GONE);
|
||||||
|
progressBar.setVisibility(View.GONE);
|
||||||
|
duration.setVisibility(View.GONE);
|
||||||
|
position.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (coverHolder.getVisibility() == View.VISIBLE) {
|
if (coverHolder.getVisibility() == View.VISIBLE) {
|
||||||
|
@ -133,6 +137,7 @@ public class EpisodeItemViewHolder extends FeedComponentViewHolder
|
||||||
|
|
||||||
private void bind(FeedMedia media) {
|
private void bind(FeedMedia media) {
|
||||||
isVideo.setVisibility(media.getMediaType() == MediaType.VIDEO ? View.VISIBLE : View.GONE);
|
isVideo.setVisibility(media.getMediaType() == MediaType.VIDEO ? View.VISIBLE : View.GONE);
|
||||||
|
duration.setVisibility(media.getDuration() > 0 ? View.VISIBLE : View.GONE);
|
||||||
duration.setText(Converter.getDurationStringLong(media.getDuration()));
|
duration.setText(Converter.getDurationStringLong(media.getDuration()));
|
||||||
|
|
||||||
if (media.isCurrentlyPlaying()) {
|
if (media.isCurrentlyPlaying()) {
|
||||||
|
@ -151,12 +156,10 @@ public class EpisodeItemViewHolder extends FeedComponentViewHolder
|
||||||
secondaryActionProgress.setPercentage(0, item); // Animate X% -> 0%
|
secondaryActionProgress.setPercentage(0, item); // Animate X% -> 0%
|
||||||
}
|
}
|
||||||
|
|
||||||
if (media.getDuration() > 0
|
if (item.getState() == FeedItem.State.PLAYING || item.getState() == FeedItem.State.IN_PROGRESS) {
|
||||||
&& (item.getState() == FeedItem.State.PLAYING || item.getState() == FeedItem.State.IN_PROGRESS)) {
|
|
||||||
int progress = (int) (100.0 * media.getPosition() / media.getDuration());
|
int progress = (int) (100.0 * media.getPosition() / media.getDuration());
|
||||||
progressBar.setProgress(progress);
|
progressBar.setProgress(progress);
|
||||||
position.setText(Converter.getDurationStringLong(media.getPosition()));
|
position.setText(Converter.getDurationStringLong(media.getPosition()));
|
||||||
duration.setText(Converter.getDurationStringLong(media.getDuration()));
|
|
||||||
progressBar.setVisibility(View.VISIBLE);
|
progressBar.setVisibility(View.VISIBLE);
|
||||||
position.setVisibility(View.VISIBLE);
|
position.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue