Uses the system theme as default theme (#3813)

Set the "System Design" as the default theme.

This ensures that the app's initial behaviour respect's the user's system-wide theme choice, while still allowing the user to adjust it later.

This is only done for new installs of Tusky. If the user is upgrading from a previous release and they did not have an explicit theme set then the dark theme is used, and the UX does not change.
This commit is contained in:
SpaceFox 2023-08-23 15:04:24 +02:00 committed by GitHub
commit 85888ac238
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 13 deletions

View file

@ -94,6 +94,7 @@ import com.keylesspalace.tusky.entity.Emoji
import com.keylesspalace.tusky.entity.NewPoll
import com.keylesspalace.tusky.entity.Status
import com.keylesspalace.tusky.settings.PrefKeys
import com.keylesspalace.tusky.settings.PrefKeys.APP_THEME
import com.keylesspalace.tusky.util.APP_THEME_DEFAULT
import com.keylesspalace.tusky.util.MentionSpan
import com.keylesspalace.tusky.util.PickMediaFiles
@ -208,7 +209,7 @@ class ComposeActivity :
activeAccount = accountManager.activeAccount ?: return
val theme = preferences.getString("appTheme", APP_THEME_DEFAULT)
val theme = preferences.getString(APP_THEME, APP_THEME_DEFAULT)
if (theme == "black") {
setTheme(R.style.TuskyDialogActivityBlackTheme)
}