- // Get the current theme status.
- val currentThemeStatus = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
-
- // Set the style and the icon according to the theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
- // Set a dark icon.
- dialogBuilder.setIcon(R.drawable.about_night)
- } else {
- // Set a light icon.
- dialogBuilder.setIcon(R.drawable.about_day)
- }