how to implement adding Edittext
Closed this issue · 1 comments
mgrmaxi commented
New Issue Checklist
- I have read and understood the CONTRIBUTING guide
- I have read the Documentation
- I have searched for a similar issue in the project and found none
Issue Info
Info | Value |
---|---|
Platform Name | e.g. Android |
Platform Version | e.g. 6.0 |
CFAlertDialog Version | e.g. 2.1.1 |
Integration Method | e.g. gradle / manually |
Issue Description and Steps
how to implement adding Edittext and retrieve data to activity.
mgrmaxi commented
after some time searching
LayoutInflater inflater = this.getLayoutInflater();
final View dialogView = inflater.inflate(R.layout.edittext_layout, null);
CFAlertDialog.Builder builder = new CFAlertDialog.Builder(this)
.setDialogStyle(CFAlertDialog.CFAlertStyle.NOTIFICATION)
.setHeaderView(dialogView);
builder.addButton("OK", -1, -1, CFAlertDialog.CFAlertActionStyle.POSITIVE, CFAlertDialog.CFAlertActionAlignment.JUSTIFIED, (dialog, which) -> {
hiddenNote = ((EditText) dialogView.findViewById(R.id.hiddenEdittext)).getText().toString();
});
builder.addButton("Cancel", -1, -1, CFAlertDialog.CFAlertActionStyle.DEFAULT, CFAlertDialog.CFAlertActionAlignment.JUSTIFIED, (dialog, which) -> {
dialog.dismiss();
});
builder.show();
}
it works fine
thanks for nice library