eltos / SimpleDialogFragments

An Android library to create dialogs with ease and handle user interaction reliably, using fragments and material design.
Apache License 2.0
119 stars 17 forks source link

Incompleted wiki while creating your own Dialog #19

Closed AngeloAvv closed 6 years ago

AngeloAvv commented 6 years ago

Hi, in this wiki the instructions are not complete. If you don't create your own builder which instantiates your custom class, the Dialog will show an empty view. In my case I added:

    public static JustifyDialog build() {
        return new JustifyDialog();
    }

to solve the problem. This should be a mandatory instruction, maybe could save other's people time

eltos commented 6 years ago

Sure, nothing else is to be expected as you are calling the build method of SimpleDialog then. I expected people to realise this right away (or call the constructor directly), but you are totally right it's missing in the wiki (sorry having wasted your time :/). I just added it to the wiki. Thanks for your feedback.

What do you think about adding the following to CustomViewDialog? This will hopefully save other people's time as well.

public static CustomViewDialog build(){
    throw new java.lang.InstantiationError("Unintended abuse of the builder method. " +
            "Have you created your own build() method in your custom dialog?");
}
AngeloAvv commented 6 years ago

Well it could be a good practice throwing an exception if someone uses the builder but doesn't call the right one. Anyway don't feel sorry about that, we're here to help each other :) BTW I just need to say thank you about this wonderful library, I do really appreciate your work 👍

eltos commented 6 years ago

Thanks :)