Cyanea icon indicating copy to clipboard operation
Cyanea copied to clipboard

Cyanea incorrectly puts the background buttons on a dialog in accentColor

Open jrcacd opened this issue 5 years ago • 8 comments

They were: textColor = accent BackgroundColor = transparent

photo_2019-01-17_09-33-06

jrcacd avatar Jan 17 '19 09:01 jrcacd

I have an issue where i get buttons styled like that instead of TextButton styled ones when I have my theme descend from Themes.Cyanea.NoActionBar (dark or light), and when inspecting the layout it seems it is applying android:style/ThemeOverlay.Material.Dialog.Alert() instead of my.bundle.identifier.dev:style/ThemeOverlay.MaterialComponents.Dialog.Alert() (and this latter seems to have been applied twice..?). Any tips regarding this?

simpers avatar Feb 27 '19 07:02 simpers

Similarly, the text color of DialogButtons are incorrectly colored with colorPrimary, when they are typically colored with colorAccent. The AndroidX library versions for ListPreference, PreferenceDialogFragments, and other misc AlertDialogs have this same behavior

bwalsh0 avatar Mar 10 '19 04:03 bwalsh0

If someone posts simple sample code it would be much appreciated.

jaredrummler avatar Mar 11 '19 00:03 jaredrummler

In my scenario, I'm using the ThemePickerActivity and your provided JSON themes per the documentation:

 {
    "theme_name": "Reddit",
    "base_theme": "DARK",
    "primary": "#FF000000",
    "primary_dark": "#FF000000",
    "primary_light": "#FF262626",
    "accent": "#FFFF3D00",
    "accent_dark": "#FFD83300",
    "accent_light": "#FFFF5A26",
    "background": "#FF212121",
    "background_dark": "#FF1C1C1C",
    "background_light": "#FF424242"
  }

Colors DialogButtons with the above-defined "primary" or "primary_dark", when it should be colored with "accent". My dialogs use the parent style from Theme.Cyanea.Light. I've tried your "Reddit" Cyanea Theme and my own, and both cases do the same.

Affected components:

  • AlertDialog.Builder
  • Dialogs from Preferences (ListPreference, EditTextPreference, etc.)
  • All dialogs from what I've seen

To Reproduce: (In Java, sorry) This is an AlertDialog.Builder from 'androidx.appcompat.app.AlertDialog'

      final AlertDialog.Builder sampleDialog = new AlertDialog.Builder(mContext);
      sampleDialog.setMessage("Sample Dialog")
                     .setNegativeButton("Close", (thisDialog, id) -> thisDialog.dismiss());
                    });
      sampleDialog.show();

Or, you can create an EditTextPreference on a PreferenceScreen and the same occurs.

On a related note, CheckBoxPreferences have their checkboxes colored by the some variant of the background color, when they should also be colorAccent.

bwalsh0 avatar Mar 11 '19 00:03 bwalsh0

Any updates on this?

jrcacd avatar Apr 12 '19 08:04 jrcacd

Using this library also having the same issue

https://github.com/wdullaer/MaterialDateTimePicker

xDragonZ avatar Jun 06 '19 08:06 xDragonZ

Is there a way to fix it?

tutaf avatar Oct 29 '20 17:10 tutaf

Has there been anyway to fix this?

drewstephensdesigns avatar Feb 16 '21 12:02 drewstephensdesigns