Compare commits

..

No commits in common. "ab4b1ae6447eb2b51326f29b18e6f04f88b96592" and "87ea44754e983b04412ce0f9ae9509533feddf10" have entirely different histories.

4 changed files with 2 additions and 35 deletions

View File

@ -15,8 +15,7 @@
android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_security_config"
android:theme="@style/NoBar"
android:dataExtractionRules="@xml/data_extraction_rules"
android:configChanges="uiMode">
android:dataExtractionRules="@xml/data_extraction_rules">
<activity
android:name=".MainActivity"
android:theme="@style/SplashTheme"

View File

@ -3,14 +3,11 @@ package bou.amine.apps.readerforselfossv2.android
import android.app.NotificationChannel
import android.app.NotificationManager
import android.content.Context
import android.content.res.Configuration
import android.graphics.drawable.Drawable
import android.net.Uri
import android.os.Build
import android.widget.ImageView
import android.widget.Toast
import androidx.appcompat.app.AppCompatDelegate
import androidx.appcompat.app.AppCompatDelegate.*
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.ProcessLifecycleOwner
@ -51,7 +48,6 @@ class MyApp : MultiDexApplication(), DIAware {
private val viewModel: AppViewModel by instance()
private val connectivityStatus: ConnectivityStatus by instance()
private val driverFactory: DriverFactory by instance()
private val appSettingsService : AppSettingsService by instance()
// TODO: handle with the "previous" way
private val isConnectionAvailable: MutableStateFlow<Boolean> = MutableStateFlow(true)
@ -136,19 +132,6 @@ class MyApp : MultiDexApplication(), DIAware {
}
}
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
if (appSettingsService.getCurrentTheme() == MODE_NIGHT_FOLLOW_SYSTEM) {
var mode = when (newConfig.uiMode and Configuration.UI_MODE_NIGHT_MASK) {
Configuration.UI_MODE_NIGHT_YES -> MODE_NIGHT_YES
else -> MODE_NIGHT_NO
}
setDefaultNightMode(mode)
}
}
class AppLifeCycleObserver(val connectivityStatus: ConnectivityStatus, val repository: Repository) : DefaultLifecycleObserver {
override fun onResume(owner: LifecycleOwner) {

View File

@ -9,7 +9,7 @@
<string-array name="ModeValues">
<item>1</item> <!--MODE_NIGHT_NO-->
<item>2</item> <!--MODE_NIGHT_YES-->
<item>-1</item> <!--MODE_NIGHT_FOLLOW_SYSTEM-->
<item>0</item> <!--MODE_NIGHT_AUTO_TIME-->
</string-array>
<string-array name="Voice">

View File

@ -35,7 +35,6 @@ class AppSettingsService {
private var _fontSize: Int? = null
private var _staticBar: Boolean? = null
private var _font: String = ""
private var _theme: Int? = null
init {
@ -319,17 +318,6 @@ class AppSettingsService {
return _font
}
private fun refreshCurrentTheme() {
_theme = settings.getString(CURRENT_THEME, "-1").toInt()
}
fun getCurrentTheme(): Int {
if (_theme == null) {
refreshCurrentTheme()
}
return _theme ?: -1
}
fun refreshApiSettings() {
refreshPassword()
refreshUsername()
@ -358,7 +346,6 @@ class AppSettingsService {
refreshFontSize()
refreshFont()
refreshStaticBarEnabled()
refreshCurrentTheme()
}
fun refreshLoginInformation(
@ -457,7 +444,5 @@ class AppSettingsService {
const val INFINITE_LOADING = "infinite_loading"
const val ITEMS_CACHING = "items_caching"
const val CURRENT_THEME = "currentMode"
}
}