android.app.Dialog.setTitle()

Here are the examples of the java api android.app.Dialog.setTitle() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

65 Examples 7

19 Source : AnswerInputActivity.java
with GNU General Public License v3.0
from tianyuan168326

public void onEventMainThread(PostAnswerFailEvent e) {
    if (waitingDialog != null) {
        waitingDialog.setreplacedle("添加失败( ▼-▼ )");
        new Handler().postDelayed(new Runnable() {

            @Override
            public void run() {
                waitingDialog.dismiss();
                finish();
            }
        }, 200);
    }
}

19 Source : DiscoverySelector.java
with Apache License 2.0
from tharvey

private void updatereplacedle() {
    String dots = "...............";
    int ndots = mCount;
    if (ndots > dots.length())
        ndots = dots.length();
    mDialog.setreplacedle("Nearby Robots: " + mPhase + dots.substring(0, ndots));
}

19 Source : OnlineInitializer.java
with Apache License 2.0
from osudroid

public void createInitDialog() {
    registerDialog = new Dialog(activity);
    registerDialog.setContentView(R.layout.register_dialog);
    registerDialog.setreplacedle(StringTable.get(R.string.online_registration));
    Button btn = (Button) registerDialog.findViewById(R.id.register_btn);
    if (btn != null)
        btn.setOnClickListener(this);
    btn = (Button) registerDialog.findViewById(R.id.cancel_btn);
    if (btn != null)
        btn.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                registerDialog.dismiss();
            }
        });
    registerDialog.show();
}

19 Source : QueryPhoneNumberActivity.java
with Apache License 2.0
from InnoFang

private void initView() {
    mProvinceTextView = (TextView) findViewById(R.id.text_view_province);
    mCityTextView = (TextView) findViewById(R.id.text_view_city);
    mAreaCodeTextView = (TextView) findViewById(R.id.text_view_area_code);
    mZipTextView = (TextView) findViewById(R.id.text_view_zip);
    mCompanyTextView = (TextView) findViewById(R.id.text_view_company);
    mInputPhoneNumberEditText = (EditText) findViewById(R.id.input_phone_number_edit_text);
    mQueryPhoneNumberButton = (Button) findViewById(R.id.query_phone_number_button);
    mPhoneNumberPresenter = new QueryPhoneNumberPresenter(this);
    mLoadingDialog = new ProgressDialog(this);
    mLoadingDialog.setreplacedle("正在查询...");
    mQueryPhoneNumberButton.setOnClickListener(this);
}

19 Source : PinDialogPreference.java
with GNU General Public License v2.0
from dsolonenko

@Override
public void onConfirm(String pinBase64) {
    dialog.setreplacedle(R.string.confirm_pin);
}

19 Source : DialogUsage.java
with Apache License 2.0
from androidx

private void showButtonBarDialog() {
    Dialog dialog = new AppCompatDialog(this);
    dialog.setreplacedle(R.string.dialog_replacedle);
    dialog.setContentView(R.layout.dialog_content_buttons);
    dialog.show();
}

19 Source : DialogUsage.java
with Apache License 2.0
from androidx

private void showSimpleDialog() {
    Dialog dialog = new AppCompatDialog(this);
    dialog.setreplacedle(R.string.dialog_replacedle);
    dialog.setContentView(R.layout.dialog_content);
    dialog.show();
}

18 Source : OpenFileDialog.java
with Apache License 2.0
from ylxseu

// 参数说明
// context:上下文
// dialogid:对话框ID
// replacedle:对话框标题
// callback:一个传递Bundle参数的回调接口
// suffix:需要选择的文件后缀,比如需要选择wav、mp3文件的时候设置为".wav;.mp3;",注意最后需要一个分号(;)
// images:用来根据后缀显示的图标资源ID。
// 根目录图标的索引为sRoot;
// 父目录的索引为sParent;
// 文件夹的索引为sFolder;
// 默认图标的索引为sEmpty;
// 其他的直接根据后缀进行索引,比如.wav文件图标的索引为"wav"
public static Dialog createDialog(int id, Context context, String replacedle, CallbackBundle callback, String suffix, Map<String, Integer> images) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setView(new FileSelectView(context, id, callback, suffix, images));
    Dialog dialog = builder.create();
    // dialog.requestWindowFeature(Window.FEATURE_NO_replacedLE);
    dialog.setreplacedle(replacedle);
    return dialog;
}

18 Source : FileChooser.java
with MIT License
from ktt-ol

/**
 * Sort, filter and display the files for the given path.
 */
private void refresh(File path) {
    this.currentPath = path;
    if (path.exists()) {
        File[] dirs = path.listFiles(new FileFilter() {

            @Override
            public boolean accept(File file) {
                return (file.isDirectory() && file.canRead());
            }
        });
        File[] files = path.listFiles(new FileFilter() {

            @Override
            public boolean accept(File file) {
                if (!file.isDirectory()) {
                    if (!file.canRead()) {
                        return false;
                    } else if (extension == null) {
                        return true;
                    } else {
                        return file.getName().toLowerCase().endsWith(extension);
                    }
                } else {
                    return false;
                }
            }
        });
        if (dirs == null) {
            dirs = new File[0];
        }
        if (files == null) {
            files = new File[0];
        }
        // convert to an array
        int i = 0;
        String[] fileList;
        if (path.getParentFile() == null) {
            fileList = new String[dirs.length + files.length];
        } else {
            fileList = new String[dirs.length + files.length + 1];
            fileList[i++] = PARENT_DIR;
        }
        Arrays.sort(dirs);
        Arrays.sort(files);
        for (File dir : dirs) {
            fileList[i++] = dir.getName();
        }
        for (File file : files) {
            fileList[i++] = file.getName();
        }
        // refresh the user interface
        dialog.setreplacedle(currentPath.getPath());
        list.setAdapter(new ArrayAdapter(activity, android.R.layout.simple_list_item_1, fileList) {

            @Override
            public View getView(int pos, View view, ViewGroup parent) {
                view = super.getView(pos, view, parent);
                ((TextView) view).setSingleLine(true);
                return view;
            }
        });
    }
}

18 Source : IpInfoFragment.java
with MIT License
from henrymorgen

public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    mDialog = new ProgressDialog(getActivity());
    mDialog.setreplacedle("获取数据中");
    bt_ipinfo.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            mPresenter.getIpInfo("39.155.184.147");
        }
    });
}

18 Source : FileChooser.java
with Apache License 2.0
from chooka888

/**
 * Sort, filter and display the files for the given path.
 */
