jaredrummler / Cyanea

A theme engine for Android
Apache License 2.0
1.45k stars 144 forks source link

Not Compatible with Android Q #62

Closed rgocal closed 5 years ago

rgocal commented 5 years ago

IllegalStateException: when (name) { LAYOUT…etSystemService(name) } must not be null at com.jaredrummler.cyanea.inflator.CyaneaContextWrapper.getSystemService

xDragonZ commented 5 years ago

try this

allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }
    dependencies {
        implementation 'com.github.jaredrummler:Cyanea:-e3a38f0d13-1
    }
xDragonZ commented 5 years ago

Above should fix the crash but Cyanea currently doesn't seem to support for android Q toolbar/accent theming, it become transparent color.

Commit from #282a60a doesn't seem to be related

@jaredrummler any idea why? so that I can try to find a fix

rgocal commented 5 years ago

This works for me in the mean time. Good work. I use Cyanea in my latest launcher project and seeing android Q users excluded was alittle bummy

jaredrummler commented 5 years ago

The crash seems to be related to the Gradle version used to build the library. Odd. I will update the lib soon.

I will also add a fix for the transparent Toolbar. I need to do some digging to find out what exactly changed in Android Q. I'm hesitant to admit my first time installing Q beta build was last night.

The transparent toolbar is related to the default primary dark colors specified by the library. I'm sure if you specified dark and light primary colors in the app's colors.xml it would fix it. By default the colors are transparent but should be changed with Cyanea magic at runtime.

Example temp fix for transparent toolbar:

  <!-- Primary colors -->
  <eat-comment/>
  <color name="cyanea_primary_reference">REPLACE_WITH_PRIMARY_COLOR</color>
  <color name="cyanea_primary_light_reference">REPLACE_WITH_LIGHTER_PRIMARY_COLOR</color>
  <color name="cyanea_primary_dark_reference">REPLACE_WITH_DARKER_PRIMARY_COLOR</color>

  <!-- Accent colors -->
  <eat-comment/>
  <color name="cyanea_accent_reference">REPLACE_WITH_ACCENT_COLOR</color>
  <color name="cyanea_accent_light_reference">REPLACE_WITH_LIGHTER_ACCENT_COLOR</color>
  <color name="cyanea_accent_dark_reference">REPLACE_WITH_DARKER_ACCENT_COLOR</color>
rgocal commented 5 years ago

Looking forward to this patch, thankyou. I have an essential phone with Android Q if any in depth testing is needed and I use this library in a new launcher project im working on.

also, noticed in the style that a few things should be set default or have more control over like round dialogs (bottomsheets and alerts)

rgocal commented 5 years ago

works now! updated the library in my launcher and everything seems to be just fine so far