Add AsyncDrawableLoader.Builder#implementation method
This commit is contained in:
parent
8a3cdfff04
commit
29ebfebfd8
@ -6,7 +6,7 @@ org.gradle.configureondemand=true
|
||||
android.enableBuildCache=true
|
||||
android.buildCacheDir=build/pre-dex-cache
|
||||
|
||||
VERSION_NAME=3.0.0
|
||||
VERSION_NAME=3.0.1-SNAPSHOT
|
||||
|
||||
GROUP=ru.noties.markwon
|
||||
POM_DESCRIPTION=Markwon markdown for Android
|
||||
|
@ -53,6 +53,8 @@ public abstract class AsyncDrawableLoader {
|
||||
DrawableProvider placeholderDrawableProvider;
|
||||
DrawableProvider errorDrawableProvider;
|
||||
|
||||
AsyncDrawableLoader implementation;
|
||||
|
||||
@NonNull
|
||||
public Builder executorService(@NonNull ExecutorService executorService) {
|
||||
this.executorService = executorService;
|
||||
@ -123,9 +125,29 @@ public abstract class AsyncDrawableLoader {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Please note that if implementation is supplied, all configuration properties
|
||||
* (scheme-handlers, media-decoders, placeholder, etc) of this builder instance
|
||||
* will be ignored.
|
||||
*
|
||||
* @param implementation {@link AsyncDrawableLoader} implementation to be used.
|
||||
* @since 3.0.1-SNAPSHOT
|
||||
*/
|
||||
@NonNull
|
||||
public Builder implementation(@NonNull AsyncDrawableLoader implementation) {
|
||||
this.implementation = implementation;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public AsyncDrawableLoader build() {
|
||||
|
||||
// NB, all other configuration properties will be ignored if
|
||||
// implementation is specified
|
||||
if (implementation != null) {
|
||||
return implementation;
|
||||
}
|
||||
|
||||
// if we have no schemeHandlers -> we cannot show anything
|
||||
// OR if we have no media decoders
|
||||
if (schemeHandlers.size() == 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user