Android-Rate icon indicating copy to clipboard operation
Android-Rate copied to clipboard

Dialog not using app custom theme

Open paddykily opened this issue 9 years ago • 6 comments

paddykily avatar May 04 '16 17:05 paddykily

@hotchemi I'm not entirely sure why this issue was created, but I think it might be related to an issue I'm seeing.

I'm passing in a wrapped context

ContextThemeWrapper(context, R.style.my_style)

which has a theme specifically for dialogs. However since you call getApplicationContext on the passed in Context, the theme doesn't work.

bclymer avatar May 19 '16 15:05 bclymer

Just ran into this:

I have a dark theme in my app, the dialog shows up as light, i.e it does not inherit the app's theme.

I tried the ContextThemeWrapper way as well but @bclymer says it's basically ignored:

AppRate.with(new ContextThemeWrapper(this, R.style.AppRateDialogTheme))

private AppRate(Context context) {
    this.context = context.getApplicationContext();
}

Why is getApplicationContext() being called anyways? We don't need the context of the global application object for a simple dialog, plus the user should be responsible for sending the appropriate context.

Edit: Using a custom view doesn't help either, this should be marked as a bug.

Aditya94A avatar Jul 14 '16 15:07 Aditya94A

Any update on it ? Is there any new version after 1.0.1?

sundeepkmallick avatar May 15 '18 11:05 sundeepkmallick

Hi @paddykily , @bclymer , @AdityaAnand1 , @sundeepkmallick

You can use https://github.com/Vorlonsoft/AndroidRate and call

AppRate.with(this).setThemeResId(R.style.YourAppRateDialogTheme);

@AdityaAnand1 getApplicationContext() being called because we need the context of the global application object for the library purposes, not the creation of a dialog only; plus the user should be responsible for as few things as possible.

AlexanderLS avatar Sep 05 '18 08:09 AlexanderLS

Hi @AlexanderLS,

Thanks for your response. But I managed to resolve the problem from styles.xml.

The new library which you have referred, does it also support Kotlin? I will let you know if I use the new library in the apps I am working on. Thanks..

sundeepkmallick avatar Sep 05 '18 08:09 sundeepkmallick

Hi @sundeepkmallick ,

Yes, https://github.com/Vorlonsoft/AndroidRate supports Kotlin also. It 245 commits ahead (21,924 lines ++, 6,285 lines --)

AlexanderLS avatar Sep 13 '18 18:09 AlexanderLS