use of com.bumptech.glide.Glide in project FastHub by k0shk0sh.
the class BaseActivity method onRequireLogin.
@Override
public void onRequireLogin() {
Toasty.warning(App.getInstance(), getString(R.string.unauthorized_user), Toast.LENGTH_LONG).show();
final Glide glide = Glide.get(App.getInstance());
getPresenter().manageViewDisposable(RxHelper.getObservable(Observable.fromCallable(() -> {
glide.clearDiskCache();
PrefGetter.setToken(null);
PrefGetter.setOtpCode(null);
PrefGetter.resetEnterprise();
Login.logout();
return true;
})).subscribe(aBoolean -> {
glide.clearMemory();
Intent intent = new Intent(this, LoginChooserActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finishAffinity();
}));
}
use of com.bumptech.glide.Glide in project glide by bumptech.
the class RequestManagerRetriever method fragmentGet.
@SuppressWarnings({ "deprecation", "DeprecatedIsStillUsed" })
@Deprecated
@NonNull
private RequestManager fragmentGet(@NonNull Context context, @NonNull android.app.FragmentManager fm, @Nullable android.app.Fragment parentHint, boolean isParentVisible) {
RequestManagerFragment current = getRequestManagerFragment(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.Glide in project glide by bumptech.
the class GifFrameLoaderTest method createGifFrameLoader.
@NonNull
private GifFrameLoader createGifFrameLoader(Handler handler) {
Glide glide = getGlideSingleton();
GifFrameLoader result = new GifFrameLoader(glide.getBitmapPool(), requestManager, gifDecoder, handler, requestBuilder, transformation, firstFrame);
result.subscribe(callback);
return result;
}
use of com.bumptech.glide.Glide in project glide by bumptech.
the class RequestManagerRetriever method supportFragmentGet.
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 = new RequestManager(glide, current.getLifecycle(), current.getRequestManagerTreeNode());
current.setRequestManager(requestManager);
}
return requestManager;
}
use of com.bumptech.glide.Glide in project glide by bumptech.
the class RequestManagerRetriever method fragmentGet.
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
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 = new RequestManager(glide, current.getLifecycle(), current.getRequestManagerTreeNode());
current.setRequestManager(requestManager);
}
return requestManager;
}
Aggregations