Merge pull request #3773 from ByteHamster/fix-cover-loader
Fix weird behavior in CoverLoader
This commit is contained in:
commit
404534fd83
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue