Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to arrange the buttons in a row? #29

Open
EfremovAV opened this issue Apr 12, 2019 · 1 comment
Open

How to arrange the buttons in a row? #29

EfremovAV opened this issue Apr 12, 2019 · 1 comment

Comments

@EfremovAV
Copy link

EfremovAV commented Apr 12, 2019

I can't place several buttons in one row. How can I do that?

@keskin
Copy link

keskin commented Nov 29, 2020

You can create a custom layout and attach it to the dialog by using setFooterView

Hope it helps

LayoutInflater inflater = this.getLayoutInflater();
final View footer = inflater.inflate(R.layout.dialog_alert_footer_layout, null);
footer.findViewById(R.id.yesButton).setOnClickListener(v -> { 
    // 
});
footer.findViewById(R.id.noButton).setOnClickListener(v -> {
    // 
});

CFAlertDialog.Builder builder = new CFAlertDialog.Builder(this)
        .setDialogStyle(CFAlertDialog.CFAlertStyle.ALERT)
        .setTitle(title)
        .setMessage(message)
        .setCancelable(false)
        .setTextGravity(Gravity.CENTER_HORIZONTAL)
        .setHeaderView(header)
        .setFooterView(footer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants