Search in sources :

Example 1 with ScriptLoopDialog

use of com.stardust.scriptdroid.ui.common.ScriptLoopDialog in project Auto.js by hyb1996.

the class ScriptListView method onMenuItemClick.

@Override
public boolean onMenuItemClick(MenuItem item) {
    switch(item.getItemId()) {
        case R.id.rename:
            new ScriptOperations(getContext(), this).rename(mSelectedScriptFile).subscribe();
            break;
        case R.id.delete:
            new ScriptOperations(getContext(), this).delete(mSelectedScriptFile);
            break;
        case R.id.run_repeatedly:
            new ScriptLoopDialog(getContext(), mSelectedScriptFile).show();
            notifyOperated();
            break;
        case R.id.create_shortcut:
            new ScriptOperations(getContext(), this).createShortcut(mSelectedScriptFile);
            break;
        case R.id.open_by_other_apps:
            Scripts.openByOtherApps(mSelectedScriptFile);
            notifyOperated();
            break;
        case R.id.send:
            Scripts.send(mSelectedScriptFile);
            notifyOperated();
            break;
        case R.id.timed_task:
            new ScriptOperations(getContext(), this).timedTask(mSelectedScriptFile);
            notifyOperated();
            break;
        case R.id.action_build_apk:
            BuildActivity_.intent(getContext()).extra(BuildActivity.EXTRA_SOURCE_FILE, mSelectedScriptFile.getPath()).start();
            notifyOperated();
            break;
        case R.id.action_sort_by_date:
            sort(ScriptList.SORT_TYPE_DATE, mDirSortMenuShowing);
            break;
        case R.id.action_sort_by_type:
            sort(ScriptList.SORT_TYPE_TYPE, mDirSortMenuShowing);
            break;
        case R.id.action_sort_by_name:
            sort(ScriptList.SORT_TYPE_NAME, mDirSortMenuShowing);
            break;
        case R.id.action_sort_by_size:
            sort(ScriptList.SORT_TYPE_SIZE, mDirSortMenuShowing);
            break;
        default:
            return false;
    }
    return true;
}
Also used : ScriptLoopDialog(com.stardust.scriptdroid.ui.common.ScriptLoopDialog) ScriptOperations(com.stardust.scriptdroid.ui.common.ScriptOperations)

Aggregations

ScriptLoopDialog (com.stardust.scriptdroid.ui.common.ScriptLoopDialog)1 ScriptOperations (com.stardust.scriptdroid.ui.common.ScriptOperations)1