Search in sources :

Example 1 with ScriptListView

use of com.stardust.scriptdroid.ui.main.scripts.ScriptListView in project Auto.js by hyb1996.

the class CircularMenu method showScriptList.

@Optional
@OnClick(R.id.script_list)
void showScriptList() {
    mWindow.collapse();
    ScriptListView listView = new ScriptListView(mContext);
    listView.setStorageFileProvider(StorageFileProvider.getDefault());
    listView.setDirectorySpanSize(2);
    final MaterialDialog dialog = new ThemeColorMaterialDialogBuilder(mContext).title(R.string.text_run_script).customView(listView, false).positiveText(R.string.cancel).build();
    listView.setOnItemOperatedListener(file -> dialog.dismiss());
    listView.setOnScriptFileClickListener((view, file) -> Scripts.run(file));
    DialogUtils.showDialog(dialog);
}
Also used : MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) ThemeColorMaterialDialogBuilder(com.stardust.theme.dialog.ThemeColorMaterialDialogBuilder) ScriptListView(com.stardust.scriptdroid.ui.main.scripts.ScriptListView) Optional(butterknife.Optional) OnClick(butterknife.OnClick)

Example 2 with ScriptListView

use of com.stardust.scriptdroid.ui.main.scripts.ScriptListView in project Auto.js by hyb1996.

the class TaskPrefEditActivity method initScriptListRecyclerView.

private void initScriptListRecyclerView() {
    mStorageFileProvider = StorageFileProvider.getExternalStorageProvider();
    ScriptListView scriptList = (ScriptListView) findViewById(R.id.script_list);
    scriptList.setStorageFileProvider(mStorageFileProvider, new ScriptFile(StorageFileProvider.DEFAULT_DIRECTORY));
    scriptList.setOnScriptFileClickListener((view, file) -> {
        mSelectedScriptFilePath = file.getPath();
        finish();
    });
}
Also used : ScriptFile(com.stardust.scriptdroid.model.script.ScriptFile) ScriptListView(com.stardust.scriptdroid.ui.main.scripts.ScriptListView)

Example 3 with ScriptListView

use of com.stardust.scriptdroid.ui.main.scripts.ScriptListView in project Auto.js by hyb1996.

the class ScriptWidgetSettingsActivity method initScriptListRecyclerView.

private void initScriptListRecyclerView() {
    mStorageFileProvider = StorageFileProvider.getExternalStorageProvider();
    ScriptListView scriptList = (ScriptListView) findViewById(R.id.script_list);
    scriptList.setStorageFileProvider(mStorageFileProvider);
    scriptList.setCurrentDirectory(new ScriptFile(StorageFileProvider.DEFAULT_DIRECTORY));
    scriptList.setOnScriptFileClickListener((view, file) -> {
        mSelectedScriptFilePath = file.getPath();
        finish();
    });
}
Also used : ScriptFile(com.stardust.scriptdroid.model.script.ScriptFile) ScriptListView(com.stardust.scriptdroid.ui.main.scripts.ScriptListView)

Aggregations

ScriptListView (com.stardust.scriptdroid.ui.main.scripts.ScriptListView)3 ScriptFile (com.stardust.scriptdroid.model.script.ScriptFile)2 OnClick (butterknife.OnClick)1 Optional (butterknife.Optional)1 MaterialDialog (com.afollestad.materialdialogs.MaterialDialog)1 ThemeColorMaterialDialogBuilder (com.stardust.theme.dialog.ThemeColorMaterialDialogBuilder)1