From 7e15f045925afeac0fc9c07a923ba4d9dcea5a21 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 19 Apr 2022 12:20:31 +0200 Subject: [PATCH] remove delimiters from treatments tabs --- .../fragments/TreatmentsBolusCarbsFragment.kt | 2 - .../fragments/TreatmentsCareportalFragment.kt | 2 - .../TreatmentsExtendedBolusesFragment.kt | 2 - .../TreatmentsProfileSwitchFragment.kt | 2 - .../fragments/TreatmentsTempTargetFragment.kt | 2 - .../TreatmentsTemporaryBasalsFragment.kt | 2 - .../fragments/TreatmentsUserEntryFragment.kt | 2 - .../layout/treatments_bolus_carbs_item.xml | 11 +- .../res/layout/treatments_careportal_item.xml | 11 +- .../layout/treatments_extendedbolus_item.xml | 11 +- .../layout/treatments_profileswitch_item.xml | 11 +- .../res/layout/treatments_tempbasals_item.xml | 11 +- .../res/layout/treatments_temptarget_item.xml | 11 +- .../res/layout/treatments_user_entry_item.xml | 171 +++++++++--------- 14 files changed, 91 insertions(+), 160 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsBolusCarbsFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsBolusCarbsFragment.kt index e70e7a9cbe..a4fa56a699 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsBolusCarbsFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsBolusCarbsFragment.kt @@ -269,8 +269,6 @@ class TreatmentsBolusCarbsFragment : DaggerFragment() { } holder.binding.calculation.tag = ml - val nextTimestamp = if (mealLinks.size != position + 1) timestamp(mealLinks[position + 1]) else 0L - holder.binding.delimiter.visibility = dateUtil.isSameDayGroup(timestamp(ml), nextTimestamp).toVisibility() } override fun getItemCount() = mealLinks.size diff --git a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsCareportalFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsCareportalFragment.kt index 37713a7e30..820b5d3b93 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsCareportalFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsCareportalFragment.kt @@ -173,8 +173,6 @@ class TreatmentsCareportalFragment : DaggerFragment() { actionHelper.updateSelection(position, therapyEvent, holder.binding.cbRemove.isChecked) } holder.binding.cbRemove.isChecked = actionHelper.isSelected(position) - val nextTimestamp = if (therapyList.size != position + 1) therapyList[position + 1].timestamp else 0L - holder.binding.delimiter.visibility = dateUtil.isSameDayGroup(therapyEvent.timestamp, nextTimestamp).toVisibility() } override fun getItemCount() = therapyList.size diff --git a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsExtendedBolusesFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsExtendedBolusesFragment.kt index b7ffd407c8..e21bd897ae 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsExtendedBolusesFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsExtendedBolusesFragment.kt @@ -163,8 +163,6 @@ class TreatmentsExtendedBolusesFragment : DaggerFragment() { } holder.binding.cbRemove.isChecked = actionHelper.isSelected(position) } - val nextTimestamp = if (extendedBolusList.size != position + 1) extendedBolusList[position + 1].timestamp else 0L - holder.binding.delimiter.visibility = dateUtil.isSameDayGroup(extendedBolus.timestamp, nextTimestamp).toVisibility() } override fun getItemCount() = extendedBolusList.size diff --git a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsProfileSwitchFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsProfileSwitchFragment.kt index 92f9d5f38b..49e8c4ca52 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsProfileSwitchFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsProfileSwitchFragment.kt @@ -214,8 +214,6 @@ class TreatmentsProfileSwitchFragment : DaggerFragment() { } holder.binding.clone.visibility = (profileSwitch is ProfileSealed.PS).toVisibility() holder.binding.spacer.visibility = (profileSwitch is ProfileSealed.PS).toVisibility() - val nextTimestamp = if (profileSwitchList.size != position + 1) profileSwitchList[position + 1].timestamp else 0L - holder.binding.delimiter.visibility = dateUtil.isSameDayGroup(profileSwitch.timestamp, nextTimestamp).toVisibility() } override fun getItemCount() = profileSwitchList.size diff --git a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsTempTargetFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsTempTargetFragment.kt index 028ae4f99a..137d6cf94c 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsTempTargetFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsTempTargetFragment.kt @@ -192,8 +192,6 @@ class TreatmentsTempTargetFragment : DaggerFragment() { else -> holder.binding.reasonColon.currentTextColor } ) - val nextTimestamp = if (tempTargetList.size != position + 1) tempTargetList[position + 1].timestamp else 0L - holder.binding.delimiter.visibility = dateUtil.isSameDayGroup(tempTarget.timestamp, nextTimestamp).toVisibility() } override fun getItemCount() = tempTargetList.size diff --git a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsTemporaryBasalsFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsTemporaryBasalsFragment.kt index da76998092..1f585ecd0a 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsTemporaryBasalsFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsTemporaryBasalsFragment.kt @@ -204,8 +204,6 @@ class TreatmentsTemporaryBasalsFragment : DaggerFragment() { } holder.binding.cbRemove.isChecked = actionHelper.isSelected(position) } - val nextTimestamp = if (tempBasalList.size != position + 1) tempBasalList[position + 1].timestamp else 0L - holder.binding.delimiter.visibility = dateUtil.isSameDayGroup(tempBasal.timestamp, nextTimestamp).toVisibility() } override fun getItemCount() = tempBasalList.size diff --git a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsUserEntryFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsUserEntryFragment.kt index 0303f5bf7c..bd442ce723 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsUserEntryFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsUserEntryFragment.kt @@ -134,8 +134,6 @@ class TreatmentsUserEntryFragment : DaggerFragment() { holder.binding.iconSource.setImageResource(userEntryPresentationHelper.iconId(current.source)) holder.binding.values.text = userEntryPresentationHelper.listToPresentationString(current.values) holder.binding.values.visibility = (holder.binding.values.text != "").toVisibility() - val nextTimestamp = if (entries.size != position + 1) entries[position + 1].timestamp else 0L - holder.binding.delimiter.visibility = dateUtil.isSameDayGroup(current.timestamp, nextTimestamp).toVisibility() } inner class UserEntryViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { diff --git a/app/src/main/res/layout/treatments_bolus_carbs_item.xml b/app/src/main/res/layout/treatments_bolus_carbs_item.xml index fb64eaf786..d21c778f3e 100644 --- a/app/src/main/res/layout/treatments_bolus_carbs_item.xml +++ b/app/src/main/res/layout/treatments_bolus_carbs_item.xml @@ -8,6 +8,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="4dp" + android:layout_marginBottom="4dp" app:cardCornerRadius="4dp" app:contentPadding="2dp" android:layout_gravity="center"> @@ -266,16 +267,6 @@ - - diff --git a/app/src/main/res/layout/treatments_careportal_item.xml b/app/src/main/res/layout/treatments_careportal_item.xml index 3b7ca3b34e..6431d6eee5 100644 --- a/app/src/main/res/layout/treatments_careportal_item.xml +++ b/app/src/main/res/layout/treatments_careportal_item.xml @@ -8,6 +8,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="4dp" + android:layout_marginBottom="4dp" app:cardCornerRadius="4dp" app:contentPadding="2dp" android:layout_gravity="center"> @@ -124,16 +125,6 @@ - - diff --git a/app/src/main/res/layout/treatments_extendedbolus_item.xml b/app/src/main/res/layout/treatments_extendedbolus_item.xml index c96a01e99a..18621d3e9d 100644 --- a/app/src/main/res/layout/treatments_extendedbolus_item.xml +++ b/app/src/main/res/layout/treatments_extendedbolus_item.xml @@ -8,6 +8,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="4dp" + android:layout_marginBottom="4dp" app:cardCornerRadius="4dp" app:contentPadding="2dp" android:layout_gravity="center"> @@ -169,16 +170,6 @@ - - diff --git a/app/src/main/res/layout/treatments_profileswitch_item.xml b/app/src/main/res/layout/treatments_profileswitch_item.xml index 8229e389f6..407af40983 100644 --- a/app/src/main/res/layout/treatments_profileswitch_item.xml +++ b/app/src/main/res/layout/treatments_profileswitch_item.xml @@ -8,6 +8,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="4dp" + android:layout_marginBottom="4dp" app:cardCornerRadius="4dp" app:contentPadding="2dp" android:layout_gravity="center"> @@ -137,16 +138,6 @@ - - diff --git a/app/src/main/res/layout/treatments_tempbasals_item.xml b/app/src/main/res/layout/treatments_tempbasals_item.xml index 646dc3d2aa..6f20e98720 100644 --- a/app/src/main/res/layout/treatments_tempbasals_item.xml +++ b/app/src/main/res/layout/treatments_tempbasals_item.xml @@ -8,6 +8,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="4dp" + android:layout_marginBottom="4dp" app:cardCornerRadius="4dp" app:contentPadding="2dp" android:layout_gravity="center"> @@ -187,16 +188,6 @@ - - diff --git a/app/src/main/res/layout/treatments_temptarget_item.xml b/app/src/main/res/layout/treatments_temptarget_item.xml index dde9ad68b6..8124661300 100644 --- a/app/src/main/res/layout/treatments_temptarget_item.xml +++ b/app/src/main/res/layout/treatments_temptarget_item.xml @@ -8,6 +8,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="4dp" + android:layout_marginBottom="4dp" app:cardCornerRadius="4dp" app:contentPadding="2dp" android:layout_gravity="center"> @@ -159,16 +160,6 @@ - - diff --git a/app/src/main/res/layout/treatments_user_entry_item.xml b/app/src/main/res/layout/treatments_user_entry_item.xml index 985a8071e9..e2e2f6fe76 100644 --- a/app/src/main/res/layout/treatments_user_entry_item.xml +++ b/app/src/main/res/layout/treatments_user_entry_item.xml @@ -1,102 +1,101 @@ - + android:layout_gravity="center" + android:layout_marginStart="4dp" + android:layout_marginBottom="4dp" + app:cardCornerRadius="4dp" + app:contentPadding="2dp"> - + android:orientation="vertical"> - + - + - + - + - + - + - + + + + + + + + + + +