eltos / SimpleDialogFragments

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

Material3 Full-Screen Dialogs #87

Closed eltos closed 1 year ago

eltos commented 1 year ago

From the Material3 Design Guide:

Dialogs can require an action, communicate information, or help users accomplish a task. There are two types of dialogs: basic and full-screen.

Proposed method signatures

SimpleDialog.build()
            .title(R.string.hello)
            .msg(R.string.hello_world)
            .fullscreen() // or with true/false argument to en-/disable
            .show(Activity.this);

Links

mtotschnig commented 1 year ago

Shouldn't the argument default to false? For me, I am not sure if this adds value to this library, Given the requirement of a screen that should always appear fullscreen, I would probably not use a dialog fragment, but a standard fragment, or an activity.

eltos commented 1 year ago

I meant that .fullscreen() is equivalent to .fullscreen(true), of course the default without that call is a standard pop up dialog.

@mtotschnig So you don't think the simple API of this library and it's features like the form dialog would make using it preferable over designing and implementing a new fragment or activity from scratch?

mtotschnig commented 1 year ago

So you don't think the simple API of this library and it's features like the form dialog would make using it preferable over designing and implementing a new fragment or activity from scratch?

It probably depends on the use case. I think the simple API has its advantages for simple dialogs that I would want to render as a dialogue not full-screen. The advantage of using an activity is that the data can be passed in a type-safe way with Androidx Activity Result Contracts.