7

I know I can add resources for some Android versions + for night mode.

But what would be the name of the folder for night mode resources of API 21+ ?

drawable-night-v21?

Elad Benda
  • 35,076
  • 87
  • 265
  • 471

1 Answers1

6

That should be correct. Based on the legendary "Table 2":

  • night is the qualifier for night mode
  • v21 is the qualifier for API Level 21+ devices
  • night appears higher in Table 2 than does v21, so night appears first in the directory name

So, -night-v21 would be the suffix for any resource directory in which you will have night mode resources to be used on API Level 21+ devices.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 1
    Should we add the v21 though? From which version is it supported as more than just car and/or dock mode weird case ? – android developer Jul 16 '19 at 12:53
  • @androiddeveloper: "Should we add the v21 though?" -- the asker of the question wanted it, so I rolled with it. :-) "From which version is it supported as more than just car and/or dock mode weird case ?" -- I would not expect night mode to be tied to docks (there are other qualifiers for those). `-night` has been around since API Level 8. However, I never did much research into its behavior, in large part because the trigger mechanism was murky. – CommonsWare Jul 16 '19 at 12:59
  • Maybe the support library allows using it from API 21 , manually, and on Android Q it's also possible to do it automatically? But then, why add the v21 qualifier... It's not like it could hurt before, no? Odd... – android developer Jul 16 '19 at 14:06