sweet-alert-dialog icon indicating copy to clipboard operation
sweet-alert-dialog copied to clipboard

add custom views?

Open Elad532 opened this issue 7 years ago • 6 comments

Hi,

I seems a can't add any custom views... I tried using "setContentView" and "addContentView" for no result, I also see no api for that. I'm trying to add a EditText.

Elad532 avatar Mar 11 '17 18:03 Elad532

this version doesnt have such feature, check forks or check this https://github.com/pedant/sweet-alert-dialog/pull/100 Probably will upload my improved version of this library

F0RIS avatar Mar 13 '17 18:03 F0RIS

My improved version with custom view and other new features https://github.com/F0RIS/sweet-alert-dialog

F0RIS avatar Mar 22 '17 13:03 F0RIS

adding a custom view:


final EditText editText = new EditText(mActivity); 
SweetAlertDialog dialog = new SweetAlertDialog(mActivity, SweetAlertDialog.NORMAL_TYPE)
    .setTitleText("title")
    .setContentText("content")
    .setConfirmText("confirme")
    .setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
        @Override
        public void onClick(SweetAlertDialog sweetAlertDialog) {
                String text = editText.getText().toString();
            }
            sweetAlertDialog.dismiss();
        }
    });
dialog.show();
LinearLayout linearLayout = (LinearLayout)dialog.findViewById(R.id.loading);
int index = linearLayout.indexOfChild(linearLayout.findViewById(R.id.content_text));
linearLayout.addView(editText, index+1);

GreatAppStudio avatar May 24 '17 10:05 GreatAppStudio

why FrameLayout ? Can you make it LinearLayout ? It does not wrap long text (more than 5 lines) properly. @F0RIS

ralphgabrielle avatar Jun 06 '18 08:06 ralphgabrielle

@ralphgabrielle need to make tests with that change. Can you do that?

F0RIS avatar Jun 06 '18 19:06 F0RIS

@F0RIS ok ill try to do this later this evening. If it does not work with LinearLayout, I guess I gotta think another fix for this.

ralphgabrielle avatar Jun 08 '18 05:06 ralphgabrielle