Fix GlideImagesPlugin.create(Context) factory method
This commit is contained in:
parent
dfa21f68e2
commit
7f6d85e1fb
@ -9,10 +9,15 @@
|
|||||||
#### Changed
|
#### Changed
|
||||||
* `html` - `SimpleTagHandler` visits children tags if supplied tag is block one ([#235])
|
* `html` - `SimpleTagHandler` visits children tags if supplied tag is block one ([#235])
|
||||||
|
|
||||||
|
#### Fixed
|
||||||
|
* `image-glide` cache `RequestManager` in `GlideImagesPlugin#create(Context)` factory method ([#259])
|
||||||
|
|
||||||
#### Deprecated
|
#### Deprecated
|
||||||
* `core` - `MovementMethodPlugin.create()` use explicit `MovementMethodPlugin.link()` instead
|
* `core` - `MovementMethodPlugin.create()` use explicit `MovementMethodPlugin.link()` instead
|
||||||
|
|
||||||
[#235]: https://github.com/noties/Markwon/issues/235
|
[#235]: https://github.com/noties/Markwon/issues/235
|
||||||
|
[#259]: https://github.com/noties/Markwon/issues/259
|
||||||
|
|
||||||
|
|
||||||
# 4.4.0
|
# 4.4.0
|
||||||
* `TextViewSpan` to obtain `TextView` in which markdown is displayed (applied by `CorePlugin`)
|
* `TextViewSpan` to obtain `TextView` in which markdown is displayed (applied by `CorePlugin`)
|
||||||
|
@ -44,20 +44,10 @@ public class GlideImagesPlugin extends AbstractMarkwonPlugin {
|
|||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public static GlideImagesPlugin create(@NonNull final Context context) {
|
public static GlideImagesPlugin create(@NonNull final Context context) {
|
||||||
return create(new GlideStore() {
|
// @since $nap; cache RequestManager
|
||||||
@NonNull
|
// sometimes `cancel` would be called after activity is destroyed,
|
||||||
@Override
|
// so `Glide.with(context)` will throw an exception
|
||||||
public RequestBuilder<Drawable> load(@NonNull AsyncDrawable drawable) {
|
return create(Glide.with(context));
|
||||||
return Glide.with(context)
|
|
||||||
.load(drawable.getDestination());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void cancel(@NonNull Target<?> target) {
|
|
||||||
Glide.with(context)
|
|
||||||
.clear(target);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
|
Loading…
x
Reference in New Issue
Block a user