private void refresh(File path) {
    this.currentPath = path;
    if (path.exists()) {
        File[] dirs = path.listFiles(new FileFilter() {

            @Override
            public boolean accept(File file) {
                return (file.isDirectory() && file.canRead());
            }
        });
        File[] files = path.listFiles(new FileFilter() {

            @Override
            public boolean accept(File file) {
                if (!file.isDirectory()) {
                    if (!file.canRead()) {
                        return false;
                    } else if (extension == null) {
                        return true;
                    } else {
                        return file.getName().toLowerCase().endsWith(extension);
                    }
                } else {
                    return false;
                }
            }
        });
        // convert to an array
        int i = 0;
        String[] fileList;
        if (path.getParentFile() == null) {
            fileList = new String[dirs.length + files.length];
        } else {
            fileList = new String[dirs.length + files.length + 1];
            fileList[i++] = PARENT_DIR;
        }
        Arrays.sort(dirs);
        Arrays.sort(files);
        for (File dir : dirs) {
            fileList[i++] = dir.getName();
        }
        for (File file : files) {
            fileList[i++] = file.getName();
        }
        // refresh the user interface
        dialog.setreplacedle(currentPath.getPath());
        list.setAdapter(new ArrayAdapter(activity, android.R.layout.simple_list_item_1, fileList) {

            @Override
            public View getView(int pos, View view, ViewGroup parent) {
                view = super.getView(pos, view, parent);
                ((TextView) view).setSingleLine(true);
                return view;
            }
        });
    }
}

18 Source : UserReviewDialogBuilder.java
with GNU General Public License v2.0
from ArielOSProject

public Dialog show(final com.dragons.aurora.model.Review review) {
    dialog = new Dialog(context);
    dialog.setContentView(R.layout.dialog_review);
    getCommentView().setText(review.getComment());
    getreplacedleView().setText(review.getreplacedle());
    dialog.setCanceledOnTouchOutside(true);
    dialog.setCancelable(true);
    dialog.setreplacedle(R.string.details_review_dialog_replacedle);
    dialog.findViewById(R.id.review_dialog_done).setOnClickListener(new DoneOnClickListener(review));
    dialog.findViewById(R.id.review_dialog_cancel).setOnClickListener(v -> dialog.dismiss());
    dialog.show();
    return dialog;
}

17 Source : EditDisplayNameDialog.java
with Apache License 2.0
from SnowVolf

// Show the dialog with remember preplacedword option
public static void show(Context context, final Handler handler, String replacedle, final int msgCode, final long aliasId, String displayName) {
    dialog = new Dialog(context);
    // dialog.requestWindowFeature(Window.FEATURE_NO_replacedLE);
    dialog.setreplacedle(replacedle);
    dialog.setContentView(R.layout.edit_display_name);
    LayoutParams params = dialog.getWindow().getAttributes();
    params.width = LayoutParams.FILL_PARENT;
    dialog.getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
    final EditText editTextView = (EditText) dialog.findViewById(R.id.EditDisplayNamedView);
    editTextView.setText(displayName);
    Button closeButton = (Button) dialog.findViewById(R.id.EditDisplayNameDoneButton);
    closeButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            Message msg = new Message();
            msg.what = msgCode;
            Bundle data = new Bundle();
            data.putLong(MSG_DATA_ALIAS_ID, aliasId);
            data.putString(MSG_DATA_TEXT, editTextView.getText().toString());
            msg.setData(data);
            handler.sendMessage(msg);
            dialog.dismiss();
        }
    });
    Button cancelButton = (Button) dialog.findViewById(R.id.EditDisplayNameCancelButton);
    cancelButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            dialog.dismiss();
        }
    });
    dialog.show();
}

17 Source : ChooseActivityTypeDialogFragment.java
with Apache License 2.0
from OpenTracksApp

@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = super.onCreateDialog(savedInstanceState);
    dialog.setreplacedle(R.string.track_edit_activity_type_hint);
    return dialog;
}

17 Source : DemoGroupActivity.java
with Apache License 2.0
from leancloud

private void setupAVOSCloud(boolean config) {
    if (!config) {
        AVOSCloud.initialize(this.getApplication(), Config.APP_ID, Config.APP_KEY, Config.SERVER_HOST);
        return;
    }
    final Dialog dialog = new Dialog(this);
    dialog.setContentView(cn.leancloud.sample.R.layout.cloud);
    dialog.setreplacedle("Setup AVOS Cloud");
    // set the custom dialog components - text, image and button
    Button dialogButton = (Button) dialog.findViewById(cn.leancloud.sample.R.id.btn_ok);
    dialogButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            dialog.dismiss();
            EditText appId = (EditText) dialog.findViewById(cn.leancloud.sample.R.id.editViewClientKey);
            EditText clientKey = (EditText) dialog.findViewById(cn.leancloud.sample.R.id.editTextClientKey);
            if (appId.getText().length() <= 0 || clientKey.getText().length() <= 0) {
                Toast.makeText(DemoGroupActivity.this, "Empty key.", Toast.LENGTH_LONG).show();
                return;
            }
            AVOSCloud.initialize(getApplication(), appId.getText().toString(), clientKey.getText().toString());
        }
    });
    dialogButton = (Button) dialog.findViewById(cn.leancloud.sample.R.id.btn_cancel);
    dialogButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            dialog.dismiss();
        }
    });
    dialog.show();
}

17 Source : IpInfoFragment.java
with MIT License
from henrymorgen

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    mDialog = new ProgressDialog(getActivity());
    mDialog.setreplacedle("获取数据中");
    binding.btIpinfo.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            mPresenter.getIpInfo("39.155.184.147");
        }
    });
}

17 Source : AnalyticsPreferenceDialog.java
with Apache License 2.0
from devgianlu

@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = super.onCreateDialog(savedInstanceState);
    dialog.setreplacedle(R.string.prefs_usageStatistics);
    return dialog;
}

17 Source : AboutAria2Dialog.java
with GNU General Public License v3.0
from devgianlu

@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = super.onCreateDialog(savedInstanceState);
    dialog.setreplacedle(R.string.about_aria2);
    return dialog;
}

17 Source : UiChoiceDialog.java
with Apache License 2.0
from archos-sa

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog d = super.onCreateDialog(savedInstanceState);
    d.setreplacedle(null);
    return d;
}

17 Source : SaveDialog.java
with GNU General Public License v3.0
from AntriKodSoft

@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = new Dialog(getActivity(), R.style.CustomDialog);
    View view = getActivity().getLayoutInflater().inflate(R.layout.save_dialog, null);
    dialog.getWindow().setContentView(view);
    unbinder = ButterKnife.bind(this, view);
    dialog.setreplacedle(mSaveDialog);
    dialog.setCanceledOnTouchOutside(false);
    return dialog;
}

16 Source : MainActivity.java
with Apache License 2.0
from zhaozepeng

