0

Is there a way to create custom dialog with custom builder pattern? I have already tried extending DialogFragment and I have created custom Builder, but I don't understand how to attach builder to dialog, maybe someone has an example?

Equa
  • 54
  • 5
  • 1
    if you want to create custom dialog box , go through this.. https://stackoverflow.com/q/13341560/6559031 – Devil10 Aug 03 '18 at 12:12

1 Answers1

0

Just simple extend the custom class with Alert Dialog ! and in its on Create you can SETCONTENTVIEW() your design

like this

public class FoodDialog extends AlertDialog {

    public FoodDialog(Context context){
        super(context);

    }

    @override
    public onCreate() {
        super.onCreate();
        this.setTitle("Confirm?");
        setContentView(R.layout.your_custom_dialog_layout);
  }

NOTE! ABOVE ONE IS FOR ALERT DIALOGE BUT!

SAME CAN BE DONE BY extending the CUSTOM CLASS WITH Dialog(base class) and can do any kind of designing on it!

Rizwan Atta
  • 3,222
  • 2
  • 19
  • 31
  • But how I could add custom Builder to it? Because I need to implement progressbar and cancel button inside dialog, and I need to pass progress value through builder. – Equa Aug 03 '18 at 12:17