diff --git a/app/src/main/java/corewala/buran/ui/GemActivity.kt b/app/src/main/java/corewala/buran/ui/GemActivity.kt index f31cd0a..1ae27e8 100644 --- a/app/src/main/java/corewala/buran/ui/GemActivity.kt +++ b/app/src/main/java/corewala/buran/ui/GemActivity.kt @@ -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