mirror of
https://github.com/Corewala/Buran
synced 2024-12-22 07:42:43 +00:00
Checks theme in preferences on startup
This commit is contained in:
parent
fbf6c80282
commit
1542ec5539
1 changed files with 7 additions and 0 deletions
|
@ -19,6 +19,7 @@ import android.widget.EditText
|
|||
import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.browser.customtabs.CustomTabsIntent
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.preference.PreferenceManager
|
||||
|
@ -147,6 +148,12 @@ class GemActivity : AppCompatActivity() {
|
|||
|
||||
prefs = PreferenceManager.getDefaultSharedPreferences(this)
|
||||
|
||||
when (prefs.getString("theme", "theme_FollowSystem")) {
|
||||
"theme_FollowSystem" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
|
||||
"theme_Light" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
|
||||
"theme_Dark" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
|
||||
}
|
||||
|
||||
adapter = AbstractGemtextAdapter.getAdapter(onLink, inlineImage)
|
||||
|
||||
binding.gemtextRecycler.adapter = adapter
|
||||
|
|
Loading…
Reference in a new issue