Search in sources :

Example 1 with Glide

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();
    }));
}
Also used : NavigationView(android.support.design.widget.NavigationView) Toasty(es.dmoral.toasty.Toasty) Bundle(android.os.Bundle) LoginChooserActivity(com.fastaccess.ui.modules.login.chooser.LoginChooserActivity) App(com.fastaccess.App) InputHelper(com.fastaccess.helper.InputHelper) OnClick(butterknife.OnClick) BindView(butterknife.BindView) RxHelper(com.fastaccess.helper.RxHelper) Bundler(com.fastaccess.helper.Bundler) ThemeEngine(com.fastaccess.provider.theme.ThemeEngine) View(android.view.View) MainDrawerFragment(com.fastaccess.ui.modules.main.drawer.MainDrawerFragment) BasePresenter(com.fastaccess.ui.base.mvp.presenter.BasePresenter) OrgListDialogFragment(com.fastaccess.ui.modules.main.orgs.OrgListDialogFragment) BundleConstant(com.fastaccess.helper.BundleConstant) Login(com.fastaccess.data.dao.model.Login) Optional(butterknife.Optional) TiActivity(net.grandcentrix.thirtyinch.TiActivity) GistActivity(com.fastaccess.ui.modules.gists.gist.GistActivity) PrefGetter(com.fastaccess.helper.PrefGetter) PlayStoreWarningActivity(com.fastaccess.ui.modules.main.playstore.PlayStoreWarningActivity) ViewHelper(com.fastaccess.helper.ViewHelper) Nullable(android.support.annotation.Nullable) SettingsActivity(com.fastaccess.ui.modules.settings.SettingsActivity) ActivityManager(android.app.ActivityManager) Context(android.content.Context) AppBarLayout(android.support.design.widget.AppBarLayout) ActivityHelper(com.fastaccess.helper.ActivityHelper) ButterKnife(butterknife.ButterKnife) FastHubNotification(com.fastaccess.data.dao.model.FastHubNotification) ViewPager(android.support.v4.view.ViewPager) Intent(android.content.Intent) StringRes(android.support.annotation.StringRes) NonNull(android.support.annotation.NonNull) MenuItem(android.view.MenuItem) ArrayList(java.util.ArrayList) GravityCompat(android.support.v4.view.GravityCompat) ChangelogBottomSheetDialog(com.fastaccess.ui.modules.changelog.ChangelogBottomSheetDialog) Toast(android.widget.Toast) Menu(android.view.Menu) FragmentsPagerAdapter(com.fastaccess.ui.adapter.FragmentsPagerAdapter) Observable(io.reactivex.Observable) State(com.evernote.android.state.State) StateSaver(com.evernote.android.state.StateSaver) MainActivity(com.fastaccess.ui.modules.main.MainActivity) DrawerLayout(android.support.v4.widget.DrawerLayout) PullRequestPagerActivity(com.fastaccess.ui.modules.repos.pull_requests.pull_request.details.PullRequestPagerActivity) AppHelper(com.fastaccess.helper.AppHelper) BaseMvp(com.fastaccess.ui.base.mvp.BaseMvp) IssuePagerActivity(com.fastaccess.ui.modules.repos.issues.issue.details.IssuePagerActivity) TextUtils(android.text.TextUtils) MessageDialogView(com.fastaccess.ui.widgets.dialog.MessageDialogView) IdRes(android.support.annotation.IdRes) CommitPagerActivity(com.fastaccess.ui.modules.repos.code.commit.details.CommitPagerActivity) ProgressDialogFragment(com.fastaccess.ui.widgets.dialog.ProgressDialogFragment) DrawableRes(android.support.annotation.DrawableRes) Glide(com.bumptech.glide.Glide) R(com.fastaccess.R) LayoutRes(android.support.annotation.LayoutRes) Toolbar(android.support.v7.widget.Toolbar) ViewTreeObserver(android.view.ViewTreeObserver) CachedComments(com.fastaccess.provider.markdown.CachedComments) FastHubNotificationDialog(com.fastaccess.ui.modules.main.notifications.FastHubNotificationDialog) Intent(android.content.Intent) LoginChooserActivity(com.fastaccess.ui.modules.login.chooser.LoginChooserActivity) Glide(com.bumptech.glide.Glide)

Example 2 with Glide

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;
}
Also used : RequestManager(com.bumptech.glide.RequestManager) Glide(com.bumptech.glide.Glide) NonNull(android.support.annotation.NonNull)

Example 3 with Glide

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;
}
Also used : TearDownGlide(com.bumptech.glide.tests.TearDownGlide) Glide(com.bumptech.glide.Glide) NonNull(android.support.annotation.NonNull)

Example 4 with Glide

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;
}
Also used : RequestManager(com.bumptech.glide.RequestManager) Glide(com.bumptech.glide.Glide)

Example 5 with Glide

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;
}
Also used : RequestManager(com.bumptech.glide.RequestManager) Glide(com.bumptech.glide.Glide) TargetApi(android.annotation.TargetApi)

Aggregations

Glide (com.bumptech.glide.Glide)11 NonNull (android.support.annotation.NonNull)6 RequestManager (com.bumptech.glide.RequestManager)6 Context (android.content.Context)2 Intent (android.content.Intent)2 Bundle (android.os.Bundle)2 Toast (android.widget.Toast)2 App (com.fastaccess.App)2 R (com.fastaccess.R)2 InputHelper (com.fastaccess.helper.InputHelper)2 Manifest (android.Manifest)1 TargetApi (android.annotation.TargetApi)1 RESULT_OK (android.app.Activity.RESULT_OK)1 ActivityManager (android.app.ActivityManager)1 PackageManager (android.content.pm.PackageManager)1 RingtoneManager (android.media.RingtoneManager)1 Uri (android.net.Uri)1 Environment (android.os.Environment)1 DrawableRes (android.support.annotation.DrawableRes)1 IdRes (android.support.annotation.IdRes)1