@Override
public void onClick(View v) {
    switch(v.getId()) {
        case R.id.btn_copy:
            Dialog dialog = new Dialog(MainActivity.this);
            dialog.setreplacedle("Dadfadfa");
            dialog.show();
            String input = mEtInput.getText().toString().trim();
            if (TextUtils.isEmpty(input)) {
                Toast.makeText(this, "input不能为空", Toast.LENGTH_SHORT).show();
                return;
            }
            // //复制
            // ClipData clip = ClipData.newPlainText("simple text", mEtInput.getText().toString());
            // clipboard.setPrimaryClip(clip);
            break;
        case R.id.btn_show_paste:
            // 黏贴
            // clip = clipboard.getPrimaryClip();
            // if (clip != null && clip.gereplacedemCount() > 0) {
            // Toast.makeText(this, clip.gereplacedemAt(0).getText(), Toast.LENGTH_SHORT).show();
            // }
            break;
    }
}

16 Source : WizardHomeActivity.java
with GNU General Public License v3.0
from scala-network

private void showDisclaimer() {
    final Dialog dialog = new Dialog(this);
    dialog.setContentView(R.layout.disclaimer);
    dialog.setreplacedle("Disclaimer");
    dialog.setCancelable(false);
    Button btnOK = dialog.findViewById(R.id.btnAgree);
    btnOK.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Config.write(Config.CONFIG_DISCLAIMER_AGREED, "1");
            dialog.dismiss();
        }
    });
    dialog.show();
}

16 Source : MainActivity.java
with Apache License 2.0
from JovanyNegocio

public void showDialog() {
    addItemDialog = new Dialog(MainActivity.this);
    addItemDialog.setContentView(R.layout.add_item_dialog);
    newImage = addItemDialog.findViewById(R.id.new_image);
    newImage.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (isStoregePermissionGranted()) {
                Intent galleryIntent = new Intent(Intent.ACTION_PICK);
                galleryIntent.setType("image/*");
                startActivityForResult(galleryIntent, 12);
            } else {
                ActivityCompat.requestPermissions(MainActivity.this, new String[] { Manifest.permission.READ_EXTERNAL_STORAGE }, 3);
            }
        }
    });
    newreplacedle = addItemDialog.findViewById(R.id.new_replacedle);
    newDescription = addItemDialog.findViewById(R.id.new_description);
    saveButton = addItemDialog.findViewById(R.id.salvar);
    saveButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            saveNewItem();
        }
    });
    addItemDialog.setreplacedle("Adicionar novo item");
    addItemDialog.show();
}

16 Source : NoteFilterActivity.java
with GNU General Public License v2.0
from dsolonenko

@Override
protected Dialog onCreateDialog(final int id) {
    final Dialog d = new Dialog(this);
    d.setCancelable(true);
    d.setreplacedle(R.string.note_text_containing);
    d.setContentView(R.layout.filter_period_select);
    Button bOk = d.findViewById(R.id.bOK);
    bOk.setOnClickListener(v -> d.dismiss());
    Button bCancel = d.findViewById(R.id.bCancel);
    bCancel.setOnClickListener(v -> d.cancel());
    return d;
}

16 Source : EditChaseDetailsDialog.java
with GNU General Public License v3.0
from dfredell

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final Dialog dialog = super.onCreateDialog(savedInstanceState);
    dialog.setreplacedle("Edit Chase Details");
    return dialog;
}

15 Source : CreateOrderActivity.java
with Apache License 2.0
from wangzhijun1124

private void pay() {
    url = "http://192.168.43.53:8762/service-user/pay.action?order_id=" + order_id + "&order_totalmoney=" + amount;
    LogUtil.e("生成的支付二维码", url, true);
    mBitmap = QRCodeUtil.createQRCodeBitmap(url, 480, 480);
    ImageView mImageView = new ImageView(CreateOrderActivity.this);
    mImageView.setImageBitmap(mBitmap);
    dialog.setreplacedle("请扫描下方二维码完成支付");
    dialog.setContentView(mImageView);
    dialog.show();
    timerTask(order_id);
}

15 Source : EnterPasswordDialog.java
with Apache License 2.0
from SnowVolf

// Show the dialog without remember option
public static void show(Context context, final Handler handler, String replacedle, final int msgCode, final String cdataPath, final long cdataId, final String aliasName) {
    dialog = new Dialog(context);
    // dialog.requestWindowFeature(Window.FEATURE_NO_replacedLE);
    dialog.setreplacedle(replacedle);
    dialog.setContentView(R.layout.enter_preplacedword_dialog);
    LayoutParams params = dialog.getWindow().getAttributes();
    params.width = LayoutParams.FILL_PARENT;
    dialog.getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
    final EditText editTextView = (EditText) dialog.findViewById(R.id.EnterPreplacedwordView);
    Button closeButton = (Button) dialog.findViewById(R.id.EnterPreplacedwordDoneButton);
    closeButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            Message msg = new Message();
            msg.what = msgCode;
            Bundle data = new Bundle();
            data.putLong(MSG_DATA_ID, cdataId);
            String preplacedword = editTextView.getText().toString();
            if (preplacedword.length() == 0)
                preplacedword = null;
            else {
                if (aliasName == null)
                    preplacedword = PreplacedwordObfuscator.getInstance().encodeKeystorePreplacedword(cdataPath, editTextView.getText().toString());
                else
                    preplacedword = PreplacedwordObfuscator.getInstance().encodeAliasPreplacedword(cdataPath, aliasName, editTextView.getText().toString());
            }
            data.putString(MSG_DATA_PreplacedWORD, preplacedword);
            data.putString(MSG_DATA_PATH, cdataPath);
            msg.setData(data);
            handler.sendMessage(msg);
            dialog.dismiss();
        }
    });
    Button cancelButton = (Button) dialog.findViewById(R.id.EnterPreplacedwordCancelButton);
    cancelButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            Message msg = new Message();
            msg.what = MESSAGE_CODE_ENTER_PreplacedWORD_CANCELLED;
            handler.sendMessage(msg);
            dialog.dismiss();
        }
    });
    dialog.show();
}

15 Source : FileBrowser.java
with MIT License
from SDRausty

// end onCreate()
/**
 * *************************************************************
 *  onPrepareDialog()
 *  		This function is called EVERY time a dialog is displayed
 */
protected void onPrepareDialog(int id, Dialog dialog) {
    switch(id) {
        case DIALOG_FILE_OPTIONS:
            {
                dialog.setreplacedle(dialog_file.getName());
                break;
            }
        case DIALOG_SHOULD_DELETE:
            {
                dialog.setreplacedle("Confirm deletion of " + dialog_file.getName());
                break;
            }
        case DIALOG_RENAME:
            {
                EditText v = (EditText) textEntryView.findViewById(R.id.filename_edit);
                v.setText(dialog_file.getName());
                v.setSelection(v.getText().length(), v.getText().length());
                break;
            }
        case DIALOG_MKDIR:
            {
                EditText v = (EditText) mkDIRView.findViewById(R.id.filename_edit);
                v.setText("");
            }
    }
}

