Merge pull request #1521 from osodebailar/features/themeswitcher_replace_event_location

Theme switcher preparation: replace event location
This commit is contained in:
Milos Kozak 2022-03-30 19:51:36 +02:00 committed by GitHub
commit dbd8488e14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 23 additions and 20 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,15 +1,33 @@
package info.nightscout.androidaps.activities package info.nightscout.androidaps.activities
import android.content.Context import android.content.Context
import android.os.Bundle import android.os.Bundle
import info.nightscout.androidaps.core.R 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 info.nightscout.androidaps.utils.locale.LocaleHelper
import io.reactivex.rxjava3.disposables.CompositeDisposable
import javax.inject.Inject
open class NoSplashAppCompatActivity : DaggerAppCompatActivityWithResult() { 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) super.onCreate(savedInstanceState)
setTheme(R.style.AppTheme_NoActionBar) 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) { override fun attachBaseContext(newBase: Context) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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