1

I am developing and Android app for my Android 12 device. Naturaly, I want the UI to match the new Material 3 design.

However, how are older devices handled? How can I make my app look native on Android 11 as well?

Currently I have MDC version 1.5.0 as a dependency for my project. As far as I understood, this makes the UI always look like Material 3, independent of which device it runs on.

mainrs
  • 43
  • 3
  • Did you find a way??? – Yasiru Nayanajith Jun 05 '22 at 17:12
  • No, and I think it is not a recommended way to build an app. You introduce almost double the amount of code. Take a look at Google Apps like Maps and Translate. They both use Material 3 design, independent on the Android version they run on. – mainrs Jun 07 '22 at 13:24
  • All I need is to change the colors of the material3 on lower sdk version dynamically. Still did not found a way. So sad. – Yasiru Nayanajith Jun 08 '22 at 14:02
  • Do you mean based on the wallpaper? I think that's only possible on SDK 31+. It's an Android feature, not a Material feature basically. – mainrs Jun 09 '22 at 09:16
  • 1
    Not the whole wallpaper feature. It would be nice if we could give a specific color and then the library may generate the required colors according to the color we gave. I am looking for a feature like that for lower sdk versions. – Yasiru Nayanajith Jun 10 '22 at 10:03
  • Ah, that is possible on lower SDKs as well. When creating your `MaterialTheme` you can use any logic to assign the colors. You can get the user's current wallpaper using `WallpaperManager` and then analyze it to generate the colors. You would need some type of library that can generate them or write the logic yourself. – mainrs Jun 21 '22 at 11:31
  • How to create the material theme programtically – Yasiru Nayanajith Jun 21 '22 at 17:39
  • I've mostly focused on Jetpack Compose. There it is definitely possible. You can have a look here: https://developer.android.com/jetpack/compose/themes/material I don't think it's possible if using xml resource files and traditional views. – mainrs Jul 26 '22 at 16:45

0 Answers0