MODE_NIGHT_AUTO_BATTERY: Night mode switches on when Battery Saver is enabled.Inside of the class, there are a few constants prefixed with MODE_NIGHT, with each representing a flag that determines how your app switches to the dark theme. The first concept that we need to understand are the MODE_NIGHT flags. To follow along with the tutorial, perform the steps below:Ĭreate a new Android project with the default Empty Activity.Įxtract the Hello World! String resource to the strings.xml file, so res/values/strings.xml should have Hello World! The version used in this tutorial is Arctic Fox 2020.3.1 Patch 3. GoalsĪt the end of the tutorial, you would have learned: In this tutorial, we will learn how to add a dark theme to your native Android app. With OLED screens becoming more and more common on smartphones, adapting a dark theme to your app can provide a boost to battery life.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |