Merge pull request #3773 from ByteHamster/fix-cover-loader

Fix weird behavior in CoverLoader
This commit is contained in:
H. Lehmann 2020-01-20 18:26:28 +01:00 committed by GitHub
commit 404534fd83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 11 deletions

View File

@ -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);
}

View File

@ -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;