Java Code Examples for com.gianlu.commonutils.ui.Toaster#message()

The following examples show how to use com.gianlu.commonutils.ui.Toaster#message() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Aria2Helper.java    From Aria2App with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onResult(@NonNull Download.RemoveResult result) {
    Toaster toaster = Toaster.build();
    toaster.extra(download.gid);
    switch (result) {
        case REMOVED:
            toaster.message(R.string.downloadRemoved);
            break;
        case REMOVED_RESULT:
        case REMOVED_RESULT_AND_METADATA:
            toaster.message(R.string.downloadResultRemoved);
            break;
        default:
            toaster.message(R.string.failedAction);
            break;
    }

    listener.showToast(toaster);
}
 
Example 2
Source File: Aria2Helper.java    From Aria2App with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onSuccess() {
    Toaster toaster = Toaster.build();
    toaster.extra(download.gid);
    switch (what) {
        case RESTART:
            toaster.message(R.string.downloadRestarted);
            break;
        case RESUME:
            toaster.message(R.string.downloadResumed);
            break;
        case PAUSE:
            toaster.message(R.string.downloadPaused);
            break;
        case MOVE_DOWN:
        case MOVE_UP:
            toaster.message(R.string.downloadMoved);
            break;
        case STOP: // Not called here
        case REMOVE: // Not called here
        default:
            toaster.message(R.string.failedAction);
            break;
    }

    listener.showToast(toaster);
}