use of com.stardust.theme.dialog.ThemeColorMaterialDialogBuilder in project Auto.js by hyb1996.
the class ShortcutCreateActivity method showDialog.
private void showDialog() {
View view = View.inflate(this, R.layout.shortcut_create_dialog, null);
ButterKnife.bind(this, view);
mUseAndroidNShortcut.setVisibility(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N ? View.VISIBLE : View.GONE);
mName.setText(mScriptFile.getSimplifiedName());
new ThemeColorMaterialDialogBuilder(this).customView(view, false).title(R.string.text_send_shortcut).positiveText(R.string.ok).onPositive((dialog, which) -> {
createShortcut();
finish();
}).cancelListener(dialog -> finish()).show();
}
use of com.stardust.theme.dialog.ThemeColorMaterialDialogBuilder 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);
}
use of com.stardust.theme.dialog.ThemeColorMaterialDialogBuilder in project Auto.js by hyb1996.
the class ScriptOperations method showNameInputDialog.
private Observable<String> showNameInputDialog(String prefix, MaterialDialog.InputCallback textWatcher) {
final PublishSubject<String> input = PublishSubject.create();
DialogUtils.showDialog(new ThemeColorMaterialDialogBuilder(mContext).title(R.string.text_name).inputType(InputType.TYPE_CLASS_TEXT).alwaysCallInputCallback().input(getString(R.string.text_please_input_name), prefix, false, textWatcher).onPositive((dialog, which) -> {
input.onNext(dialog.getInputEditText().getText().toString());
input.onComplete();
}).build());
return input;
}
Aggregations