green-code-initiative / ecoCode-android

Reduce the environmental footprint of your Java-based Android apps with SonarQube
https://ecocode.io
GNU General Public License v3.0
54 stars 17 forks source link

[Android] Sobriety > Dark UI (ESOB004) #46

Open StanislasJC opened 1 year ago

StanislasJC commented 1 year ago

Improvement of the following issue : Add Theme.MaterialComponents.Light detection in DarkUIThemeXmlRule https://github.com/green-code-initiative/ecoCode-mobile/issues/32**

Developers are allowed to apply native themes for their app, or derive new ones throught inheritence. This decision has a significant impact on energy consumption since displaying dark colors is particularly beneficial for mobile devices with (AM)OLED screens (under certain conditions). By default Android will set a dark style and hence switching to the light theme (parent style Theme.*.Light) within the manifest should be avoided. Of course, custom resources like bright colors values and bitmap images with too high luminance should be avoided too.