mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
Custom glide builder now also accepts a custom url
This commit is contained in:
parent
231eab549c
commit
8243173e29
24 changed files with 54 additions and 26 deletions
|
|
@ -55,16 +55,25 @@ public class CustomGlideRequest {
|
|||
private final RequestManager requestManager;
|
||||
private final Object item;
|
||||
|
||||
private Builder(Context context, String item, String category) {
|
||||
private Builder(Context context, String item, String category, String custom) {
|
||||
this.requestManager = Glide.with(context);
|
||||
this.item = item != null ? createUrl(item) : MusicUtil.getDefaultPicPerCategory(category);
|
||||
|
||||
if(item != null) {
|
||||
this.item = createUrl(item);
|
||||
}
|
||||
else if(custom != null) {
|
||||
this.item = custom;
|
||||
}
|
||||
else {
|
||||
this.item = MusicUtil.getDefaultPicPerCategory(category);
|
||||
}
|
||||
|
||||
Drawable drawable = ResourcesCompat.getDrawable(context.getResources(), MusicUtil.getDefaultPicPerCategory(category), null);
|
||||
requestManager.applyDefaultRequestOptions(createRequestOptions(item, drawable));
|
||||
}
|
||||
|
||||
public static Builder from(Context context, String item, String category) {
|
||||
return new Builder(context, item, category);
|
||||
public static Builder from(Context context, String item, String category, String custom) {
|
||||
return new Builder(context, item, category, custom);
|
||||
}
|
||||
|
||||
public BitmapBuilder bitmap() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue