Search in sources :

Example 1 with DismissResult

use of org.fdroid.fdroid.views.updates.DismissResult in project fdroidclient by f-droid.

the class AppStatusListItemController method onDismissApp.

@NonNull
@Override
protected DismissResult onDismissApp(@NonNull App app) {
    AppUpdateStatus status = getCurrentStatus();
    CharSequence message = null;
    if (status != null) {
        AppUpdateStatusManager manager = AppUpdateStatusManager.getInstance(activity);
        manager.removeApk(status.getUniqueKey());
        switch(status.status) {
            case ReadyToInstall:
                manager.markAsNoLongerPendingInstall(status);
                // of a "Ready to install" app being dismissed.
                break;
            case Downloading:
                cancelDownload();
                message = activity.getString(R.string.app_list__dismiss_downloading_app);
                break;
        }
    }
    return new DismissResult(message, true);
}
Also used : DismissResult(org.fdroid.fdroid.views.updates.DismissResult) AppUpdateStatus(org.fdroid.fdroid.AppUpdateStatusManager.AppUpdateStatus) AppUpdateStatusManager(org.fdroid.fdroid.AppUpdateStatusManager) NonNull(android.support.annotation.NonNull)

Example 2 with DismissResult

use of org.fdroid.fdroid.views.updates.DismissResult in project fdroidclient by f-droid.

the class UpdateableAppListItemController method onDismissApp.

@Override
@NonNull
protected DismissResult onDismissApp(@NonNull App app) {
    AppPrefs prefs = app.getPrefs(activity);
    prefs.ignoreThisUpdate = app.suggestedVersionCode;
    // The act of updating here will trigger a re-query of the "can update" apps, so no need to do anything else
    // to update the UI in response to this.
    AppPrefsProvider.Helper.update(activity, app, prefs);
    return new DismissResult(activity.getString(R.string.app_list__dismiss_app_update), false);
}
Also used : DismissResult(org.fdroid.fdroid.views.updates.DismissResult) AppPrefs(org.fdroid.fdroid.data.AppPrefs) NonNull(android.support.annotation.NonNull)

Aggregations

NonNull (android.support.annotation.NonNull)2 DismissResult (org.fdroid.fdroid.views.updates.DismissResult)2 AppUpdateStatusManager (org.fdroid.fdroid.AppUpdateStatusManager)1 AppUpdateStatus (org.fdroid.fdroid.AppUpdateStatusManager.AppUpdateStatus)1 AppPrefs (org.fdroid.fdroid.data.AppPrefs)1