Add navigation in Replace Pod Wizard
This commit is contained in:
parent
80e0992faa
commit
8563817bae
24 changed files with 246 additions and 58 deletions
|
@ -75,6 +75,7 @@ dependencies {
|
||||||
implementation 'androidx.core:core-ktx:1.2.0'
|
implementation 'androidx.core:core-ktx:1.2.0'
|
||||||
implementation "androidx.preference:preference-ktx:1.1.1"
|
implementation "androidx.preference:preference-ktx:1.1.1"
|
||||||
implementation "androidx.activity:activity-ktx:${activityVersion}"
|
implementation "androidx.activity:activity-ktx:${activityVersion}"
|
||||||
|
implementation "androidx.fragment:fragment:${fragmentVersion}"
|
||||||
implementation 'com.google.android.material:material:1.1.0'
|
implementation 'com.google.android.material:material:1.1.0'
|
||||||
|
|
||||||
implementation 'com.google.firebase:firebase-analytics-ktx:17.4.3'
|
implementation 'com.google.firebase:firebase-analytics-ktx:17.4.3'
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
<activity android:name=".ui.PodManagementActivity" />
|
<activity android:name=".ui.PodManagementActivity" />
|
||||||
<activity android:name=".ui.PodHistoryActivity" />
|
<activity android:name=".ui.PodHistoryActivity" />
|
||||||
<activity android:name=".ui.wizard2.WizardActivity" />
|
<activity android:name=".ui.wizard2.ReplacePodWizardActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.atech.android.library.wizardpager.WizardPagerActivity"
|
android:name="com.atech.android.library.wizardpager.WizardPagerActivity"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
|
|
|
@ -13,7 +13,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.initpod.InitAct
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.initpod.InitPodTask
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.initpod.InitPodTask
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.pages.PodInfoFragment
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.pages.PodInfoFragment
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.removepod.RemoveActionFragment
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.removepod.RemoveActionFragment
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.WizardActivity
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.ReplacePodWizardActivity
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
|
@ -26,7 +26,7 @@ abstract class OmnipodModule {
|
||||||
|
|
||||||
@ActivityScope
|
@ActivityScope
|
||||||
@ContributesAndroidInjector(modules = [OmnipodWizardModule::class])
|
@ContributesAndroidInjector(modules = [OmnipodWizardModule::class])
|
||||||
abstract fun contributesWizardActivity(): WizardActivity
|
abstract fun contributesWizardActivity(): ReplacePodWizardActivity
|
||||||
|
|
||||||
// Fragments
|
// Fragments
|
||||||
@ContributesAndroidInjector abstract fun initActionFragment(): InitActionFragment
|
@ContributesAndroidInjector abstract fun initActionFragment(): InitActionFragment
|
||||||
|
|
|
@ -29,7 +29,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateMa
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.event.EventOmnipodPumpValuesChanged
|
import info.nightscout.androidaps.plugins.pump.omnipod.event.EventOmnipodPumpValuesChanged
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.manager.AapsOmnipodManager
|
import info.nightscout.androidaps.plugins.pump.omnipod.manager.AapsOmnipodManager
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.*
|
import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.*
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.WizardActivity
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.ReplacePodWizardActivity
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.util.AapsOmnipodUtil
|
import info.nightscout.androidaps.plugins.pump.omnipod.util.AapsOmnipodUtil
|
||||||
import info.nightscout.androidaps.queue.Callback
|
import info.nightscout.androidaps.queue.Callback
|
||||||
import info.nightscout.androidaps.queue.events.EventQueueChanged
|
import info.nightscout.androidaps.queue.events.EventQueueChanged
|
||||||
|
@ -94,7 +94,7 @@ class OmnipodFragment : DaggerFragment() {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
omnipod_button_replace_pod.setOnClickListener {
|
omnipod_button_replace_pod.setOnClickListener {
|
||||||
startActivity(Intent(context, WizardActivity::class.java))
|
startActivity(Intent(context, ReplacePodWizardActivity::class.java))
|
||||||
}
|
}
|
||||||
|
|
||||||
omnipod_button_pod_mgmt.setOnClickListener {
|
omnipod_button_pod_mgmt.setOnClickListener {
|
||||||
|
|
|
@ -23,7 +23,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.manager.AapsOmnipodManage
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.model.FullInitPodWizardModel
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.model.FullInitPodWizardModel
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.model.RemovePodWizardModel
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.model.RemovePodWizardModel
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.model.ShortInitPodWizardModel
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.model.ShortInitPodWizardModel
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.WizardActivity
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.ReplacePodWizardActivity
|
||||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||||
import info.nightscout.androidaps.utils.extensions.plusAssign
|
import info.nightscout.androidaps.utils.extensions.plusAssign
|
||||||
|
@ -58,7 +58,7 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
initpod_replace_pod.setOnClickListener {
|
initpod_replace_pod.setOnClickListener {
|
||||||
val myIntent = Intent(this@PodManagementActivity, WizardActivity::class.java)
|
val myIntent = Intent(this@PodManagementActivity, ReplacePodWizardActivity::class.java)
|
||||||
this@PodManagementActivity.startActivity(myIntent)
|
this@PodManagementActivity.startActivity(myIntent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.os.PersistableBundle
|
||||||
|
import androidx.navigation.fragment.NavHostFragment
|
||||||
|
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
class ReplacePodWizardActivity : NoSplashAppCompatActivity() {
|
||||||
|
companion object {
|
||||||
|
const val KEY_START_DESTINATION = "startDestination"
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
lateinit var podStateManager: PodStateManager
|
||||||
|
|
||||||
|
var startDestination: Int = R.id.deactivatePodInfoFragment
|
||||||
|
get() = field
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
if (savedInstanceState == null) {
|
||||||
|
setContentView(R.layout.omnipod_replace_pod_wizard_activity)
|
||||||
|
|
||||||
|
val navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment
|
||||||
|
val navController = navHostFragment.navController
|
||||||
|
val navInflater = navController.navInflater
|
||||||
|
val graph = navInflater.inflate(R.navigation.omnipod_replace_pod_wizard_navigation_graph)
|
||||||
|
|
||||||
|
if (!podStateManager.isPodActivationCompleted) {
|
||||||
|
if (!podStateManager.isPodInitialized || podStateManager.podProgressStatus.isBefore(PodProgressStatus.PRIMING_COMPLETED)) {
|
||||||
|
startDestination = R.id.fillPodInfoFragment
|
||||||
|
} else {
|
||||||
|
startDestination = R.id.attachPodInfoFragment
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
graph.startDestination = startDestination;
|
||||||
|
navController.graph = graph
|
||||||
|
} else {
|
||||||
|
startDestination = savedInstanceState.getInt(KEY_START_DESTINATION, R.id.deactivatePodInfoFragment)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSaveInstanceState(outState: Bundle?, outPersistentState: PersistableBundle?) {
|
||||||
|
super.onSaveInstanceState(outState, outPersistentState)
|
||||||
|
outState?.putInt(KEY_START_DESTINATION, startDestination)
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,13 +0,0 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2
|
|
||||||
|
|
||||||
import android.os.Bundle
|
|
||||||
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
|
||||||
|
|
||||||
class WizardActivity : NoSplashAppCompatActivity() {
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
setContentView(R.layout.omnipod_replace_pod_wizard_activity) // TODO: replace with DataBindingUtil.setContentView
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,73 @@
|
||||||
|
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.Button
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.annotation.IdRes
|
||||||
|
import androidx.annotation.LayoutRes
|
||||||
|
import androidx.navigation.fragment.findNavController
|
||||||
|
import dagger.android.support.DaggerFragment
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.ReplacePodWizardActivity
|
||||||
|
|
||||||
|
abstract class FragmentBase : DaggerFragment() {
|
||||||
|
override fun onCreateView(
|
||||||
|
inflater: LayoutInflater,
|
||||||
|
container: ViewGroup?,
|
||||||
|
savedInstanceState: Bundle?
|
||||||
|
): View? = inflater.inflate(getLayout(), container, false)
|
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
view.findViewById<Button>(R.id.omnipod_replace_pod_wizard_button_cancel)?.setOnClickListener {
|
||||||
|
activity?.finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
val nextButton = view.findViewById<Button>(R.id.omnipod_replace_pod_wizard_button_next)
|
||||||
|
nextButton?.let {
|
||||||
|
val nextPage = getNextPageActionId()
|
||||||
|
|
||||||
|
it.text = if (nextPage == null) {
|
||||||
|
getString(R.string.omnipod_replace_pod_wizard_button_finish)
|
||||||
|
} else {
|
||||||
|
getString(R.string.omnipod_replace_pod_wizard_button_next)
|
||||||
|
}
|
||||||
|
it.setOnClickListener {
|
||||||
|
if (nextPage == null) {
|
||||||
|
activity?.finish()
|
||||||
|
} else {
|
||||||
|
findNavController().navigate(nextPage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val startDestination = (activity as ReplacePodWizardActivity).startDestination
|
||||||
|
val total =
|
||||||
|
when (startDestination) {
|
||||||
|
R.id.fillPodInfoFragment -> {
|
||||||
|
8 - 3
|
||||||
|
}
|
||||||
|
|
||||||
|
R.id.attachPodInfoFragment -> {
|
||||||
|
8 - 5
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> {
|
||||||
|
8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
view.findViewById<TextView>(R.id.omnipod_replace_pod_wizard_progress_indication)?.text = "X/$total"
|
||||||
|
}
|
||||||
|
|
||||||
|
@LayoutRes
|
||||||
|
abstract fun getLayout(): Int
|
||||||
|
|
||||||
|
@IdRes
|
||||||
|
abstract fun getNextPageActionId(): Int?
|
||||||
|
}
|
|
@ -1,20 +1,12 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.action
|
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.action
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import dagger.android.support.DaggerFragment
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.FragmentBase
|
||||||
|
|
||||||
abstract class ActionFragmentBase : DaggerFragment() {
|
abstract class ActionFragmentBase : FragmentBase() {
|
||||||
|
|
||||||
override fun onCreateView(
|
|
||||||
inflater: LayoutInflater,
|
|
||||||
container: ViewGroup?,
|
|
||||||
savedInstanceState: Bundle?
|
|
||||||
): View? = inflater.inflate(R.layout.omnipod_replace_pod_wizard_action_page_fragment, container, false)
|
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
@ -22,4 +14,8 @@ abstract class ActionFragmentBase : DaggerFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract fun getText(): String
|
abstract fun getText(): String
|
||||||
|
|
||||||
|
override fun getLayout(): Int {
|
||||||
|
return R.layout.omnipod_replace_pod_wizard_action_page_fragment
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,9 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.action
|
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.action
|
||||||
|
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
||||||
|
|
||||||
class DeactivatePodActionFragment : ActionFragmentBase() {
|
class DeactivatePodActionFragment : ActionFragmentBase() {
|
||||||
override fun getText(): String = "[deactivate Pod]"
|
override fun getText(): String = "[deactivate Pod]"
|
||||||
|
|
||||||
|
override fun getNextPageActionId(): Int = R.id.action_deactivatePodActionFragment_to_podDeactivatedInfoFragment
|
||||||
}
|
}
|
|
@ -1,5 +1,9 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.action
|
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.action
|
||||||
|
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
||||||
|
|
||||||
class InsertCannulaActionFragment : ActionFragmentBase() {
|
class InsertCannulaActionFragment : ActionFragmentBase() {
|
||||||
override fun getText(): String = "[insert cannula]"
|
override fun getText(): String = "[insert cannula]"
|
||||||
|
|
||||||
|
override fun getNextPageActionId(): Int = R.id.action_insertCannulaActionFragment_to_podReplacedInfoFragment
|
||||||
}
|
}
|
|
@ -1,5 +1,9 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.action
|
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.action
|
||||||
|
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
||||||
|
|
||||||
class PairAndPrimePodActionFragment : ActionFragmentBase() {
|
class PairAndPrimePodActionFragment : ActionFragmentBase() {
|
||||||
override fun getText(): String = "[pair and prime Pod]"
|
override fun getText(): String = "[pair and prime Pod]"
|
||||||
|
|
||||||
|
override fun getNextPageActionId(): Int = R.id.action_pairAndPrimePodActionFragment_to_attachPodInfoFragment
|
||||||
}
|
}
|
|
@ -1,5 +1,9 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.info
|
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.info
|
||||||
|
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
||||||
|
|
||||||
class AttachPodInfoFragment : InfoFragmentBase() {
|
class AttachPodInfoFragment : InfoFragmentBase() {
|
||||||
override fun getText(): String = "Attach the Pod"
|
override fun getText(): String = "Attach the Pod"
|
||||||
|
|
||||||
|
override fun getNextPageActionId(): Int = R.id.action_attachPodInfoFragment_to_insertCannulaActionFragment
|
||||||
}
|
}
|
|
@ -1,5 +1,9 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.info
|
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.info
|
||||||
|
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
||||||
|
|
||||||
class DeactivatePodInfoFragment : InfoFragmentBase() {
|
class DeactivatePodInfoFragment : InfoFragmentBase() {
|
||||||
override fun getText(): String = "Deactivate the Pod"
|
override fun getText(): String = "Deactivate the Pod"
|
||||||
|
|
||||||
|
override fun getNextPageActionId(): Int = R.id.action_deactivatePodInfoFragment_to_deactivatePodActionFragment
|
||||||
}
|
}
|
|
@ -1,5 +1,9 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.info
|
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.info
|
||||||
|
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
||||||
|
|
||||||
class FillPodInfoFragment : InfoFragmentBase() {
|
class FillPodInfoFragment : InfoFragmentBase() {
|
||||||
override fun getText(): String = "Fill the Pod"
|
override fun getText(): String = "Fill the Pod"
|
||||||
|
|
||||||
|
override fun getNextPageActionId(): Int = R.id.action_fillPodInfoFragment_to_pairAndPrimePodActionFragment
|
||||||
}
|
}
|
|
@ -1,20 +1,12 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.info;
|
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.info;
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import dagger.android.support.DaggerFragment
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.FragmentBase
|
||||||
|
|
||||||
abstract class InfoFragmentBase : DaggerFragment() {
|
abstract class InfoFragmentBase : FragmentBase() {
|
||||||
|
|
||||||
override fun onCreateView(
|
|
||||||
inflater: LayoutInflater,
|
|
||||||
container: ViewGroup?,
|
|
||||||
savedInstanceState: Bundle?
|
|
||||||
): View? = inflater.inflate(R.layout.omnipod_replace_pod_wizard_info_page_fragment, container, false)
|
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
@ -23,4 +15,8 @@ abstract class InfoFragmentBase : DaggerFragment() {
|
||||||
|
|
||||||
abstract fun getText(): String
|
abstract fun getText(): String
|
||||||
|
|
||||||
|
override fun getLayout(): Int {
|
||||||
|
return R.layout.omnipod_replace_pod_wizard_info_page_fragment
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,5 +1,9 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.info
|
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.info
|
||||||
|
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
||||||
|
|
||||||
class PodDeactivatedInfoFragment : InfoFragmentBase() {
|
class PodDeactivatedInfoFragment : InfoFragmentBase() {
|
||||||
override fun getText(): String = "Pod has been deactivated"
|
override fun getText(): String = "Pod has been deactivated"
|
||||||
|
|
||||||
|
override fun getNextPageActionId(): Int = R.id.action_podDeactivatedInfoFragment_to_fillPodInfoFragment
|
||||||
}
|
}
|
|
@ -1,5 +1,9 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.info
|
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.fragment.info
|
||||||
|
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
||||||
|
|
||||||
class PodReplacedInfoFragment : InfoFragmentBase() {
|
class PodReplacedInfoFragment : InfoFragmentBase() {
|
||||||
override fun getText(): String = "the Pod has been replaced"
|
override fun getText(): String = "the Pod has been replaced"
|
||||||
|
|
||||||
|
override fun getNextPageActionId(): Int? = null
|
||||||
}
|
}
|
|
@ -2,11 +2,17 @@
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:padding="10dp">
|
||||||
|
|
||||||
|
<include layout="@layout/omnipod_replace_pod_wizard_progress_indication" />
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingTop="20dp"
|
||||||
|
android:paddingBottom="20dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/omnipod_wizard_action_page_text"
|
android:id="@+id/omnipod_wizard_action_page_text"
|
||||||
|
@ -14,4 +20,6 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
|
<include layout="@layout/omnipod_replace_pod_wizard_nav_buttons" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
@ -8,14 +8,8 @@
|
||||||
<androidx.fragment.app.FragmentContainerView
|
<androidx.fragment.app.FragmentContainerView
|
||||||
android:id="@+id/nav_host_fragment"
|
android:id="@+id/nav_host_fragment"
|
||||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="match_parent"
|
||||||
|
|
||||||
app:defaultNavHost="true"
|
app:defaultNavHost="true"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:navGraph="@navigation/omnipod_replace_pod_wizard_navigation_graph" />
|
app:navGraph="@navigation/omnipod_replace_pod_wizard_navigation_graph" />
|
||||||
|
</FrameLayout>
|
||||||
</LinearLayout>
|
|
|
@ -2,11 +2,24 @@
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:padding="10dp">
|
||||||
|
|
||||||
<TextView
|
<include layout="@layout/omnipod_replace_pod_wizard_progress_indication" />
|
||||||
android:id="@+id/omnipod_wizard_info_page_text"
|
|
||||||
android:layout_width="wrap_content"
|
<ScrollView
|
||||||
android:layout_height="wrap_content" />
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingTop="20dp"
|
||||||
|
android:paddingBottom="20dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/omnipod_wizard_info_page_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
<include layout="@layout/omnipod_replace_pod_wizard_nav_buttons" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/omnipod_replace_pod_wizard_button_cancel"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/omnipod_wizard_button_cancel" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/omnipod_replace_pod_wizard_button_next"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/omnipod_wizard_button_next" />
|
||||||
|
</LinearLayout>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/omnipod_replace_pod_wizard_progress_indication"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
|
@ -230,6 +230,9 @@
|
||||||
<string name="omnipod_less_than_a_minute_ago">Less than a minute ago</string>
|
<string name="omnipod_less_than_a_minute_ago">Less than a minute ago</string>
|
||||||
<string name="omnipod_composite_time">%1$s and %2$s</string>
|
<string name="omnipod_composite_time">%1$s and %2$s</string>
|
||||||
<string name="omnipod_time_ago">%1$s ago</string>
|
<string name="omnipod_time_ago">%1$s ago</string>
|
||||||
|
<string name="omnipod_wizard_button_cancel">Cancel</string>
|
||||||
|
<string name="omnipod_replace_pod_wizard_button_finish">Finish</string>
|
||||||
|
<string name="omnipod_replace_pod_wizard_button_next">Next</string>
|
||||||
<plurals name="omnipod_minutes">
|
<plurals name="omnipod_minutes">
|
||||||
<item quantity="one">%1$d minute</item>
|
<item quantity="one">%1$d minute</item>
|
||||||
<item quantity="other">%1$d minutes</item>
|
<item quantity="other">%1$d minutes</item>
|
||||||
|
|
Loading…
Reference in a new issue