Closed fgnm closed 4 years ago
Are you using withNoToolbarTheme(true)
? I recommend you set this to false.
No, I'm not using withNoToolbarTheme(true)
Are you using latest version implementation 'com.github.MFlisar:GDPRDialog:1.4.2'
?
Are you using BottomSheetDialogFragment ?
Yes, I'm using the latest version implementation 'com.github.MFlisar:GDPRDialog:1.4.2'
. This is my init code:
mGDPRSetupetup = new GDPRSetup(GDPRDefinitions.ADMOB, GDPRDefinitions.FIREBASE_ANALYTICS, GDPRDefinitions.FABRIC_CRASHLYTICS, GDPRDefinitions.FABRIC_ANSWERS)
.withAllowNoConsent(false)
.withExplicitAgeConfirmation(false)
.withCheckRequestLocation(GDPRLocationCheck.DEFAULT)
.withBottomSheet(true)
.withForceSelection(true)
.withShortQuestion(true)
.withPrivacyPolicy("...url...")
.withLoadAdMobNetworks("...id...");
GDPR.getInstance().checkIfNeedsToBeShown(this, mGDPRSetupetup);
This behaviour has appear after upgrade to latest stable of the material library implementation 'com.google.android.material:material:1.1.0'
As I can see here this library still uses 1.0.0
Add:
.withCustomDialogTheme(R.style.ThemeOverlay_MaterialComponents_BottomSheetDialog_Custom)
Add custom style to styles.xml:
<style name="ThemeOverlay.MaterialComponents.BottomSheetDialog.Custom" parent="ThemeOverlay.MaterialComponents.BottomSheetDialog">
<item name="titleTextColor">@android:color/white</item>
</style>
It does not work, I've tried to do so:
<style name="ThemeOverlay.MaterialComponents.BottomSheetDialog.Custom" parent="ThemeOverlay.MaterialComponents.BottomSheetDialog">
<item name="android:textColorPrimary">@android:color/white</item>
<item name="android:textColor">@android:color/black</item>
</style>
And I've got the desired result. However is a bit tricky as method, maybe could be used a cleaner way.
Another way is overwriting the resource in your app: https://github.com/MFlisar/GDPRDialog/blob/master/library/src/main/res/layout/gdpr_dialog.xml
Can't decide on if this qualifies as a cleaner way, but it does allow you to apply a style or theme to the toolbar directly.
Sorry for the late reply.
I updated the versions in the demo app and used some custom colors in the demo app - can you reproduce your issue in the demo as well?
Generally make sure you use a Theme.MaterialComponents.*
theme as your apps theme, the library only works with them.
closing because there is no communication anymore
I've just update the material library to stable 1.1.0, and the toolbar of the GDPRDialog changed. The color it's nice, but I'm not able to change the color of the title. Here is an image:
I would like to have the title with white color.