15 Source : MainActivity.java
with GNU General Public License v3.0
from Mine2Gether

private void showdialog() {
    final Dialog dialog = new Dialog(this);
    dialog.setContentView(R.layout.disclaimer);
    dialog.setreplacedle("Disclaimer...");
    dialog.setCancelable(false);
    Button dialogButton = (Button) dialog.findViewById(R.id.button1);
    Button exitButton = (Button) dialog.findViewById(R.id.button2);
    dialogButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            accepted = true;
            PreferenceHelper.setName("show_again", "1");
            dialog.dismiss();
        }
    });
    exitButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            MainActivity.this.finish();
        }
    });
    dialog.show();
}

15 Source : ChartPreviewDialog.java
with Apache License 2.0
from linheimx

@Override
public void onStart() {
    super.onStart();
    // safety check
    if (getDialog() == null)
        return;
    String replacedle = "";
    Bundle bun = getArguments();
    if (bun != null) {
        replacedle = bun.getString("replacedle");
    }
    Dialog dialog = getDialog();
    dialog.setreplacedle(replacedle);
    int width = ViewGroup.LayoutParams.MATCH_PARENT;
    int height = ViewGroup.LayoutParams.MATCH_PARENT;
    dialog.getWindow().setLayout(width, height);
}

15 Source : FindPW.java
with GNU General Public License v3.0
from JoMingyu

private void PWDialog() {
    LayoutInflater dialog = LayoutInflater.from(this);
    final View dialogLayout = dialog.inflate(R.layout.dialog_find_pw_input, null);
    final Dialog myDialog = new Dialog(this);
    myDialog.setreplacedle("임시 비밀번호 발급");
    myDialog.setContentView(dialogLayout);
    myDialog.show();
    Button okBtn = (Button) dialogLayout.findViewById(R.id.okBtn);
    Button cancelBtn = (Button) dialogLayout.findViewById(R.id.cancelBtn);
    okBtn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            myDialog.cancel();
        }
    });
    cancelBtn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            myDialog.cancel();
        }
    });
}

15 Source : FindPW.java
with GNU General Public License v3.0
from JoMingyu

private void ShowDialog() {
    LayoutInflater dialog = LayoutInflater.from(this);
    final View dialogLayout = dialog.inflate(R.layout.dialog_email_certified_input, null);
    final Dialog myDialog = new Dialog(this);
    myDialog.setreplacedle("이메일 인증");
    myDialog.setContentView(dialogLayout);
    myDialog.show();
    Button okBtn = (Button) dialogLayout.findViewById(R.id.okBtn);
    Button cancelBtn = (Button) dialogLayout.findViewById(R.id.cancelBtn);
    final EditText checkCode = (EditText) dialogLayout.findViewById(R.id.checkCode);
    okBtn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(final View v) {
            apiInterface.doFindIdVerify(inputEmail.getText().toString(), checkCode.getText().toString()).enqueue(new Callback<Void>() {

                @Override
                public void onResponse(Call<Void> call, Response<Void> response) {
                    if (response.code() == 201) {
                        checkCode.setTextColor(ColorManager.successColor);
                        SnackbarManager.createCancelableSnackbar(v, "임시 비밀번호가 " + inputEmail.getText().toString() + "로 전송되었습니다.").show();
                    } else {
                        checkCode.setTextColor(ColorManager.failureColor);
                    }
                }

                @Override
                public void onFailure(Call<Void> call, Throwable t) {
                }
            });
            myDialog.cancel();
        }
    });
    cancelBtn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            myDialog.cancel();
        }
    });
}

15 Source : PickerDialog.java
with Apache License 2.0
from fennifith

@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
    Dialog dialog = super.onCreateDialog(savedInstanceState);
    dialog.setreplacedle(getreplacedle());
    return dialog;
}

15 Source : CustomChooserActivity.java
with Apache License 2.0
from chiclaim

private void showChooserDialog() {
    if (dialog == null) {
        dialog = new Dialog(this);
        dialog.setreplacedle(R.string.file_chooser);
        dialog.setContentView(R.layout.dialog_chooser_layout);
        // 兼容android5.0.1
        // android5.0上dialog宽度变成了wrap_content
        if (dialog.getWindow() != null) {
            dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        }
        dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {

            @Override
            public void onDismiss(DialogInterface dialog) {
                if (resetCallback && mFilePathCallback != null) {
                    mFilePathCallback.onReceiveValue(null);
                    mFilePathCallback = null;
                }
                resetCallback = true;
            }
        });
        dialog.findViewById(R.id.text_album).setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                resetCallback = false;
                dialog.dismiss();
                Intent albumIntent = new Intent(Intent.ACTION_PICK);
                albumIntent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "image/*");
                startActivityForResult(albumIntent, REQUEST_CODE_ALBUM);
            }
        });
        dialog.findViewById(R.id.text_camera).setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                resetCallback = false;
                dialog.dismiss();
                Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
                if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
                    File photoFile = null;
                    try {
                        photoFile = createImageFile();
                    } catch (IOException ex) {
                        ex.printStackTrace();
                    }
                    if (photoFile != null) {
                        mCameraPhotoPath = "file:" + photoFile.getAbsolutePath();
                        takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
                        startActivityForResult(takePictureIntent, REQUEST_CODE_CAMERA);
                    }
                }
            }
        });
    }
    dialog.show();
}

14 Source : EnterPasswordDialog.java
with Apache License 2.0
from SnowVolf

