diff options
author | ByteHamster <info@bytehamster.com> | 2020-01-20 16:25:57 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2020-01-20 16:26:00 +0100 |
commit | 499db625c01caa950f581e8944c02631e985d72e (patch) | |
tree | 33387129beedff0da19d58d8cfca0523d3969209 /app/src/main/java/de/danoeh | |
parent | 2f0c627b15af26aace320e1984d6f398a7ee0abe (diff) | |
download | AntennaPod-499db625c01caa950f581e8944c02631e985d72e.zip |
Fix weird behavior in CoverLoader
If you had an episode in the queue without a cover, it first showed the placeholder text.
After scrolling, the placeholder text was hidden and then there was just nothing at all.
This was inconsistent and confusing.
Now, always shows the placeholder (while loading and on error), making sure to update visibility.
Diffstat (limited to 'app/src/main/java/de/danoeh')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java | 13 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java | 1 |
2 files changed, 3 insertions, 11 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java b/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java index 098e9a616..5acc25bee 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java @@ -24,7 +24,6 @@ public class CoverLoader { private TextView txtvPlaceholder; private ImageView imgvCover; private MainActivity activity; - private int errorResource = -1; public CoverLoader(MainActivity activity) { this.activity = activity; @@ -45,11 +44,6 @@ public class CoverLoader { return this; } - public CoverLoader withError(int errorResource) { - this.errorResource = errorResource; - return this; - } - public CoverLoader withPlaceholderView(TextView placeholderView) { txtvPlaceholder = placeholderView; return this; @@ -61,10 +55,6 @@ public class CoverLoader { .fitCenter() .dontAnimate(); - if (errorResource != -1) { - options = options.error(errorResource); - } - RequestBuilder<Drawable> builder = Glide.with(activity) .load(uri) .apply(options); @@ -84,6 +74,9 @@ public class CoverLoader { public CoverTarget(TextView txtvPlaceholder, ImageView imgvCover) { super(imgvCover); + if (txtvPlaceholder != null) { + txtvPlaceholder.setVisibility(View.VISIBLE); + } placeholder = new WeakReference<>(txtvPlaceholder); cover = new WeakReference<>(imgvCover); } diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java index 3141c6046..a012211a5 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java @@ -98,7 +98,6 @@ public class SubscriptionsAdapter extends BaseAdapter implements AdapterView.OnI .withUri(feed.getImageLocation()) .withPlaceholderView(holder.feedTitle) .withCoverView(holder.imageView) - .withError(R.color.light_gray) .load(); return convertView; |