Buttons in overview
This commit is contained in:
parent
485826682e
commit
43515f7b17
|
@ -13,13 +13,16 @@ apply from: "${project.rootDir}/core/main/test_dependencies.gradle"
|
||||||
apply from: "${project.rootDir}/core/main/jacoco_global.gradle"
|
apply from: "${project.rootDir}/core/main/jacoco_global.gradle"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
namespace 'info.nightscout.pump.medtrum'
|
namespace 'info.nightscout.pump.medtrum'
|
||||||
|
dataBinding {
|
||||||
|
enabled = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(':app-wear-shared:shared')
|
implementation project(':app-wear-shared:shared')
|
||||||
implementation project(':database:entities')
|
implementation project(':database:entities')
|
||||||
|
implementation project(':core:libraries')
|
||||||
implementation project(':core:interfaces')
|
implementation project(':core:interfaces')
|
||||||
implementation project(':core:main')
|
implementation project(':core:main')
|
||||||
implementation project(':core:ui')
|
implementation project(':core:ui')
|
||||||
|
|
|
@ -26,7 +26,7 @@ import info.nightscout.interfaces.queue.CommandQueue
|
||||||
import info.nightscout.interfaces.queue.CustomCommand
|
import info.nightscout.interfaces.queue.CustomCommand
|
||||||
import info.nightscout.interfaces.ui.UiInteraction
|
import info.nightscout.interfaces.ui.UiInteraction
|
||||||
import info.nightscout.interfaces.utils.TimeChangeType
|
import info.nightscout.interfaces.utils.TimeChangeType
|
||||||
import info.nightscout.pump.medtrum.ui.MedtrumPumpFragment
|
import info.nightscout.pump.medtrum.ui.MedtrumOverviewFragment
|
||||||
import info.nightscout.pump.medtrum.services.MedtrumService
|
import info.nightscout.pump.medtrum.services.MedtrumService
|
||||||
import info.nightscout.rx.AapsSchedulers
|
import info.nightscout.rx.AapsSchedulers
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
|
@ -67,7 +67,7 @@ class MedtrumPlugin @Inject constructor(
|
||||||
) : PumpPluginBase(
|
) : PumpPluginBase(
|
||||||
PluginDescription()
|
PluginDescription()
|
||||||
.mainType(PluginType.PUMP)
|
.mainType(PluginType.PUMP)
|
||||||
.fragmentClass(MedtrumPumpFragment::class.java.name)
|
.fragmentClass(MedtrumOverviewFragment::class.java.name)
|
||||||
.pluginIcon(info.nightscout.core.ui.R.drawable.ic_eopatch2_128) // TODO
|
.pluginIcon(info.nightscout.core.ui.R.drawable.ic_eopatch2_128) // TODO
|
||||||
.pluginName(R.string.medtrum)
|
.pluginName(R.string.medtrum)
|
||||||
.shortName(R.string.medtrum_pump_shortname)
|
.shortName(R.string.medtrum_pump_shortname)
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
package info.nightscout.pump.medtrum.di
|
|
||||||
|
|
||||||
import dagger.Module
|
|
||||||
import dagger.android.ContributesAndroidInjector
|
|
||||||
import info.nightscout.pump.medtrum.ui.MedtrumPumpFragment
|
|
||||||
|
|
||||||
@Module
|
|
||||||
@Suppress("unused")
|
|
||||||
abstract class MedtrumActivitiesModule {
|
|
||||||
|
|
||||||
@ContributesAndroidInjector abstract fun contributesMedtrumPumpFragment(): MedtrumPumpFragment
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
package info.nightscout.pump.medtrum.di
|
||||||
|
|
||||||
|
import javax.inject.Qualifier
|
||||||
|
import javax.inject.Scope
|
||||||
|
|
||||||
|
@Qualifier
|
||||||
|
annotation class MedtrumPluginQualifier
|
||||||
|
|
||||||
|
@MustBeDocumented
|
||||||
|
@Scope
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
annotation class FragmentScope
|
|
@ -1,9 +1,46 @@
|
||||||
package info.nightscout.pump.medtrum.di
|
package info.nightscout.pump.medtrum.di
|
||||||
|
|
||||||
|
import androidx.lifecycle.ViewModel
|
||||||
|
import androidx.lifecycle.ViewModelProvider
|
||||||
|
import dagger.Binds
|
||||||
import dagger.Module
|
import dagger.Module
|
||||||
|
import dagger.Provides
|
||||||
|
import dagger.android.ContributesAndroidInjector
|
||||||
|
import dagger.multibindings.IntoMap
|
||||||
|
// import info.nightscout.androidaps.plugins.pump.eopatch.ui.viewmodel.OverviewViewModel
|
||||||
|
import info.nightscout.pump.medtrum.services.MedtrumService
|
||||||
|
import info.nightscout.pump.medtrum.ui.MedtrumOverviewFragment
|
||||||
|
import info.nightscout.pump.medtrum.ui.viewmodel.OverviewViewModel
|
||||||
|
// import info.nightscout.pump.medtrum.ui.viewmodel.ViewModel
|
||||||
|
import info.nightscout.pump.medtrum.ui.viewmodel.ViewModelFactory
|
||||||
|
import info.nightscout.pump.medtrum.ui.viewmodel.ViewModelKey
|
||||||
|
import javax.inject.Provider
|
||||||
|
|
||||||
@Module(includes = [
|
|
||||||
MedtrumActivitiesModule::class,
|
@Module
|
||||||
MedtrumServicesModule::class
|
@Suppress("unused")
|
||||||
])
|
abstract class MedtrumModule {
|
||||||
open class MedtrumModule
|
companion object {
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@MedtrumPluginQualifier
|
||||||
|
fun providesViewModelFactory(@MedtrumPluginQualifier viewModels: MutableMap<Class<out ViewModel>, @JvmSuppressWildcards Provider<ViewModel>>): ViewModelProvider.Factory {
|
||||||
|
return ViewModelFactory(viewModels)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// VIEW MODELS
|
||||||
|
@Binds
|
||||||
|
@IntoMap
|
||||||
|
@MedtrumPluginQualifier
|
||||||
|
@ViewModelKey(OverviewViewModel::class)
|
||||||
|
internal abstract fun bindsOverviewViewmodel(viewModel: OverviewViewModel): ViewModel
|
||||||
|
|
||||||
|
// FRAGMENTS
|
||||||
|
@ContributesAndroidInjector
|
||||||
|
abstract fun contributesMedtrumOverviewFragment(): MedtrumOverviewFragment
|
||||||
|
|
||||||
|
// SERVICE
|
||||||
|
@ContributesAndroidInjector
|
||||||
|
abstract fun contributesDanaRSService(): MedtrumService
|
||||||
|
}
|
|
@ -1,11 +0,0 @@
|
||||||
package info.nightscout.pump.medtrum.di
|
|
||||||
|
|
||||||
import dagger.Module
|
|
||||||
import dagger.android.ContributesAndroidInjector
|
|
||||||
import info.nightscout.pump.medtrum.services.MedtrumService
|
|
||||||
|
|
||||||
@Module
|
|
||||||
@Suppress("unused")
|
|
||||||
abstract class MedtrumServicesModule {
|
|
||||||
@ContributesAndroidInjector abstract fun contributesDanaRSService(): MedtrumService
|
|
||||||
}
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package info.nightscout.pump.medtrum.ui
|
||||||
|
|
||||||
|
interface BaseNavigator {
|
||||||
|
fun back()
|
||||||
|
|
||||||
|
fun finish(finishAffinity: Boolean = false)
|
||||||
|
}
|
|
@ -11,7 +11,7 @@ import info.nightscout.core.extensions.toStringFull
|
||||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||||
import info.nightscout.interfaces.iob.IobCobCalculator
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.pump.medtrum.databinding.MedtrumPumpFragmentBinding
|
import info.nightscout.pump.medtrum.databinding.MedtrumOverviewFragmentBinding
|
||||||
import info.nightscout.pump.medtrum.events.EventMedtrumPumpUpdateGui
|
import info.nightscout.pump.medtrum.events.EventMedtrumPumpUpdateGui
|
||||||
import info.nightscout.pump.medtrum.MedtrumPlugin
|
import info.nightscout.pump.medtrum.MedtrumPlugin
|
||||||
import info.nightscout.rx.AapsSchedulers
|
import info.nightscout.rx.AapsSchedulers
|
||||||
|
@ -25,7 +25,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class MedtrumPumpFragment : DaggerFragment() {
|
class MedtrumOverviewFragment : DaggerFragment() {
|
||||||
|
|
||||||
@Inject lateinit var rxBus: RxBus
|
@Inject lateinit var rxBus: RxBus
|
||||||
@Inject lateinit var rh: ResourceHelper
|
@Inject lateinit var rh: ResourceHelper
|
||||||
|
@ -41,14 +41,14 @@ class MedtrumPumpFragment : DaggerFragment() {
|
||||||
private lateinit var refreshLoop: Runnable
|
private lateinit var refreshLoop: Runnable
|
||||||
private var handler = Handler(HandlerThread(this::class.simpleName + "Handler").also { it.start() }.looper)
|
private var handler = Handler(HandlerThread(this::class.simpleName + "Handler").also { it.start() }.looper)
|
||||||
|
|
||||||
private var _binding: MedtrumPumpFragmentBinding? = null
|
private var _binding: MedtrumOverviewFragmentBinding? = null
|
||||||
|
|
||||||
// This property is only valid between onCreateView and
|
// This property is only valid between onCreateView and
|
||||||
// onDestroyView.
|
// onDestroyView.
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View =
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View =
|
||||||
MedtrumPumpFragmentBinding.inflate(inflater, container, false).also { _binding = it }.root
|
MedtrumOverviewFragmentBinding.inflate(inflater, container, false).also { _binding = it }.root
|
||||||
|
|
||||||
@Synchronized
|
@Synchronized
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
@ -93,8 +93,6 @@ class MedtrumPumpFragment : DaggerFragment() {
|
||||||
binding.baseBasalRate.text = rh.gs(info.nightscout.core.ui.R.string.pump_base_basal_rate, MedtrumPlugin.baseBasalRate)
|
binding.baseBasalRate.text = rh.gs(info.nightscout.core.ui.R.string.pump_base_basal_rate, MedtrumPlugin.baseBasalRate)
|
||||||
binding.tempbasal.text = iobCobCalculator.getTempBasal(dateUtil.now())?.toStringFull(profile, dateUtil)
|
binding.tempbasal.text = iobCobCalculator.getTempBasal(dateUtil.now())?.toStringFull(profile, dateUtil)
|
||||||
?: ""
|
?: ""
|
||||||
binding.extendedbolus.text = iobCobCalculator.getExtendedBolus(dateUtil.now())?.toStringFull(dateUtil)
|
|
||||||
?: ""
|
|
||||||
binding.battery.text = rh.gs(info.nightscout.core.ui.R.string.format_percent, 0) // TODO
|
binding.battery.text = rh.gs(info.nightscout.core.ui.R.string.format_percent, 0) // TODO
|
||||||
binding.reservoir.text = rh.gs(info.nightscout.interfaces.R.string.format_insulin_units, 0.0) // TODO
|
binding.reservoir.text = rh.gs(info.nightscout.interfaces.R.string.format_insulin_units, 0.0) // TODO
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
package info.nightscout.pump.medtrum.ui.viewmodel
|
||||||
|
|
||||||
|
import androidx.lifecycle.ViewModel
|
||||||
|
import info.nightscout.pump.medtrum.ui.BaseNavigator
|
||||||
|
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||||
|
import io.reactivex.rxjava3.disposables.Disposable
|
||||||
|
import java.lang.ref.WeakReference
|
||||||
|
|
||||||
|
abstract class BaseViewModel<N : BaseNavigator> : ViewModel() {
|
||||||
|
|
||||||
|
private var _navigator: WeakReference<N?>? = null
|
||||||
|
var navigator: N?
|
||||||
|
set(value) {
|
||||||
|
_navigator = WeakReference(value)
|
||||||
|
}
|
||||||
|
get() = _navigator?.get()
|
||||||
|
|
||||||
|
private val compositeDisposable = CompositeDisposable()
|
||||||
|
|
||||||
|
override fun onCleared() {
|
||||||
|
compositeDisposable.clear()
|
||||||
|
super.onCleared()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun back() = navigator?.back()
|
||||||
|
|
||||||
|
fun finish() = navigator?.finish()
|
||||||
|
|
||||||
|
fun Disposable.addTo() = apply { compositeDisposable.add(this) }
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package info.nightscout.pump.medtrum.ui.viewmodel
|
||||||
|
|
||||||
|
import info.nightscout.pump.medtrum.ui.BaseNavigator
|
||||||
|
import info.nightscout.pump.medtrum.ui.viewmodel.BaseViewModel
|
||||||
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
|
import info.nightscout.rx.logging.LTag
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
class OverviewViewModel @Inject constructor(
|
||||||
|
private val aapsLogger: AAPSLogger
|
||||||
|
) : BaseViewModel<BaseNavigator>() {
|
||||||
|
|
||||||
|
val isPatchActivated : Boolean
|
||||||
|
get() = false // TODO
|
||||||
|
val isPatchConnected: Boolean
|
||||||
|
get() = false // TODO
|
||||||
|
|
||||||
|
init {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onClickActivation(){
|
||||||
|
aapsLogger.debug(LTag.PUMP, "Start Patch clicked!")
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onClickDeactivation(){
|
||||||
|
aapsLogger.debug(LTag.PUMP, "Stop Patch clicked!")
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package info.nightscout.pump.medtrum.ui.viewmodel
|
||||||
|
|
||||||
|
import androidx.lifecycle.ViewModel
|
||||||
|
import androidx.lifecycle.ViewModelProvider
|
||||||
|
import dagger.MapKey
|
||||||
|
import javax.inject.Inject
|
||||||
|
import javax.inject.Provider
|
||||||
|
import javax.inject.Singleton
|
||||||
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
|
@MustBeDocumented
|
||||||
|
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
@MapKey
|
||||||
|
internal annotation class ViewModelKey(val value: KClass<out ViewModel>)
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
class ViewModelFactory @Inject constructor(private val creators: Map<Class<out ViewModel>, @JvmSuppressWildcards Provider<ViewModel>>) : ViewModelProvider.Factory {
|
||||||
|
override fun <T : ViewModel> create(modelClass: Class<T>): T {
|
||||||
|
var creator: Provider<out ViewModel>? = creators[modelClass]
|
||||||
|
if (creator == null) {
|
||||||
|
for ((key, value) in creators) {
|
||||||
|
if (modelClass.isAssignableFrom(key)) {
|
||||||
|
creator = value
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (creator == null) {
|
||||||
|
throw IllegalArgumentException("unknown model class $modelClass")
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
return creator.get() as T
|
||||||
|
} catch (e: Exception) {
|
||||||
|
throw IllegalStateException(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
304
pump/medtrum/src/main/res/layout/medtrum_overview_fragment.xml
Normal file
304
pump/medtrum/src/main/res/layout/medtrum_overview_fragment.xml
Normal file
|
@ -0,0 +1,304 @@
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<variable
|
||||||
|
name="viewmodel"
|
||||||
|
type="info.nightscout.pump.medtrum.ui.viewmodel.OverviewViewModel"/>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_above="@+id/medtrum_overview_buttons"
|
||||||
|
android:fillViewport="true"
|
||||||
|
tools:context=".MedtrumOverviewFragment">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:text="@string/medtrum_pump_label"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:focusable="true"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingStart="0dp"
|
||||||
|
android:paddingEnd="5dp"
|
||||||
|
android:text="@string/base_basal_rate_label"
|
||||||
|
android:textAlignment="viewEnd"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="5dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:paddingStart="2dp"
|
||||||
|
android:paddingEnd="2dp"
|
||||||
|
android:text=":"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/base_basal_rate"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingStart="5dp"
|
||||||
|
android:paddingEnd="0dp"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="0.38 U/h" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="2dip"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:background="?android:attr/dividerHorizontal" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:focusable="true"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingStart="0dp"
|
||||||
|
android:paddingEnd="5dp"
|
||||||
|
android:text="@string/tempbasal_label"
|
||||||
|
android:textAlignment="viewEnd"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="5dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:paddingStart="2dp"
|
||||||
|
android:paddingEnd="2dp"
|
||||||
|
android:text=":"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tempbasal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingStart="5dp"
|
||||||
|
android:paddingEnd="0dp"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="2dip"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:background="?android:attr/dividerHorizontal" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:focusable="true"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingStart="0dp"
|
||||||
|
android:paddingEnd="5dp"
|
||||||
|
android:text="@string/battery_label"
|
||||||
|
android:textAlignment="viewEnd"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="5dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:paddingStart="2dp"
|
||||||
|
android:paddingEnd="2dp"
|
||||||
|
android:text=":"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/battery"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingStart="5dp"
|
||||||
|
android:paddingEnd="0dp"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="50%" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Reservoir -->
|
||||||
|
<View
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="2dip"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:background="?android:attr/dividerHorizontal" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:focusable="true"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingStart="0dp"
|
||||||
|
android:paddingEnd="5dp"
|
||||||
|
android:text="@string/reservoir_label"
|
||||||
|
android:textAlignment="viewEnd"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="5dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:paddingStart="2dp"
|
||||||
|
android:paddingEnd="2dp"
|
||||||
|
android:text=":"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/reservoir"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingStart="5dp"
|
||||||
|
android:paddingEnd="0dp"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Pump Serial -->
|
||||||
|
<View
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="2dip"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:background="?android:attr/dividerHorizontal" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:focusable="true"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingStart="0dp"
|
||||||
|
android:paddingEnd="5dp"
|
||||||
|
android:text="@string/serial_number"
|
||||||
|
android:textAlignment="viewEnd"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="5dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:paddingStart="2dp"
|
||||||
|
android:paddingEnd="2dp"
|
||||||
|
android:text=":"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/serial_number"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingStart="5dp"
|
||||||
|
android:paddingEnd="0dp"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/medtrum_overview_buttons"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button1"
|
||||||
|
style="@style/ButtonMediumFontStyle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/string_new_patch"
|
||||||
|
android:enabled="@{!viewmodel.isPatchActivated}"/>
|
||||||
|
<!-- TODO NEEDS BINDING app:onSafeClick="@{() -> viewmodel.onClickActivation()}"/>-->
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button2"
|
||||||
|
style="@style/ButtonMediumFontStyle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/string_stop_patch"
|
||||||
|
android:enabled="@{viewmodel.isPatchActivated}"/>
|
||||||
|
<!-- TODO NEEDS BINDING app:onSafeClick="@{() -> viewmodel.onClickDeactivation()}"/>-->
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
</layout>
|
|
@ -1,306 +0,0 @@
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
tools:context=".MedtrumPumpFragment">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:text="@string/medtrum_pump_label"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:focusable="true"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingStart="0dp"
|
|
||||||
android:paddingEnd="5dp"
|
|
||||||
android:text="@string/base_basal_rate_label"
|
|
||||||
android:textAlignment="viewEnd"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="5dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:paddingStart="2dp"
|
|
||||||
android:paddingEnd="2dp"
|
|
||||||
android:text=":"
|
|
||||||
android:textSize="14sp"
|
|
||||||
tools:ignore="HardcodedText" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/base_basal_rate"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingStart="5dp"
|
|
||||||
android:paddingEnd="0dp"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textSize="14sp"
|
|
||||||
tools:text="0.38 U/h" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="2dip"
|
|
||||||
android:layout_marginStart="20dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="20dp"
|
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:background="?android:attr/dividerHorizontal" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:focusable="true"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingStart="0dp"
|
|
||||||
android:paddingEnd="5dp"
|
|
||||||
android:text="@string/tempbasal_label"
|
|
||||||
android:textAlignment="viewEnd"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="5dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:paddingStart="2dp"
|
|
||||||
android:paddingEnd="2dp"
|
|
||||||
android:text=":"
|
|
||||||
android:textSize="14sp"
|
|
||||||
tools:ignore="HardcodedText" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tempbasal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingStart="5dp"
|
|
||||||
android:paddingEnd="0dp"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="2dip"
|
|
||||||
android:layout_marginStart="20dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="20dp"
|
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:background="?android:attr/dividerHorizontal" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:focusable="true"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingStart="0dp"
|
|
||||||
android:paddingEnd="5dp"
|
|
||||||
android:text="@string/extended_bolus_label"
|
|
||||||
android:textAlignment="viewEnd"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="5dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:paddingStart="2dp"
|
|
||||||
android:paddingEnd="2dp"
|
|
||||||
android:text=":"
|
|
||||||
android:textSize="14sp"
|
|
||||||
tools:ignore="HardcodedText" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/extendedbolus"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingStart="5dp"
|
|
||||||
android:paddingEnd="0dp"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="2dip"
|
|
||||||
android:layout_marginStart="20dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="20dp"
|
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:background="?android:attr/dividerHorizontal" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:focusable="true"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingStart="0dp"
|
|
||||||
android:paddingEnd="5dp"
|
|
||||||
android:text="@string/battery_label"
|
|
||||||
android:textAlignment="viewEnd"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="5dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:paddingStart="2dp"
|
|
||||||
android:paddingEnd="2dp"
|
|
||||||
android:text=":"
|
|
||||||
android:textSize="14sp"
|
|
||||||
tools:ignore="HardcodedText" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/battery"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingStart="5dp"
|
|
||||||
android:paddingEnd="0dp"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textSize="14sp"
|
|
||||||
tools:text="50%" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Reservoir -->
|
|
||||||
<View
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="2dip"
|
|
||||||
android:layout_marginStart="20dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="20dp"
|
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:background="?android:attr/dividerHorizontal" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:focusable="true"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingStart="0dp"
|
|
||||||
android:paddingEnd="5dp"
|
|
||||||
android:text="@string/reservoir_label"
|
|
||||||
android:textAlignment="viewEnd"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="5dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:paddingStart="2dp"
|
|
||||||
android:paddingEnd="2dp"
|
|
||||||
android:text=":"
|
|
||||||
android:textSize="14sp"
|
|
||||||
tools:ignore="HardcodedText" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/reservoir"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingStart="5dp"
|
|
||||||
android:paddingEnd="0dp"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Pump Serial -->
|
|
||||||
<View
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="2dip"
|
|
||||||
android:layout_marginStart="20dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="20dp"
|
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:background="?android:attr/dividerHorizontal" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:focusable="true"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingStart="0dp"
|
|
||||||
android:paddingEnd="5dp"
|
|
||||||
android:text="@string/serial_number"
|
|
||||||
android:textAlignment="viewEnd"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="5dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:paddingStart="2dp"
|
|
||||||
android:paddingEnd="2dp"
|
|
||||||
android:text=":"
|
|
||||||
android:textSize="14sp"
|
|
||||||
tools:ignore="HardcodedText" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/serial_number"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingStart="5dp"
|
|
||||||
android:paddingEnd="0dp"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</ScrollView>
|
|
|
@ -13,5 +13,7 @@
|
||||||
|
|
||||||
<string name="snInput_title">SN</string>
|
<string name="snInput_title">SN</string>
|
||||||
<string name="snInput_summary">Serial number pump base</string>
|
<string name="snInput_summary">Serial number pump base</string>
|
||||||
|
<string name="string_new_patch">Start new patch</string>
|
||||||
|
<string name="string_stop_patch">Stop patch</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue