Skip to content

Commit

Permalink
show BG value in treatments
Browse files Browse the repository at this point in the history
  • Loading branch information
MilosKozak committed Nov 8, 2023
1 parent b5e00f9 commit 617d722
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import app.aaps.core.interfaces.extensions.toVisibility
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.logging.UserEntryLogger
import app.aaps.core.interfaces.profile.ProfileUtil
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.rx.AapsSchedulers
import app.aaps.core.interfaces.rx.bus.RxBus
Expand Down Expand Up @@ -60,6 +61,7 @@ class TreatmentsCareportalFragment : DaggerFragment(), MenuProvider {
@Inject lateinit var aapsSchedulers: AapsSchedulers
@Inject lateinit var repository: AppRepository
@Inject lateinit var uel: UserEntryLogger
@Inject lateinit var profileUtil: ProfileUtil

private var _binding: TreatmentsCareportalFragmentBinding? = null

Expand Down Expand Up @@ -157,6 +159,8 @@ class TreatmentsCareportalFragment : DaggerFragment(), MenuProvider {
holder.binding.time.text = dateUtil.timeString(therapyEvent.timestamp)
holder.binding.duration.text = if (therapyEvent.duration == 0L) "" else dateUtil.niceTimeScalar(therapyEvent.duration, rh)
holder.binding.note.text = therapyEvent.note
if (therapyEvent.type == TherapyEvent.Type.FINGER_STICK_BG_VALUE)
therapyEvent.glucose?.let { holder.binding.bg.text = profileUtil.stringInCurrentUnitsDetect(it) }
holder.binding.type.text = translator.translate(therapyEvent.type)
holder.binding.cbRemove.visibility = (therapyEvent.isValid && actionHelper.isRemoving).toVisibility()
holder.binding.cbRemove.setOnCheckedChangeListener { _, value ->
Expand Down
11 changes: 10 additions & 1 deletion ui/src/main/res/layout/treatments_careportal_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,22 @@

<TextView
android:id="@+id/note"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingEnd="10dp"
tools:ignore="RtlSymmetry"
tools:text="Activity" />

<TextView
android:id="@+id/bg"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:paddingEnd="10dp"
tools:ignore="RtlSymmetry"
tools:text="Activity" />
tools:text="" />

<CheckBox
android:id="@+id/cb_remove"
Expand Down

0 comments on commit 617d722

Please sign in to comment.