// Show the dialog with remember preplacedword option
public static void show(Context context, final Handler handler, String replacedle, final int msgCode, final String cdataPath, final long cdataId, boolean rememberPreplacedword, final String aliasName) {
    dialog = new Dialog(context);
    // dialog.requestWindowFeature(Window.FEATURE_NO_replacedLE);
    dialog.setreplacedle(replacedle);
    dialog.setContentView(R.layout.enter_preplacedword_with_remember_dialog);
    LayoutParams params = dialog.getWindow().getAttributes();
    params.width = LayoutParams.FILL_PARENT;
    dialog.getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
    final EditText editTextView = (EditText) dialog.findViewById(R.id.EnterPreplacedwordView);
    final CheckBox rememberPwCheckbox = (CheckBox) dialog.findViewById(R.id.RememberPwCheckbox);
    rememberPwCheckbox.setChecked(rememberPreplacedword);
    Button closeButton = (Button) dialog.findViewById(R.id.EnterPreplacedwordDoneButton);
    closeButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            Message msg = new Message();
            msg.what = msgCode;
            Bundle data = new Bundle();
            data.putLong(MSG_DATA_ID, cdataId);
            String preplacedword = editTextView.getText().toString();
            if (preplacedword.length() == 0) {
                preplacedword = null;
            } else {
                if (aliasName == null) {
                    preplacedword = PreplacedwordObfuscator.getInstance().encodeKeystorePreplacedword(cdataPath, editTextView.getText().toString());
                } else {
                    preplacedword = PreplacedwordObfuscator.getInstance().encodeAliasPreplacedword(cdataPath, aliasName, editTextView.getText().toString());
                }
            }
            data.putBoolean(MSG_DATA_REMEMBER_PreplacedWORD, rememberPwCheckbox.isChecked());
            data.putString(MSG_DATA_PreplacedWORD, preplacedword);
            data.putString(MSG_DATA_PATH, cdataPath);
            msg.setData(data);
            handler.sendMessage(msg);
            dialog.dismiss();
        }
    });
    Button cancelButton = (Button) dialog.findViewById(R.id.EnterPreplacedwordCancelButton);
    cancelButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            Message msg = new Message();
            msg.what = MESSAGE_CODE_ENTER_PreplacedWORD_CANCELLED;
            handler.sendMessage(msg);
            dialog.dismiss();
        }
    });
    dialog.show();
}

14 Source : AboutFragment.java
with GNU General Public License v3.0
from scala-network

private void showDisclaimer() {
    final Dialog dialog = new Dialog(getContext());
    dialog.setContentView(R.layout.disclaimer);
    dialog.setreplacedle("Disclaimer");
    dialog.setCancelable(false);
    Button btnOK = dialog.findViewById(R.id.btnAgree);
    btnOK.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Config.write(Config.CONFIG_DISCLAIMER_AGREED, "1");
            dialog.dismiss();
        }
    });
    dialog.show();
}

14 Source : Email_Certified.java
with GNU General Public License v3.0
from JoMingyu

private void ShowDialog() {
    final LayoutInflater dialog = LayoutInflater.from(this);
    final View dialogLayout = dialog.inflate(R.layout.dialog_email_certified_input, null);
    final Dialog myDialog = new Dialog(this);
    myDialog.setreplacedle("이메일 인증");
    myDialog.setContentView(dialogLayout);
    myDialog.show();
    final Button okBtn = (Button) dialogLayout.findViewById(R.id.okBtn);
    final Button cancelBtn = (Button) dialogLayout.findViewById(R.id.cancelBtn);
    final EditText checkCode = (EditText) dialogLayout.findViewById(R.id.checkCode);
    checkCode.addTextChangedListener(new Texreplacedcher() {

        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
        }

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
            checkCode.setTextColor(Color.BLACK);
        }

        @Override
        public void afterTextChanged(Editable s) {
        }
    });
    okBtn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(final View v) {
            apiInterface.doSignUpVerifyE(email.getText().toString(), checkCode.getText().toString()).enqueue(new Callback<Void>() {

                @Override
                public void onResponse(Call<Void> call, Response<Void> response) {
                    if (response.code() == 201) {
                        intent.putExtra("email", email.getText().toString());
                        intent.putExtra("emailCertified", true);
                        // 인증 완료되었음을 표시
                        SnackbarManager.createCancelableSnackbar(getWindow().getDecorView().getRootView(), "이메일 인증 완료").show();
                        myDialog.cancel();
                        finish();
                        startActivity(intent);
                    } else {
                        checkCode.setTextColor(ColorManager.failureColor);
                        SnackbarManager.createCancelableSnackbar(getWindow().getDecorView().getRootView(), "인증번호가 맞지 않습니다.").show();
                    }
                }

                @Override
                public void onFailure(Call<Void> call, Throwable t) {
                }
            });
        }
    });
    cancelBtn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            myDialog.cancel();
        }
    });
}

14 Source : MainActivity.java
with MIT License
from HBU

public void onDialogClick8(View v) {
    Dialog dialog = new Dialog(this);
    dialog.setreplacedle("拖动对话框");
    dialog.setContentView(R.layout.seek);
    SeekBar sbar = (SeekBar) dialog.findViewById(R.id.seekBar1);
    sbar.setMax(100);
    final TextView tview = (TextView) dialog.findViewById(R.id.tv_result);
    tview.setText("当前进度为:" + sbar.getProgress());
    sbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
            tview.setText("设置音量大小为:" + seekBar.getProgress());
            textview = (TextView) findViewById(R.id.textView123);
            textview.setText(tview.getText());
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });
    dialog.show();
}

14 Source : OptionsDialog.java
with GNU General Public License v3.0
from devgianlu

@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Bundle args = getArguments();
    final Dialog dialog = super.onCreateDialog(savedInstanceState);
    if (args != null && args.getBoolean("global", false))
        dialog.setreplacedle(R.string.globalOptions);
    else
        dialog.setreplacedle(R.string.downloadOptions);
    dialog.setOnShowListener(dialogInterface -> {
        final Window window = dialog.getWindow();
        if (window != null)
            window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    });
    return dialog;
}

14 Source : EditDialog.java
with GNU General Public License v3.0
from AntriKodSoft

@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = new Dialog(getActivity(), R.style.CustomDialog);
    View view = getActivity().getLayoutInflater().inflate(R.layout.fragment_edit_palette, null);
    dialog.getWindow().setContentView(view);
    unbinder = ButterKnife.bind(this, view);
    dialog.setreplacedle(mEditDialog);
    dialog.setCanceledOnTouchOutside(false);
    mPaletteName.setText(name);
    return dialog;
}

13 Source : GeneratingDownloadLinks.java
with GNU General Public License v3.0
from zzzmobile

