8000 Add a theme setting: as in the system, light or dark by Zokii0 · Pull Request #6 · bl3xand/APK-Toolbox · GitHub
[go: up one dir, main page]

Skip to content

Add a theme setting: as in the system, light or dark - #6

Open
Zokii0 wants to merge 1 commit into
bl3xand:mainfrom
Zokii0:theme-setting
Open

Zokii0 wants to merge 1 commit into
bl3xand:mainfrom
Zokii0:theme-setting

Conversation

@Zokii0
@Zokii0 Zokii0 commented Nov 29, 2026
Copy link
Copy Markdown

What

The app always follows the system's dark mode. There is no way to have APK Toolbox dark while the rest of the phone is light, or the other way around.

This adds a Theme row to the settings, right under Language, built the same way: a heading, a one-line description and a button that opens the usual pick list.

  • As in the system is the default, so nothing changes for anyone who doesn't touch the setting
  • Light
  • Dark

How

  • New AppTheme enum (settings/AppTheme.kt) maps each choice to an AppCompatDelegate night mode.
  • The choice is stored in AppSettings.theme under the key theme.
  • App.onCreate applies the stored choice before the first activity is created, so the app never opens in one theme and then flips to the other.
  • When a different theme is picked, AppCompatDelegate.setDefaultNightMode is called and the open screens are rebuilt in the new theme. The theme keeps Theme.Material3Expressive.DynamicColors.DayNight, so dynamic colours still work in both modes.
  • New ic_theme icon (a Material palette icon).
  • Strings are added for all 16 languages the app ships. The non-English ones are my best effort, so corrections are welcome.

Testing

  • Default (As in the system): the app follows the system's dark mode as before
  • Light while the system is dark, and Dark while the system is light
  • The choice survives an app restart, and the app opens straight in the chosen theme
  • The settings sheet comes back after the theme switches

The app follows the system's dark mode with no way to choose otherwise.
A Theme row under Language in the settings now picks between As in the
system (the default, unchanged behaviour), Light and Dark. The choice is
stored with the other settings and applied in App.onCreate, before the
first screen is made, through AppCompatDelegate.setDefaultNightMode.
Strings are added for every language the app ships.
@bl3xand
bl3xand commented Dec 1, 2026
Copy link
Copy Markdown
Owner

Hi. I’ll include this in the next releases. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0