javiersantos / MaterialStyledDialogs

A library that shows a beautiful and customizable Material-based dialog with header. API 14+ required.
Apache License 2.0
1.17k stars 155 forks source link

Dialog dismissed on rotation #19

Closed Sleeper9 closed 7 years ago

Sleeper9 commented 8 years ago

The About dialog gets dismissed on screen rotation. Is there a way to keep it after orientation change? See this StackOverflow question

ihangulo commented 8 years ago

Is there any method to change the height of HeaderDrawable? I want to increase the size a bit more. Thanks.

Rainer-Lang commented 8 years ago

Any chance that DialogFragment is used to avoid dismissal of dialogs on rotation?

rayliverified commented 8 years ago

This behavior persists even when "setCancellable()" is set to false. This is a bug as sometimes you want to force your user to make a selection when they activate the dialogue. If the user can accidentally cancel the dialogue by rotating their device, it may cause errors with other event processing. For example, if I offer the user the ability to delete a message and popup this dialogue to confirm their deletion, I do not want the process to be canceled half way.

rayliverified commented 8 years ago

I can confirm that this issue is fixed in the latest build. The dialog does not close on rotate. Thank you @javiersantos for the fix!

Sleeper9 commented 8 years ago

Great, I'll test it and close the issue then!

Rainer-Lang commented 8 years ago

@searchy2 Which commit?

javiersantos commented 8 years ago

On my side the dialog seems to be closed when the screen is rotated.

Adding android:configChanges="orientation|screenSize" in your <activity> tag of the AndroidManifest.xml file (see this commit) will avoid dismissal of the dialog (the activity won't be recreated when the screen is rotated).

I know that it isn't the best solution, but it will work as a temporally workaround.

Hope it helps.

rayliverified commented 8 years ago

@rainer-lang If you set setCancellable(false), the dialogue does not close on rotate.

javiersantos commented 7 years ago

DialogFraments are supported since the 2.1 release. See an example in the sample app.