replace EventThemeSwitch to the right place and add event to nosplash

This commit is contained in:
osodebailar 2022-03-30 18:42:23 +02:00
parent 72ed212d37
commit 0f4aed5ef5
17 changed files with 23 additions and 20 deletions

View file

@ -70,7 +70,6 @@ class MainActivity : NoSplashAppCompatActivity() {
private val disposable = CompositeDisposable()
@Inject lateinit var aapsSchedulers: AapsSchedulers
@Inject lateinit var rxBus: RxBus
@Inject lateinit var androidPermission: AndroidPermission
@Inject lateinit var sp: SP
@Inject lateinit var versionCheckerUtils: VersionCheckerUtils

View file

@ -52,7 +52,6 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
@Inject lateinit var injector: HasAndroidInjector
@Inject lateinit var aapsSchedulers: AapsSchedulers
@Inject lateinit var rxBus: RxBus
@Inject lateinit var sp: SP
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var defaultValueHelper: DefaultValueHelper

View file

@ -38,7 +38,6 @@ class ProfileHelperActivity : NoSplashAppCompatActivity() {
@Inject lateinit var defaultProfile: DefaultProfile
@Inject lateinit var defaultProfileDPV: DefaultProfileDPV
@Inject lateinit var localProfilePlugin: LocalProfilePlugin
@Inject lateinit var rxBus: RxBus
@Inject lateinit var dateUtil: DateUtil
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var repository: AppRepository

View file

@ -31,7 +31,6 @@ import javax.inject.Inject
class SmsCommunicatorOtpActivity : NoSplashAppCompatActivity() {
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var rxBus: RxBus
@Inject lateinit var smsCommunicatorPlugin: SmsCommunicatorPlugin
@Inject lateinit var otp: OneTimePassword
@Inject lateinit var uel: UserEntryLogger

View file

@ -34,7 +34,6 @@ class SetupWizardActivity : NoSplashAppCompatActivity() {
@Inject lateinit var injector: HasAndroidInjector
@Inject lateinit var localProfilePlugin: LocalProfilePlugin
@Inject lateinit var swDefinition: SWDefinition
@Inject lateinit var rxBus: RxBus
@Inject lateinit var sp: SP
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var aapsSchedulers: AapsSchedulers

View file

@ -1,15 +1,33 @@
package info.nightscout.androidaps.activities
import android.content.Context
import android.os.Bundle
import info.nightscout.androidaps.core.R
import info.nightscout.androidaps.events.EventThemeSwitch
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.utils.locale.LocaleHelper
import io.reactivex.rxjava3.disposables.CompositeDisposable
import javax.inject.Inject
open class NoSplashAppCompatActivity : DaggerAppCompatActivityWithResult() {
override fun onCreate(savedInstanceState: Bundle?) {
@Inject lateinit var rxBus: RxBus
private val compositeDisposable = CompositeDisposable()
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setTheme(R.style.AppTheme_NoActionBar)
compositeDisposable.add(rxBus.toObservable(EventThemeSwitch::class.java).subscribe {
recreate()
})
}
override fun onDestroy() {
compositeDisposable.clear()
super.onDestroy()
}
override fun attachBaseContext(newBase: Context) {

View file

@ -44,7 +44,6 @@ import kotlin.math.roundToInt
class TDDStatsActivity : NoSplashAppCompatActivity() {
@Inject lateinit var rxBus: RxBus
@Inject lateinit var sp: SP
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var activePlugin: ActivePlugin

View file

@ -1,3 +1,3 @@
package info.nightscout.androidaps.events
class EventThemeSwitch : Event()
package info.nightscout.androidaps.events
class EventThemeSwitch : Event()

View file

@ -38,7 +38,6 @@ import javax.inject.Inject
class DanaHistoryActivity : NoSplashAppCompatActivity() {
@Inject lateinit var rxBus: RxBus
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var activePlugin: ActivePlugin

View file

@ -26,7 +26,6 @@ import kotlin.math.min
class DanaUserOptionsActivity : NoSplashAppCompatActivity() {
@Inject lateinit var rxBus: RxBus
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var context: Context
@Inject lateinit var danaPump: DanaPump

View file

@ -30,7 +30,6 @@ import javax.inject.Inject
class BLEScanActivity : NoSplashAppCompatActivity() {
@Inject lateinit var sp: SP
@Inject lateinit var rxBus: RxBus
@Inject lateinit var blePreCheck: BlePreCheck
@Inject lateinit var context: Context

View file

@ -22,7 +22,6 @@ import kotlin.experimental.xor
class EnterPinActivity : NoSplashAppCompatActivity() {
@Inject lateinit var rxBus: RxBus
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var danaRSPlugin: DanaRSPlugin
@Inject lateinit var sp: SP

View file

@ -32,7 +32,6 @@ import javax.inject.Inject
class DiaconnG8BLEScanActivity : NoSplashAppCompatActivity() {
@Inject lateinit var sp: SP
@Inject lateinit var rxBus: RxBus
@Inject lateinit var blePreCheck: BlePreCheck
@Inject lateinit var context: Context

View file

@ -33,7 +33,6 @@ import javax.inject.Inject
class DiaconnG8HistoryActivity : NoSplashAppCompatActivity() {
@Inject lateinit var rxBus: RxBus
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var activePlugin: ActivePlugin

View file

@ -25,7 +25,6 @@ import javax.inject.Inject
class DiaconnG8UserOptionsActivity : NoSplashAppCompatActivity() {
@Inject lateinit var rxBus: RxBus
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var context: Context
@Inject lateinit var diaconnG8Pump: DiaconnG8Pump

View file

@ -28,7 +28,6 @@ import javax.inject.Inject
class DashPodManagementActivity : NoSplashAppCompatActivity() {
@Inject lateinit var rxBus: RxBus
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var commandQueue: CommandQueue
@Inject lateinit var injector: HasAndroidInjector

View file

@ -43,7 +43,6 @@ import javax.inject.Inject
*/
class ErosPodManagementActivity : NoSplashAppCompatActivity() {
@Inject lateinit var rxBus: RxBus
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var commandQueue: CommandQueue
@Inject lateinit var podStateManager: ErosPodStateManager