material-components-android-compose-theme-adapter icon indicating copy to clipboard operation
material-components-android-compose-theme-adapter copied to clipboard

context.theme.key, getDeclaredMethod will always throw if we target SDK 32

Open KoTius opened this issue 2 years ago • 2 comments

If we target SDK32 the Resources.Theme::class.java.getDeclaredMethod("getKey") will always throw so we can't use this method for re-compositions optimizations for createMdcTheme()

KoTius avatar May 20 '22 15:05 KoTius

Thanks for raising this. Unfortunately SDK 32 has changed Resources.Theme.getKey to a hidden method, so the current reflection implementation can't work. I'll think about this some more but perhaps the fallback of just using the theme directly as a key is fine.

ricknout avatar May 23 '22 13:05 ricknout

Is this still a problem? Sounds like something which needs adressing, especially since we're at API 33 as a stable release already.

StylianosGakis avatar Aug 29 '22 15:08 StylianosGakis