use of com.bumptech.glide.RequestManager in project Rocket by mozilla-tw.
the class RequestManagerRetriever method supportFragmentGet.
private RequestManager supportFragmentGet(Context context, FragmentManager fm, Fragment parentHint) {
SupportRequestManagerFragment current = getSupportRequestManagerFragment(fm, parentHint);
RequestManager requestManager = current.getRequestManager();
if (requestManager == null) {
// TODO(b/27524013): Factor out this Glide.get() call.
Glide glide = Glide.get(context);
requestManager = factory.build(glide, current.getGlideLifecycle(), current.getRequestManagerTreeNode());
current.setRequestManager(requestManager);
}
return requestManager;
}
use of com.bumptech.glide.RequestManager in project Rocket by mozilla-tw.
the class RequestManagerRetriever method fragmentGet.
private RequestManager fragmentGet(Context context, android.app.FragmentManager fm, android.app.Fragment parentHint) {
RequestManagerFragment current = getRequestManagerFragment(fm, parentHint);
RequestManager requestManager = current.getRequestManager();
if (requestManager == null) {
// TODO(b/27524013): Factor out this Glide.get() call.
Glide glide = Glide.get(context);
requestManager = factory.build(glide, current.getGlideLifecycle(), current.getRequestManagerTreeNode());
current.setRequestManager(requestManager);
}
return requestManager;
}
use of com.bumptech.glide.RequestManager in project AndroidStudy by tinggengyan.
the class GlideMainActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_imageview);
prescale_iamgeview = (ImageView) findViewById(R.id.prescale_iamgeview);
RequestManager requestManager = Glide.with(this);
requestManager.load(Constants.IMAGES[0]).placeholder(R.drawable.accept).diskCacheStrategy(DiskCacheStrategy.NONE).override(100, 100).listener(new RequestListener<String, GlideDrawable>() {
@Override
public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) {
return false;
}
@Override
public boolean onResourceReady(GlideDrawable resource, String model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) {
return false;
}
}).into(prescale_iamgeview);
requestManager.load(Constants.IMAGES[1]).diskCacheStrategy(DiskCacheStrategy.SOURCE).preload();
downloadImage(prescale_iamgeview);
}
use of com.bumptech.glide.RequestManager in project glide by bumptech.
the class RequestManagerRetriever method supportFragmentGet.
@NonNull
private RequestManager supportFragmentGet(@NonNull Context context, @NonNull FragmentManager fm, @Nullable Fragment parentHint, boolean isParentVisible) {
SupportRequestManagerFragment current = getSupportRequestManagerFragment(fm, parentHint, isParentVisible);
RequestManager requestManager = current.getRequestManager();
if (requestManager == null) {
// TODO(b/27524013): Factor out this Glide.get() call.
Glide glide = Glide.get(context);
requestManager = factory.build(glide, current.getGlideLifecycle(), current.getRequestManagerTreeNode(), context);
current.setRequestManager(requestManager);
}
return requestManager;
}
use of com.bumptech.glide.RequestManager in project glide by bumptech.
the class RequestManagerRetrieverTest method testApplicationRequestManagerIsNotReResumedAfterFirstRetrieval.
@Test
public void testApplicationRequestManagerIsNotReResumedAfterFirstRetrieval() {
RequestManager manager = retriever.get(RuntimeEnvironment.application);
manager.pauseRequests();
manager = retriever.get(RuntimeEnvironment.application);
assertTrue(manager.isPaused());
}
Aggregations