public static void GenerateUI(JSONObject result) throws JSONException {
    String thumbnail = result.getString("thumbnail");
    final String replacedle = result.getString("replacedle");
    final JSONArray urls = result.getJSONArray("urls");
    dialog = new Dialog(Mcontext);
    dialog.setContentView(R.layout.download_dialog);
    dialog.setreplacedle("replacedle...");
    // set the custom dialog components - text, image and button
    TextView text = (TextView) dialog.findViewById(R.id.text);
    ImageView image = (ImageView) dialog.findViewById(R.id.image);
    ListView LV = (ListView) dialog.findViewById(R.id.ListView);
    String[] lisreplacedems = new String[urls.length()];
    text.setText(replacedle);
    if (!thumbnail.equals("")) {
        Picreplacedo.with(Mcontext).load(thumbnail).resize(100, 100).centerCrop().into(image);
    }
    String label = "";
    for (int i = 0; i < urls.length(); i++) {
        JSONObject list = urls.getJSONObject(i);
        label = list.getString("label");
        if (label.contains("(audio - no video) webm")) {
            label = label.replace("(audio - no video) webm", "mp3");
        }
        lisreplacedems[i] = label;
    }
    ArrayAdapter adapter = new ArrayAdapter(Mcontext, android.R.layout.simple_list_item_1, lisreplacedems);
    LV.setAdapter(adapter);
    LV.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
            String ext = "";
            try {
                final JSONObject m = urls.getJSONObject(position);
                if (m.getString("label").contains(" mp4")) {
                    ext = ".mp4";
                } else if (m.getString("label").contains(" mp3")) {
                    ext = ".mp3";
                } else if (m.getString("label").contains(" 360p - webm")) {
                    ext = ".webm";
                } else if (m.getString("label").contains(" webm")) {
                    ext = ".mp3";
                } else if (m.getString("label").contains(" m4a")) {
                    ext = ".m4a";
                } else if (m.getString("label").contains(" 3gp")) {
                    ext = ".3gp";
                } else if (m.getString("label").contains(" flv")) {
                    ext = ".flv";
                } else {
                    ext = ".mp4";
                }
                DownloadFile.Downloading(Mcontext, m.getString("id"), replacedle, ext);
                dialog.dismiss();
            // iUtils.ShowToast(Mcontext,"Something error" + m.toString());
            // For intersreplacedials
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    });
    dialog.show();
}

13 Source : MainActivity.java
with MIT License
from HBU

public void onDialogClick8(View v) {
    Dialog dialog = new Dialog(this);
    dialog.setreplacedle("拖动对话框");
    dialog.setContentView(R.layout.seek);
    SeekBar sbar = dialog.findViewById(R.id.seekBar1);
    sbar.setMax(100);
    final TextView tview = dialog.findViewById(R.id.tv_result);
    tview.setText("当前进度为:" + sbar.getProgress());
    sbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
            tview.setText("设置音量大小为:" + seekBar.getProgress());
            textview = (TextView) findViewById(R.id.textView123);
            textview.setText(tview.getText());
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });
    dialog.show();
}

13 Source : MainActivity.java
with Apache License 2.0
from BlueCat300

private void appFilter() {
    MainActivity.AppListAdapter appListAdapter = (MainActivity.AppListAdapter) ((ListView) this.findViewById(R.id.lstApps)).getAdapter();
    appListAdapter.getFilter().filter(nameFilter);
    Dialog filterDialog;
    Map<String, FilterItemComponent> filterComponents;
    filterDialog = new Dialog(this, R.style.Theme_Legacy_Dialog);
    filterDialog.setContentView(R.layout.filter_dialog);
    filterDialog.setreplacedle(R.string.filter_replacedle);
    filterDialog.setCancelable(true);
    filterDialog.setOwnerActivity(this);
    LinearLayout entriesView = filterDialog.findViewById(R.id.filter_entries);
    filterComponents = new HashMap<>();
    for (SettingInfo setting : settings) {
        FilterItemComponent component = new FilterItemComponent(this, setting.label, null, null, null);
        component.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
        component.setFilterState(setting.filter);
        entriesView.addView(component);
        filterComponents.put(setting.settingKey, component);
    }
    ((FilterItemComponent) filterDialog.findViewById(R.id.fltAppType)).setFilterState(filterAppType);
    ((FilterItemComponent) filterDialog.findViewById(R.id.fltAppState)).setFilterState(filterAppState);
    ((FilterItemComponent) filterDialog.findViewById(R.id.fltActive)).setFilterState(filterActive);
    // Block or unblock the details based on the Active setting
    enableFilterDetails(!FilterState.UNCHANGED.equals(filterActive), filterComponents);
    ((FilterItemComponent) filterDialog.findViewById(R.id.fltActive)).setOnFilterChangeListener((item, state) -> enableFilterDetails(!FilterState.UNCHANGED.equals(state), filterComponents));
    // Close the dialog with the possible options
    filterDialog.findViewById(R.id.btnFilterCancel).setOnClickListener(v1 -> filterDialog.dismiss());
    filterDialog.findViewById(R.id.btnFilterClear).setOnClickListener(v12 -> {
        filterAppType = FilterState.ALL;
        filterAppState = FilterState.ALL;
        filterActive = FilterState.ALL;
        for (SettingInfo setting : settings) setting.filter = FilterState.ALL;
        filterDialog.dismiss();
        appListAdapter.getFilter().filter(nameFilter);
    });
    filterDialog.findViewById(R.id.btnFilterApply).setOnClickListener(v13 -> {
        filterAppType = ((FilterItemComponent) filterDialog.findViewById(R.id.fltAppType)).getFilterState();
        filterAppState = ((FilterItemComponent) filterDialog.findViewById(R.id.fltAppState)).getFilterState();
        filterActive = ((FilterItemComponent) filterDialog.findViewById(R.id.fltActive)).getFilterState();
        for (SettingInfo setting : settings) setting.filter = Objects.requireNonNull(filterComponents.get(setting.settingKey)).getFilterState();
        filterDialog.dismiss();
        appListAdapter.getFilter().filter(nameFilter);
    });
    filterDialog.show();
}

13 Source : DeviceActivity.java
with MIT License
from bertrandmartel

private void generateDialog(int uncompressedSize, int compressedSize) {
    mProgressDialog = new Dialog(this);
    mProgressDialog.setContentView(R.layout.progress);
    mProgressDialog.setreplacedle("");
    mProgressDialog.setCancelable(false);
    mProgressBar = (ProgressBar) mProgressDialog.findViewById(R.id.progressbar);
    mProgressionTv = (TextView) mProgressDialog.findViewById(R.id.progression);
    altTableRow(2, (TableLayout) mProgressDialog.findViewById(R.id.tablelayout));
    TextView text = (TextView) mProgressDialog.findViewById(R.id.uncompressed_size_value);
    text.setText(uncompressedSize + " octets");
    TextView text1 = (TextView) mProgressDialog.findViewById(R.id.size_compressed_value);
    text1.setText(compressedSize + " octets");
    mCompleteTv = (TextView) mProgressDialog.findViewById(R.id.unpack_time_value);
    final TextView text3 = (TextView) mProgressDialog.findViewById(R.id.upload_time_value);
    if (uncompressedSize != 0) {
        TextView text2 = (TextView) mProgressDialog.findViewById(R.id.compression_rate_value);
        text2.setText((100 - (compressedSize * 100) / uncompressedSize) + " %");
    }
    mButton = (android.widget.Button) mProgressDialog.findViewById(R.id.cancel_button);
    mButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (mProgressDialog != null) {
                mProgressDialog.dismiss();
            }
            if (mDisplayDevice != null) {
                mDisplayDevice.cancelBitmap();
            }
        }
    });
    runOnUiThread(new Runnable() {

        @Override
        public void run() {
            mProgressDialog.show();
            WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
            Window window = mProgressDialog.getWindow();
            lp.copyFrom(window.getAttributes());
            lp.width = WindowManager.LayoutParams.MATCH_PARENT;
            lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
            window.setAttributes(lp);
        }
    });
    mTimeCount = 0;
    if (mTimer != null) {
        mTimer.cancel();
        mTimer.purge();
    }
    mTimer = new Timer();
    mTimer.scheduleAtFixedRate(new TimerTask() {

        @Override
        public void run() {
            runOnUiThread(new Runnable() {

                @Override
                public void run() {
                    text3.setText(formatSeconds(mTimeCount));
                    mTimeCount++;
                }
            });
        }
    }, 0, 1000);
}

