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
724 stars 216 forks source link

Dialog button text color #112

Open gregacucnik opened 8 years ago

gregacucnik commented 8 years ago

For some reason dialog button text color is red and not primary color. If i remember correctly it used to work and text was colored by primary color.

Could you add an option to set buttons text color?

alertDialog.getButton(DialogInterface.BUTTON_POSITIVE).setTextColor();
alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL).setTextColor();
alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE).setTextColor();
jmhabuild commented 7 years ago

Hello hotchemi, Do you have any update for this issue? I also need to change the button text color.

vbuberen commented 7 years ago

@gregacucnik, @jmhabuild try use ContextThemeWrapper to make dialog look other dialogs in your app. For example I`ve used method like this:

public static ContextThemeWrapper getAlertDialogContext(Context context) {
        return new ContextThemeWrapper(context, R.style.AlertDialog);
}

Style AlertDialog is defined in styles as:

<style name="AlertDialog" parent="Theme.AppCompat.Light.Dialog">
        <item name="android:textColorPrimary">@color/black</item>
        <item name="android:textColor">@color/primaryColor</item>
</style>

After that, just call AppRate.with(getAlertDialogContext(this)).// other parameters It should help.