jetpack bindings in core
This commit is contained in:
parent
e26ae1af7d
commit
9eaeafea3f
8 changed files with 183 additions and 138 deletions
|
@ -1,7 +1,7 @@
|
|||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
|
|
|
@ -10,6 +10,7 @@ import android.view.WindowManager
|
|||
import dagger.android.support.DaggerDialogFragment
|
||||
import info.nightscout.androidaps.activities.BolusProgressHelperActivity
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.androidaps.core.databinding.DialogBolusprogressBinding
|
||||
import info.nightscout.androidaps.events.EventPumpStatusChanged
|
||||
import info.nightscout.androidaps.interfaces.CommandQueueProvider
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
|
@ -21,10 +22,10 @@ import info.nightscout.androidaps.utils.FabricPrivacy
|
|||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import kotlinx.android.synthetic.main.dialog_bolusprogress.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class BolusProgressDialog : DaggerDialogFragment() {
|
||||
|
||||
@Inject lateinit var aapsLogger: AAPSLogger
|
||||
@Inject lateinit var rxBus: RxBusWrapper
|
||||
@Inject lateinit var resourceHelper: ResourceHelper
|
||||
|
@ -34,6 +35,7 @@ class BolusProgressDialog : DaggerDialogFragment() {
|
|||
private val disposable = CompositeDisposable()
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmField
|
||||
var bolusEnded = false
|
||||
|
||||
|
@ -57,31 +59,39 @@ class BolusProgressDialog : DaggerDialogFragment() {
|
|||
return this
|
||||
}
|
||||
|
||||
private var _binding: DialogBolusprogressBinding? = null
|
||||
|
||||
// This property is only valid between onCreateView and
|
||||
// onDestroyView.
|
||||
private val binding get() = _binding!!
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?): View? {
|
||||
savedInstanceState: Bundle?): View {
|
||||
dialog?.window?.requestFeature(Window.FEATURE_NO_TITLE)
|
||||
dialog?.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN)
|
||||
isCancelable = false
|
||||
dialog?.setCanceledOnTouchOutside(false)
|
||||
return inflater.inflate(R.layout.dialog_bolusprogress, container, false)
|
||||
|
||||
_binding = DialogBolusprogressBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
savedInstanceState?.let {
|
||||
amount = it.getDouble("amount")
|
||||
}
|
||||
overview_bolusprogress_title.text = resourceHelper.gs(R.string.goingtodeliver, amount)
|
||||
overview_bolusprogress_stop.setOnClickListener {
|
||||
binding.title.text = resourceHelper.gs(R.string.goingtodeliver, amount)
|
||||
binding.stop.setOnClickListener {
|
||||
aapsLogger.debug(LTag.UI, "Stop bolus delivery button pressed")
|
||||
stopPressed = true
|
||||
overview_bolusprogress_stoppressed.visibility = View.VISIBLE
|
||||
overview_bolusprogress_stop.visibility = View.INVISIBLE
|
||||
binding.stoppressed.visibility = View.VISIBLE
|
||||
binding.stop.visibility = View.INVISIBLE
|
||||
commandQueue.cancelAllBoluses()
|
||||
}
|
||||
val defaultState = resourceHelper.gs(R.string.waitingforpump)
|
||||
overview_bolusprogress_progressbar.max = 100
|
||||
binding.progressbar.max = 100
|
||||
state = savedInstanceState?.getString("state", defaultState) ?: defaultState
|
||||
overview_bolusprogress_status.text = state
|
||||
binding.status.text = state
|
||||
stopPressed = false
|
||||
}
|
||||
|
||||
|
@ -102,7 +112,7 @@ class BolusProgressDialog : DaggerDialogFragment() {
|
|||
disposable.add(rxBus
|
||||
.toObservable(EventPumpStatusChanged::class.java)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({ overview_bolusprogress_status.text = it.getStatus(resourceHelper) }) { fabricPrivacy.logException(it) }
|
||||
.subscribe({ binding.status.text = it.getStatus(resourceHelper) }) { fabricPrivacy.logException(it) }
|
||||
)
|
||||
disposable.add(rxBus
|
||||
.toObservable(EventDismissBolusProgressIfRunning::class.java)
|
||||
|
@ -114,10 +124,10 @@ class BolusProgressDialog : DaggerDialogFragment() {
|
|||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({
|
||||
aapsLogger.debug(LTag.UI, "Status: ${it.status} Percent: ${it.percent}")
|
||||
overview_bolusprogress_status.text = it.status
|
||||
overview_bolusprogress_progressbar.progress = it.percent
|
||||
binding.status.text = it.status
|
||||
binding.progressbar.progress = it.percent
|
||||
if (it.percent == 100) {
|
||||
overview_bolusprogress_stop.visibility = View.INVISIBLE
|
||||
binding.stop.visibility = View.INVISIBLE
|
||||
scheduleDismiss()
|
||||
}
|
||||
state = it.status
|
||||
|
@ -151,9 +161,15 @@ class BolusProgressDialog : DaggerDialogFragment() {
|
|||
outState.putDouble("amount", amount)
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
disposable.clear()
|
||||
_binding = null
|
||||
}
|
||||
|
||||
private fun scheduleDismiss() {
|
||||
aapsLogger.debug(LTag.UI, "scheduleDismiss")
|
||||
Thread(Runnable {
|
||||
Thread {
|
||||
SystemClock.sleep(5000)
|
||||
bolusEnded = true
|
||||
activity?.runOnUiThread {
|
||||
|
@ -166,6 +182,6 @@ class BolusProgressDialog : DaggerDialogFragment() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}).start()
|
||||
}.start()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import dagger.android.support.DaggerDialogFragment
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.androidaps.core.databinding.DialogBolusprogressBinding
|
||||
import info.nightscout.androidaps.events.EventNtpStatus
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
|
@ -16,10 +17,10 @@ import info.nightscout.androidaps.utils.extensions.plusAssign
|
|||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import kotlinx.android.synthetic.main.dialog_bolusprogress.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class NtpProgressDialog : DaggerDialogFragment() {
|
||||
|
||||
@Inject lateinit var rxBus: RxBusWrapper
|
||||
@Inject lateinit var aapsLogger: AAPSLogger
|
||||
@Inject lateinit var resourceHelper: ResourceHelper
|
||||
|
@ -30,26 +31,33 @@ class NtpProgressDialog : DaggerDialogFragment() {
|
|||
private var state: String? = null
|
||||
private var percent = 0
|
||||
|
||||
private var _binding: DialogBolusprogressBinding? = null
|
||||
|
||||
// This property is only valid between onCreateView and
|
||||
// onDestroyView.
|
||||
private val binding get() = _binding!!
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?): View? {
|
||||
savedInstanceState: Bundle?): View {
|
||||
isCancelable = false
|
||||
|
||||
state = savedInstanceState?.getString("state", null)
|
||||
percent = savedInstanceState?.getInt("percent", 0) ?: 0
|
||||
|
||||
return inflater.inflate(R.layout.dialog_bolusprogress, container, false)
|
||||
_binding = DialogBolusprogressBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
val defaultMessage = resourceHelper.gs(R.string.timedetection)
|
||||
dialog?.setTitle(resourceHelper.gs(R.string.objectives))
|
||||
overview_bolusprogress_stop.setOnClickListener { dismiss() }
|
||||
overview_bolusprogress_status.text = state ?: defaultMessage
|
||||
overview_bolusprogress_progressbar.max = 100
|
||||
overview_bolusprogress_progressbar.progress = percent
|
||||
overview_bolusprogress_stop.text = resourceHelper.gs(R.string.close)
|
||||
overview_bolusprogress_title.text = resourceHelper.gs(R.string.please_wait)
|
||||
binding.stop.setOnClickListener { dismiss() }
|
||||
binding.status.text = state ?: defaultMessage
|
||||
binding.progressbar.max = 100
|
||||
binding.progressbar.progress = percent
|
||||
binding.stop.text = resourceHelper.gs(R.string.close)
|
||||
binding.title.text = resourceHelper.gs(R.string.please_wait)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
@ -65,16 +73,18 @@ class NtpProgressDialog : DaggerDialogFragment() {
|
|||
.toObservable(EventNtpStatus::class.java)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({ event: EventNtpStatus ->
|
||||
aapsLogger.debug(LTag.UI, "Status: " + event.status + " Percent: " + event.percent)
|
||||
overview_bolusprogress_status?.text = event.status
|
||||
overview_bolusprogress_progressbar?.progress = event.percent
|
||||
if (event.percent == 100) {
|
||||
SystemClock.sleep(100)
|
||||
dismiss()
|
||||
if (_binding != null) {
|
||||
aapsLogger.debug(LTag.UI, "Status: " + event.status + " Percent: " + event.percent)
|
||||
binding.status.text = event.status
|
||||
binding.progressbar.progress = event.percent
|
||||
if (event.percent == 100) {
|
||||
SystemClock.sleep(100)
|
||||
dismiss()
|
||||
}
|
||||
state = event.status
|
||||
percent = event.percent
|
||||
}
|
||||
state = event.status
|
||||
percent = event.percent
|
||||
}) { fabricPrivacy.logException(it) }
|
||||
}, fabricPrivacy::logException)
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
|
@ -83,6 +93,12 @@ class NtpProgressDialog : DaggerDialogFragment() {
|
|||
disposable.clear()
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
disposable.clear()
|
||||
_binding = null
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
outState.putString("state", state)
|
||||
outState.putInt("percent", percent)
|
||||
|
|
|
@ -11,21 +11,20 @@ import dagger.android.HasAndroidInjector
|
|||
import dagger.android.support.DaggerDialogFragment
|
||||
import info.nightscout.androidaps.Constants
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.androidaps.core.databinding.DialogProfileviewerBinding
|
||||
import info.nightscout.androidaps.data.Profile
|
||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||
import info.nightscout.androidaps.interfaces.DatabaseHelperInterface
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.DecimalFormatter
|
||||
import info.nightscout.androidaps.utils.HtmlHelper
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import kotlinx.android.synthetic.main.close.*
|
||||
import kotlinx.android.synthetic.main.dialog_profileviewer.*
|
||||
import org.json.JSONObject
|
||||
import java.text.DecimalFormat
|
||||
import javax.inject.Inject
|
||||
|
||||
class ProfileViewerDialog : DaggerDialogFragment() {
|
||||
|
||||
@Inject lateinit var injector: HasAndroidInjector
|
||||
@Inject lateinit var resourceHelper: ResourceHelper
|
||||
@Inject lateinit var activePlugin: ActivePluginProvider
|
||||
|
@ -48,8 +47,14 @@ class ProfileViewerDialog : DaggerDialogFragment() {
|
|||
private var customProfileName: String = ""
|
||||
private var customProfileUnits: String = Constants.MGDL
|
||||
|
||||
private var _binding: DialogProfileviewerBinding? = null
|
||||
|
||||
// This property is only valid between onCreateView and
|
||||
// onDestroyView.
|
||||
private val binding get() = _binding!!
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?): View? {
|
||||
savedInstanceState: Bundle?): View {
|
||||
// load data from bundle
|
||||
(savedInstanceState ?: arguments)?.let { bundle ->
|
||||
time = bundle.getLong("time", 0)
|
||||
|
@ -66,13 +71,14 @@ class ProfileViewerDialog : DaggerDialogFragment() {
|
|||
isCancelable = true
|
||||
dialog?.setCanceledOnTouchOutside(false)
|
||||
|
||||
return inflater.inflate(R.layout.dialog_profileviewer, container, false)
|
||||
_binding = DialogProfileviewerBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
close.setOnClickListener { dismiss() }
|
||||
binding.closeLayout.close.setOnClickListener { dismiss() }
|
||||
|
||||
val profile: Profile?
|
||||
val profile2: Profile?
|
||||
|
@ -85,7 +91,7 @@ class ProfileViewerDialog : DaggerDialogFragment() {
|
|||
profileName = activePlugin.activeTreatments.getProfileSwitchFromHistory(time)?.customizedName
|
||||
date = dateUtil.dateAndTimeString(activePlugin.activeTreatments.getProfileSwitchFromHistory(time)?.date
|
||||
?: 0)
|
||||
profileview_datelayout.visibility = View.VISIBLE
|
||||
binding.datelayout.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
Mode.CUSTOM_PROFILE -> {
|
||||
|
@ -93,16 +99,16 @@ class ProfileViewerDialog : DaggerDialogFragment() {
|
|||
profile2 = null
|
||||
profileName = customProfileName
|
||||
date = ""
|
||||
profileview_datelayout.visibility = View.GONE
|
||||
binding.datelayout.visibility = View.GONE
|
||||
}
|
||||
|
||||
Mode.PROFILE_COMPARE -> {
|
||||
profile = Profile(injector, JSONObject(customProfileJson), customProfileUnits)
|
||||
profile2 = Profile(injector, JSONObject(customProfileJson2), customProfileUnits)
|
||||
profileName = customProfileName
|
||||
header_icon.setImageResource(R.drawable.ic_compare_profiles)
|
||||
binding.headerIcon.setImageResource(R.drawable.ic_compare_profiles)
|
||||
date = ""
|
||||
profileview_datelayout.visibility = View.GONE
|
||||
binding.datelayout.visibility = View.GONE
|
||||
}
|
||||
|
||||
Mode.DB_PROFILE -> {
|
||||
|
@ -111,43 +117,43 @@ class ProfileViewerDialog : DaggerDialogFragment() {
|
|||
profile2 = null
|
||||
profileName = if (profileList.isNotEmpty()) profileList[0].customizedName else null
|
||||
date = if (profileList.isNotEmpty()) dateUtil.dateAndTimeString(profileList[0].date) else null
|
||||
profileview_datelayout.visibility = View.VISIBLE
|
||||
binding.datelayout.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
profileview_noprofile.visibility = View.VISIBLE
|
||||
binding.noprofile.visibility = View.VISIBLE
|
||||
|
||||
if (mode == Mode.PROFILE_COMPARE)
|
||||
profile?.let { profile1 ->
|
||||
profile2?.let { profile2 ->
|
||||
profileview_units.text = profileFunction.getUnits()
|
||||
profileview_dia.text = HtmlHelper.fromHtml(formatColors("", profile1.dia, profile2.dia, DecimalFormat("0.00"), resourceHelper.gs(R.string.shorthour)))
|
||||
val profileNames =profileName!!.split("\n").toTypedArray()
|
||||
profileview_activeprofile.text = HtmlHelper.fromHtml(formatColors(profileNames[0], profileNames[1]))
|
||||
profileview_date.text = date
|
||||
profileview_ic.text = ics(profile1, profile2)
|
||||
profileview_isf.text = isfs(profile1, profile2)
|
||||
profileview_basal.text = basals(profile1, profile2)
|
||||
profileview_target.text = targets(profile1, profile2)
|
||||
basal_graph.show(profile1, profile2)
|
||||
binding.units.text = profileFunction.getUnits()
|
||||
binding.dia.text = HtmlHelper.fromHtml(formatColors("", profile1.dia, profile2.dia, DecimalFormat("0.00"), resourceHelper.gs(R.string.shorthour)))
|
||||
val profileNames = profileName!!.split("\n").toTypedArray()
|
||||
binding.activeprofile.text = HtmlHelper.fromHtml(formatColors(profileNames[0], profileNames[1]))
|
||||
binding.date.text = date
|
||||
binding.ic.text = ics(profile1, profile2)
|
||||
binding.isf.text = isfs(profile1, profile2)
|
||||
binding.basal.text = basals(profile1, profile2)
|
||||
binding.target.text = targets(profile1, profile2)
|
||||
binding.basalGraph.show(profile1, profile2)
|
||||
}
|
||||
|
||||
profileview_noprofile.visibility = View.GONE
|
||||
profileview_invalidprofile.visibility = if (profile1.isValid("ProfileViewDialog")) View.GONE else View.VISIBLE
|
||||
binding.noprofile.visibility = View.GONE
|
||||
binding.invalidprofile.visibility = if (profile1.isValid("ProfileViewDialog")) View.GONE else View.VISIBLE
|
||||
}
|
||||
else
|
||||
profile?.let {
|
||||
profileview_units.text = it.units
|
||||
profileview_dia.text = resourceHelper.gs(R.string.format_hours, it.dia)
|
||||
profileview_activeprofile.text = profileName
|
||||
profileview_date.text = date
|
||||
profileview_ic.text = it.icList
|
||||
profileview_isf.text = it.isfList
|
||||
profileview_basal.text = it.basalList
|
||||
profileview_target.text = it.targetList
|
||||
basal_graph.show(it)
|
||||
binding.units.text = it.units
|
||||
binding.dia.text = resourceHelper.gs(R.string.format_hours, it.dia)
|
||||
binding.activeprofile.text = profileName
|
||||
binding.date.text = date
|
||||
binding.ic.text = it.icList
|
||||
binding.isf.text = it.isfList
|
||||
binding.basal.text = it.basalList
|
||||
binding.target.text = it.targetList
|
||||
binding.basalGraph.show(it)
|
||||
|
||||
profileview_noprofile.visibility = View.GONE
|
||||
profileview_invalidprofile.visibility = if (it.isValid("ProfileViewDialog")) View.GONE else View.VISIBLE
|
||||
binding.noprofile.visibility = View.GONE
|
||||
binding.invalidprofile.visibility = if (it.isValid("ProfileViewDialog")) View.GONE else View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,6 +173,11 @@ class ProfileViewerDialog : DaggerDialogFragment() {
|
|||
bundle.putString("customProfile2", customProfileJson2)
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
|
||||
private fun formatColors(label: String, value1: Double, value2: Double, format: DecimalFormat, units: String): String {
|
||||
return formatColors(label, format.format(value1), format.format(value2), units)
|
||||
}
|
||||
|
@ -226,7 +237,7 @@ class ProfileViewerDialog : DaggerDialogFragment() {
|
|||
prev1 = val1
|
||||
prev2 = val2
|
||||
}
|
||||
return HtmlHelper.fromHtml(s.delete(s.length-4, s.length).toString())
|
||||
return HtmlHelper.fromHtml(s.delete(s.length - 4, s.length).toString())
|
||||
}
|
||||
|
||||
private fun isfs(profile1: Profile, profile2: Profile): Spanned {
|
||||
|
@ -244,10 +255,10 @@ class ProfileViewerDialog : DaggerDialogFragment() {
|
|||
prev1 = val1
|
||||
prev2 = val2
|
||||
}
|
||||
return HtmlHelper.fromHtml(s.delete(s.length-4, s.length).toString())
|
||||
return HtmlHelper.fromHtml(s.delete(s.length - 4, s.length).toString())
|
||||
}
|
||||
|
||||
private fun targets(profile1: Profile, profile2: Profile):Spanned {
|
||||
private fun targets(profile1: Profile, profile2: Profile): Spanned {
|
||||
var prev1l = -1.0
|
||||
var prev1h = -1.0
|
||||
var prev2l = -1.0
|
||||
|
@ -261,7 +272,7 @@ class ProfileViewerDialog : DaggerDialogFragment() {
|
|||
val val2h = profile2.getTargetHighMgdlTimeFromMidnight(hour * 60 * 60)
|
||||
val txt1 = Profile.format_HH_MM(hour * 60 * 60) + " " + Profile.toUnitsString(val1l, val1l * Constants.MGDL_TO_MMOLL, units) + " - " + Profile.toUnitsString(val1h, val1h * Constants.MGDL_TO_MMOLL, units) + " " + units
|
||||
val txt2 = Profile.format_HH_MM(hour * 60 * 60) + " " + Profile.toUnitsString(val2l, val2l * Constants.MGDL_TO_MMOLL, units) + " - " + Profile.toUnitsString(val2h, val2h * Constants.MGDL_TO_MMOLL, units) + " " + units
|
||||
if (val1l != prev1l || val1h != prev1h || val2l != prev2l || val2h != prev2h ) {
|
||||
if (val1l != prev1l || val1h != prev1h || val2l != prev2l || val2h != prev2h) {
|
||||
s.append(formatColors(txt1, txt2))
|
||||
s.append("<br>")
|
||||
}
|
||||
|
@ -270,6 +281,6 @@ class ProfileViewerDialog : DaggerDialogFragment() {
|
|||
prev2l = val2l
|
||||
prev2h = val2h
|
||||
}
|
||||
return HtmlHelper.fromHtml(s.delete(s.length-4, s.length).toString())
|
||||
return HtmlHelper.fromHtml(s.delete(s.length - 4, s.length).toString())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@ package info.nightscout.androidaps.plugins.general.maintenance
|
|||
import android.os.Parcelable
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.formats.PrefMetadata
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.formats.PrefsMetadataKey
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import kotlinx.android.parcel.RawValue
|
||||
import kotlinx.parcelize.RawValue
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import java.io.File
|
||||
|
||||
@Parcelize
|
||||
|
|
|
@ -5,7 +5,7 @@ import android.os.Parcelable
|
|||
import androidx.annotation.DrawableRes
|
||||
import androidx.annotation.StringRes
|
||||
import info.nightscout.androidaps.core.R
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import java.io.File
|
||||
|
||||
enum class PrefsMetadataKey(val key: String, @DrawableRes val icon: Int, @StringRes val label: Int) {
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context="info.nightscout.androidaps.dialogs.BolusProgressDialog"
|
||||
>
|
||||
tools:context="info.nightscout.androidaps.dialogs.BolusProgressDialog">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -22,15 +21,15 @@
|
|||
app:srcCompat="@drawable/ic_trending_flat_white_48dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/overview_bolusprogress_title"
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:textAlignment="center"
|
||||
android:layout_toEndOf="@id/header_icon"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -41,16 +40,17 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp" />
|
||||
<TextView
|
||||
android:id="@+id/overview_bolusprogress_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/overview_bolusprogress_stoppressed"
|
||||
android:id="@+id/status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/stoppressed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
|
@ -62,18 +62,18 @@
|
|||
android:visibility="gone" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/overview_bolusprogress_progressbar"
|
||||
android:id="@+id/progressbar"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:maxHeight="5dp"
|
||||
android:minHeight="3dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/overview_bolusprogress_stop"
|
||||
android:id="@+id/stop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
app:srcCompat="@drawable/ic_home_profile" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profileview_activeprofile"
|
||||
android:id="@+id/activeprofile"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
|
@ -37,8 +37,8 @@
|
|||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:textAlignment="center"
|
||||
android:layout_toEndOf="@id/header_icon"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -51,7 +51,7 @@
|
|||
android:padding="5dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profileview_invalidprofile"
|
||||
android:id="@+id/invalidprofile"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
|
@ -62,7 +62,7 @@
|
|||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profileview_noprofile"
|
||||
android:id="@+id/noprofile"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
|
@ -73,7 +73,7 @@
|
|||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/profileview_datelayout"
|
||||
android:id="@+id/datelayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
|
@ -82,29 +82,29 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_weight="2"
|
||||
android:gravity="end"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:text="@string/date"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:text=":"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profileview_date"
|
||||
android:id="@+id/date"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start"
|
||||
android:layout_marginStart="5dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
@ -127,29 +127,29 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_weight="2"
|
||||
android:gravity="end"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:text="@string/units_label"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:text=":"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profileview_units"
|
||||
android:id="@+id/units"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start"
|
||||
android:layout_marginStart="5dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
@ -172,29 +172,29 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_weight="2"
|
||||
android:gravity="end"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:text="@string/dia_label"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:text=":"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profileview_dia"
|
||||
android:id="@+id/dia"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start"
|
||||
android:layout_marginStart="5dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
@ -217,29 +217,29 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_weight="2"
|
||||
android:gravity="end"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:text="@string/ic_label"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:text=":"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profileview_ic"
|
||||
android:id="@+id/ic"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start"
|
||||
android:layout_marginStart="5dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
@ -262,29 +262,29 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_weight="2"
|
||||
android:gravity="end"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:text="@string/isf_label"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:text=":"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profileview_isf"
|
||||
android:id="@+id/isf"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start"
|
||||
android:layout_marginStart="5dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
@ -307,29 +307,29 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_weight="2"
|
||||
android:gravity="end"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:text="@string/basal_label"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:text=":"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profileview_basal"
|
||||
android:id="@+id/basal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start"
|
||||
android:layout_marginStart="5dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
@ -343,29 +343,29 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_weight="2"
|
||||
android:gravity="end"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:text=""
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:text=""
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profileview_basaltotal"
|
||||
android:id="@+id/basaltotal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="17dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start"
|
||||
android:layout_marginStart="17dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
@ -394,35 +394,37 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_weight="2"
|
||||
android:gravity="end"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:text="@string/target_label"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:text=":"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profileview_target"
|
||||
android:id="@+id/target"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start"
|
||||
android:layout_marginStart="5dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/close" />
|
||||
<include
|
||||
android:id="@+id/close_layout"
|
||||
layout="@layout/close" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
Loading…
Reference in a new issue