12 Source : DialogUtils.java
with Apache License 2.0
from vanhung1710

public static Dialog createCustomProgressDialog(final Activity context, final String replacedle, final String content, final String buttonName, final DialogOnClickListener listener, boolean cancelable) {
    final Dialog myDialog = new Dialog(context);
    myDialog.requestWindowFeature(Window.FEATURE_NO_replacedLE);
    myDialog.setreplacedle(replacedle);
    LayoutInflater inflater = LayoutInflater.from(context);
    final View rootView = inflater.inflate(R.layout.photo_editor_dialog_progress_with_button_custom, null);
    myDialog.setContentView(rootView);
    myDialog.setCancelable(cancelable);
    final TextView replacedleView = (TextView) rootView.findViewById(R.id.replacedleView);
    replacedleView.setText(replacedle);
    final TextView contentView = (TextView) rootView.findViewById(R.id.contentView);
    contentView.setText(content);
    final View cancelButton = rootView.findViewById(R.id.cancelButton);
    cancelButton.setVisibility(View.GONE);
    final TextView okButton = (TextView) rootView.findViewById(R.id.okButton);
    okButton.setText(buttonName);
    okButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            myDialog.dismiss();
            if (listener != null) {
                listener.onOKButtonOnClick();
            }
        }
    });
    return myDialog;
}

12 Source : RenameKeyDialog.java
with Apache License 2.0
from SnowVolf

// Show the dialog with remember preplacedword option
public static void show(final Context context, final Handler handler, final int msgCode, final Alias alias) {
    final AndroidLogger logger = (AndroidLogger) LoggerManager.getLogger(RenameKeyDialog.clreplaced.getName());
    logger.setToastContext(context);
    final Dialog dialog = new Dialog(context);
    // dialog.requestWindowFeature(Window.FEATURE_NO_replacedLE);
    dialog.setreplacedle(R.string.RenameKeyMenuItemLabel);
    dialog.setContentView(R.layout.rename_key_dialog);
    LayoutParams params = dialog.getWindow().getAttributes();
    params.width = LayoutParams.FILL_PARENT;
    dialog.getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
    final EditText keystorePreplacedwordView = (EditText) dialog.findViewById(R.id.KeystorePreplacedword);
    final EditText keyPreplacedwordView = (EditText) dialog.findViewById(R.id.KeyPreplacedword);
    final EditText editKeyNameView = (EditText) dialog.findViewById(R.id.KeyName);
    editKeyNameView.setText(alias.getName());
    if (alias.getKeystore().rememberPreplacedword()) {
        keystorePreplacedwordView.setVisibility(View.GONE);
        TextView preplacedwordLabel = (TextView) dialog.findViewById(R.id.KeystorePreplacedwordLabel);
        preplacedwordLabel.setVisibility(View.GONE);
    }
    if (alias.rememberPreplacedword()) {
        keyPreplacedwordView.setVisibility(View.GONE);
        TextView preplacedwordLabel = (TextView) dialog.findViewById(R.id.KeyPreplacedwordLabel);
        preplacedwordLabel.setVisibility(View.GONE);
    }
    Button okButton = (Button) dialog.findViewById(R.id.OkButton);
    okButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            if (!alias.getKeystore().rememberPreplacedword() && keystorePreplacedwordView.getText().length() == 0) {
                logger.error(context.getResources().getString(R.string.KeystorePreplacedwordRequired));
                return;
            }
            if (!alias.rememberPreplacedword() && keyPreplacedwordView.getText().length() == 0) {
                logger.error(context.getResources().getString(R.string.KeyPreplacedwordRequired));
                return;
            }
            String storePreplaced = alias.getKeystore().rememberPreplacedword() ? alias.getKeystore().getPreplacedword() : PreplacedwordObfuscator.getInstance().encodeKeystorePreplacedword(alias.getKeystore().getPath(), keystorePreplacedwordView.getText().toString());
            String keyPreplaced = alias.rememberPreplacedword() ? alias.getPreplacedword() : PreplacedwordObfuscator.getInstance().encodeAliasPreplacedword(alias.getKeystore().getPath(), alias.getName(), keyPreplacedwordView.getText().toString());
            try {
                KeyStoreFileManager.validateKeystorePreplacedword(alias.getKeystore().getPath(), storePreplaced);
            } catch (Exception x) {
                logger.error(context.getResources().getString(R.string.WrongKeystorePreplacedword));
                return;
            }
            try {
                KeyStoreFileManager.validateKeyPreplacedword(alias.getKeystore().getPath(), alias.getName(), keyPreplaced);
            } catch (Exception x) {
                logger.error(context.getResources().getString(R.string.WrongKeyPreplacedword));
                return;
            }
            Message msg = new Message();
            msg.what = msgCode;
            Bundle data = new Bundle();
            data.putLong(MSG_DATA_ALIAS_ID, alias.getId());
            data.putString(MSG_DATA_KEY_NAME, editKeyNameView.getText().toString());
            data.putString(MSG_DATA_KEY_PreplacedWORD, keyPreplaced);
            data.putString(MSG_DATA_KEYSTORE_PreplacedWORD, storePreplaced);
            msg.setData(data);
            handler.sendMessage(msg);
            dialog.dismiss();
        }
    });
    Button cancelButton = (Button) dialog.findViewById(R.id.CancelButton);
    cancelButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            dialog.dismiss();
        }
    });
    dialog.show();
}

12 Source : DeleteKeyDialog.java
with Apache License 2.0
from SnowVolf

