hotchemi / Android-Rate

Android-Rate is a library to help you promote your android app by prompting users to rate the app after using it for a few days.
http://hotchemi.github.io/Android-Rate
MIT License
720 stars 216 forks source link

Buttons being shown in the vertical orientation on Marshmallow #72

Closed daividssilverio closed 9 years ago

daividssilverio commented 9 years ago

Hi there. I'm using version 0.5.3. It seems there is a bug with this library when using Marshmallow. The buttons for the dialog are being stacked, just like if they are in a linearlayout with the orientation set to horizontal.

Running your sample app. device-2015-10-13-163807

hotchemi commented 9 years ago

Thx, I'm gonna investigate it.

daividssilverio commented 9 years ago

Thanks! It seems to be a problem with the styles applied to the Alert Dialog and the ButtonBar on the AlertDialog... I've overridden these styles on API>21 as an temporary workaround for the project I'm working.

<style name="CustomLollipopDialogStyle" parent="android:Theme.Material.Light.Dialog.Alert">
</style>
<style name="CustomButtonBarStyle" parent="@android:style/Widget.Material.Light.ButtonBar.AlertDialog">
</style>
<style name="CustomButtonBarButtonStyle" parent="@android:style/Widget.Material.Light.Button.Borderless.Colored">
</style>
hotchemi commented 9 years ago

Yeah it's actually the fix for lollipop bug. http://stackoverflow.com/questions/26708976/alert-dialog-buttons-problems-in-android-l I should change to adopt it only API level 21 and 22.

hotchemi commented 9 years ago

Fixed and pushed.

thinkpozzitive commented 9 years ago

hotchemi: version 0.5.5 still has this behavior on android marshmallow. The buttons are still vertically stacked.

hotchemi commented 9 years ago

@thinkpozzitive Could u show the sample? I tested in sample module but it did not occur.

thinkpozzitive commented 9 years ago

So it seems that because I was using a app theme which was a parent of AppCompat and because I was applying a background color to the alert dialog which had a parent of Theme.AppCompat.Dialog.Alert I was experiencing the issue above.

All I had to do what to point my customization of the alert dialog to a similar style like yours (and switch from parent="Theme.AppCompat.Dialog.Alert" to parent="android:Theme.Material.Dialog.Alert") where I only added and additional item for the windowbackground.

hotchemi commented 9 years ago

@thinkpozzitive Umm could u give me a pull request?

pdavid0 commented 8 years ago

I know it an old thread but I have the same problem with Android N and I am not using custom themes for the dialog.

Sohuld I open a new issue ?

johncodeos commented 8 years ago

Same problem here for 6.0 version

OneManStudioDotSe commented 6 years ago

Did you find a solution to this problem? I still have it with the latest version of the library running on Android 8.1.

navczydev commented 5 years ago

it's still there tested @android9