Search in sources :

Example 1 with ThemeColorMaterialDialogBuilder

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();
}
Also used : Bundle(android.os.Bundle) PackageManager(android.content.pm.PackageManager) ButterKnife(butterknife.ButterKnife) ShortcutActivity(com.stardust.scriptdroid.external.shortcut.ShortcutActivity) ImageView(android.widget.ImageView) Intent(android.content.Intent) BitmapFactory(android.graphics.BitmapFactory) RequiresApi(android.support.annotation.RequiresApi) R(com.stardust.scriptdroid.R) AndroidSchedulers(io.reactivex.android.schedulers.AndroidSchedulers) OnClick(butterknife.OnClick) BindView(butterknife.BindView) ScriptIntents(com.stardust.scriptdroid.external.ScriptIntents) CheckBox(android.widget.CheckBox) BitmapTool(com.stardust.scriptdroid.tool.BitmapTool) PersistableBundle(android.os.PersistableBundle) View(android.view.View) Observable(io.reactivex.Observable) Schedulers(io.reactivex.schedulers.Schedulers) Icon(android.graphics.drawable.Icon) Build(android.os.Build) Log(android.util.Log) ScriptFile(com.stardust.scriptdroid.model.script.ScriptFile) ThemeColorMaterialDialogBuilder(com.stardust.theme.dialog.ThemeColorMaterialDialogBuilder) AppCompatActivity(android.support.v7.app.AppCompatActivity) ShortcutManager(com.stardust.scriptdroid.external.shortcut.ShortcutManager) TextView(android.widget.TextView) Bitmap(android.graphics.Bitmap) Nullable(android.support.annotation.Nullable) Shortcut(com.stardust.scriptdroid.external.shortcut.Shortcut) ThemeColorMaterialDialogBuilder(com.stardust.theme.dialog.ThemeColorMaterialDialogBuilder) ImageView(android.widget.ImageView) BindView(butterknife.BindView) View(android.view.View) TextView(android.widget.TextView)

Example 2 with ThemeColorMaterialDialogBuilder

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);
}
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 3 with ThemeColorMaterialDialogBuilder

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;
}
Also used : ThemeColorMaterialDialogBuilder(com.stardust.theme.dialog.ThemeColorMaterialDialogBuilder)

Aggregations

ThemeColorMaterialDialogBuilder (com.stardust.theme.dialog.ThemeColorMaterialDialogBuilder)3 OnClick (butterknife.OnClick)2 Intent (android.content.Intent)1 PackageManager (android.content.pm.PackageManager)1 Bitmap (android.graphics.Bitmap)1 BitmapFactory (android.graphics.BitmapFactory)1 Icon (android.graphics.drawable.Icon)1 Build (android.os.Build)1 Bundle (android.os.Bundle)1 PersistableBundle (android.os.PersistableBundle)1 Nullable (android.support.annotation.Nullable)1 RequiresApi (android.support.annotation.RequiresApi)1 AppCompatActivity (android.support.v7.app.AppCompatActivity)1 Log (android.util.Log)1 View (android.view.View)1 CheckBox (android.widget.CheckBox)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 BindView (butterknife.BindView)1 ButterKnife (butterknife.ButterKnife)1