// Show the dialog with remember preplacedword option
public static void show(final Context context, final Handler handler, final int msgCode, final Alias alias) {
    final AndroidLogger logger = (AndroidLogger) LoggerManager.getLogger(DeleteKeyDialog.clreplaced.getName());
    logger.setToastContext(context);
    final Dialog dialog = new Dialog(context);
    dialog.setreplacedle(String.format(context.getResources().getString(R.string.ConfirmDeleteKeyreplacedle), alias.getName()));
    dialog.setContentView(R.layout.delete_key_dialog);
    LayoutParams params = dialog.getWindow().getAttributes();
    params.width = LayoutParams.FILL_PARENT;
    dialog.getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
    TextView message = (TextView) dialog.findViewById(R.id.ConfirmDeleteKeyMessage);
    message.setText(String.format(context.getResources().getString(R.string.ConfirmDeleteKeyMessage), alias.getName()));
    final EditText keystorePreplacedwordView = (EditText) dialog.findViewById(R.id.KeystorePreplacedword);
    if (alias.getKeystore().rememberPreplacedword()) {
        keystorePreplacedwordView.setVisibility(View.GONE);
        TextView preplacedwordLabel = (TextView) dialog.findViewById(R.id.KeystorePreplacedwordLabel);
        preplacedwordLabel.setVisibility(View.GONE);
    }
    Button okButton = (Button) dialog.findViewById(R.id.OkButton);
    okButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            if (!alias.getKeystore().rememberPreplacedword() && keystorePreplacedwordView.getText().length() == 0) {
                logger.error(context.getResources().getString(R.string.KeystorePreplacedwordRequired));
                return;
            }
            String storePreplaced = alias.getKeystore().rememberPreplacedword() ? alias.getKeystore().getPreplacedword() : PreplacedwordObfuscator.getInstance().encodeKeystorePreplacedword(alias.getKeystore().getPath(), keystorePreplacedwordView.getText().toString());
            try {
                KeyStoreFileManager.validateKeystorePreplacedword(alias.getKeystore().getPath(), storePreplaced);
            } catch (Exception x) {
                logger.error(context.getResources().getString(R.string.WrongKeystorePreplacedword));
                return;
            }
            Message msg = new Message();
            msg.what = msgCode;
            Bundle data = new Bundle();
            data.putLong(MSG_DATA_ALIAS_ID, alias.getId());
            data.putString(MSG_DATA_KEYSTORE_PreplacedWORD, storePreplaced);
            msg.setData(data);
            handler.sendMessage(msg);
            dialog.dismiss();
        }
    });
    Button cancelButton = (Button) dialog.findViewById(R.id.CancelButton);
    cancelButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            dialog.dismiss();
        }
    });
    dialog.show();
}

12 Source : DirectoryChooseDialog.java
with GNU General Public License v2.0
from HaarigerHarald

@Override
public Dialog onCreateDialog(Bundle savedInstances) {
    final Dialog d = new Dialog(getActivity());
    if (savedInstances != null) {
        currentDirectory = savedInstances.getString("playlistDir");
        if (currentDirectory == null) {
            keyFileChoose = true;
            currentDirectory = "/";
            setUp(d);
        } else {
            keyFileChoose = false;
            startPlayListDir = savedInstances.getString("startDir");
            setUp(d);
        }
    } else {
        setUp(d);
    }
    if (keyFileChoose) {
        d.setreplacedle(R.string.key_choose_replacedle);
        btnOk.setVisibility(View.GONE);
        mainListView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    } else {
        d.setreplacedle(R.string.replacedle_choose_input);
    }
    btnOk.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            d.dismiss();
            if (!keyFileChoose) {
                okCalled();
                mCallbacks.onSelection(currentDirectory);
            } else {
                mCallbacks.onSelection(keyFile);
            }
        }
    });
    return d;
}

12 Source : WhiteListFragment.java
with Apache License 2.0
from geeksonsecurity

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch(item.gereplacedemId()) {
        case R.id.op_wl_menu_refresh:
            refreshWhiteEntries();
            break;
        case R.id.op_wl_menu_add:
            final Dialog addDialog = new Dialog(getActivity());
            addDialog.setContentView(R.layout.add_whitelist_dialog);
            addDialog.setreplacedle("New white entry");
            Button cancel = (Button) addDialog.findViewById(R.id.cancelButton);
            cancel.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    addDialog.dismiss();
                }
            });
            Button ok = (Button) addDialog.findViewById(R.id.okButton);
            ok.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    String packageName = ((EditText) addDialog.findViewById(R.id.packageEditText)).getText().toString();
                    boolean exactlyMatch = !((CheckBox) addDialog.findViewById(R.id.wildcardCheckBox)).isChecked();
                    if (packageName.length() > 0) {
                        WhiteEntry we = new WhiteEntry(packageName, System.currentTimeMillis(), 0, false, exactlyMatch);
                        try {
                            DatabaseHelper.getHelper(getActivity()).getWhiteListDao().create(we);
                            mAdapter.add(we);
                            addDialog.dismiss();
                            notifyChangesToService();
                        } catch (SQLException e) {
                            Log.e(TAG, "Failed to add new white entry", e);
                            Toast.makeText(getActivity(), "Failed to add new white entry!", Toast.LENGTH_SHORT);
                        }
                    } else {
                        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
                        // Set the dialog replacedle
                        builder.setreplacedle("Error");
                        builder.setMessage("The package field is empty!");
                        builder.setNegativeButton("Ok", new DialogInterface.OnClickListener() {

                            @Override
                            public void onClick(DialogInterface dialog, int id) {
                            // Nothing
                            }
                        });
                        builder.create().show();
                    }
                }
            });
            addDialog.show();
            break;
        default:
            break;
    }
    return false;
}

11 Source : DialogUtils.java
with Apache License 2.0
from vanhung1710

public static Dialog createCustomConfirmDialog(final Context context, final String replacedle, final String content, String confirmText, String cancelText, final ConfirmDialogOnClickListener listener) {
    final Dialog myDialog = new Dialog(context);
    myDialog.requestWindowFeature(Window.FEATURE_NO_replacedLE);
    LayoutInflater inflater = LayoutInflater.from(context);
    final View rootView = inflater.inflate(R.layout.photo_editor_dialog_confirm, null);
    final TextView replacedleView = (TextView) rootView.findViewById(R.id.replacedleView);
    replacedleView.setText(replacedle);
    final TextView contentView = (TextView) rootView.findViewById(R.id.contentView);
    contentView.setText(content);
    final TextView cancelButton = (TextView) rootView.findViewById(R.id.cancelButton);
    cancelButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            myDialog.dismiss();
            if (listener != null) {
                listener.onCancelButtonOnClick();
            }
        }
    });
    final TextView okButton = (TextView) rootView.findViewById(R.id.okButton);
    okButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            myDialog.dismiss();
            if (listener != null) {
                listener.onOKButtonOnClick();
            }
        }
    });
    cancelButton.setText(cancelText);
    okButton.setText(confirmText);
    myDialog.setreplacedle(replacedle);
    myDialog.setContentView(rootView);
    myDialog.setCancelable(true);
    return myDialog;
}

See More Examples