Closed bshv-ciklum closed 1 year ago
@adam1929 any update regarding this issue?
@adam1929 Any updates regarding this open issue?
Thank you @bshv-ciklum for your solution. We are currently working on flutter SDK release that will contains this fix. Please be aware that notification color will ignore alpha values as is written by docs: https://developer.android.com/reference/android/app/Notification#color
pushAccentColor
holds a 32-bits color value.When we perform a conversion from
Double
tosigned Int
(it.toInt()
) and the value is bigger thanInt.MAX_VALUE
thenInt.MAX_VALUE
is returned. https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/to-int.htmlLet's consider the Black color -
0xFF000000
: Binary representation:11111111 00000000 00000000 00000000
Fist bit represents the number signature so when converting from 64-bitsDouble
to 32-bitssigned Int
result will be:01111111 00000000 00000000 00000000
(hex -7F000000
).To avoid this behavior we need to convert through
unsigned Int
- it will not change the most significant bit as it will not be reserved for signature. And thenunsigned Int
tosigned Int
conversion will give us the same binary representation: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/to-int.htmlKotlin playground example: https://pl.kotl.in/8cRHCsinn