use of com.stardust.autojs.core.ui.inflater.ImageLoader in project Auto.js by hyb1996.
the class App method onCreate.
@Override
public void onCreate() {
super.onCreate();
sApp = this;
AutoJs.initInstance(this);
GlobalKeyObserver.init();
Drawables.setDefaultImageLoader(new ImageLoader() {
@Override
public void loadInto(ImageView imageView, Uri uri) {
Glide.with(App.this).load(uri).into(imageView);
}
@Override
public void loadIntoBackground(View view, Uri uri) {
Glide.with(App.this).load(uri).into(new SimpleTarget<Drawable>() {
@Override
public void onResourceReady(Drawable resource, Transition<? super Drawable> transition) {
view.setBackground(resource);
}
});
}
@Override
public Drawable load(View view, Uri uri) {
throw new UnsupportedOperationException();
}
@Override
public void load(View view, Uri uri, DrawableCallback drawableCallback) {
Glide.with(App.this).load(uri).into(new SimpleTarget<Drawable>() {
@Override
public void onResourceReady(Drawable resource, Transition<? super Drawable> transition) {
drawableCallback.onLoaded(resource);
}
});
}
@Override
public void load(View view, Uri uri, BitmapCallback bitmapCallback) {
Glide.with(App.this).asBitmap().load(uri).into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap resource, Transition<? super Bitmap> transition) {
bitmapCallback.onLoaded(resource);
}
});
}
});
}
Aggregations