SetupWizardActivity -> jetpack

This commit is contained in:
Milos Kozak 2021-01-25 12:09:22 +01:00
parent aeec33eb9e
commit f33c7f0b79

View file

@ -8,6 +8,7 @@ import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.MainActivity import info.nightscout.androidaps.MainActivity
import info.nightscout.androidaps.R import info.nightscout.androidaps.R
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.activities.NoSplashAppCompatActivity
import info.nightscout.androidaps.databinding.ActivitySetupwizardBinding
import info.nightscout.androidaps.events.EventProfileNeedsUpdate import info.nightscout.androidaps.events.EventProfileNeedsUpdate
import info.nightscout.androidaps.events.EventProfileStoreChanged import info.nightscout.androidaps.events.EventProfileStoreChanged
import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.events.EventPumpStatusChanged
@ -23,7 +24,6 @@ import info.nightscout.androidaps.utils.locale.LocaleHelper.update
import info.nightscout.androidaps.utils.sharedPreferences.SP import info.nightscout.androidaps.utils.sharedPreferences.SP
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable import io.reactivex.disposables.CompositeDisposable
import kotlinx.android.synthetic.main.activity_setupwizard.*
import javax.inject.Inject import javax.inject.Inject
import kotlin.math.max import kotlin.math.max
import kotlin.math.min import kotlin.math.min
@ -43,10 +43,14 @@ class SetupWizardActivity : NoSplashAppCompatActivity() {
private val intentMessage = "WIZZARDPAGE" private val intentMessage = "WIZZARDPAGE"
private lateinit var binding: ActivitySetupwizardBinding
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
update(applicationContext) update(applicationContext)
setContentView(R.layout.activity_setupwizard) binding = ActivitySetupwizardBinding.inflate(layoutInflater)
setContentView(binding.root)
screens = swDefinition.getScreens() screens = swDefinition.getScreens()
val intent = intent val intent = intent
currentWizardPage = intent.getIntExtra(intentMessage, 0) currentWizardPage = intent.getIntExtra(intentMessage, 0)
@ -114,7 +118,7 @@ class SetupWizardActivity : NoSplashAppCompatActivity() {
val currentItem = currentScreen.items[i] val currentItem = currentScreen.items[i]
currentItem.generateDialog(layout) currentItem.generateDialog(layout)
} }
sw_scrollview?.smoothScrollTo(0, 0) binding.swScrollview.smoothScrollTo(0, 0)
} }
override fun updateButtons() { override fun updateButtons() {