From 6d63bdca07a5419271f5e40dff780ed70bd65a10 Mon Sep 17 00:00:00 2001 From: Philoul Date: Sat, 8 Aug 2020 17:53:28 +0200 Subject: [PATCH 1/4] Add 7 trend arrows icons to replace text --- app/src/main/res/drawable/ic_doubledown.xml | 12 ++++++++++++ app/src/main/res/drawable/ic_doubleup.xml | 12 ++++++++++++ app/src/main/res/drawable/ic_flat.xml | 9 +++++++++ app/src/main/res/drawable/ic_fortyfivedown.xml | 9 +++++++++ app/src/main/res/drawable/ic_fortyfiveup.xml | 9 +++++++++ app/src/main/res/drawable/ic_invalid.xml | 18 ++++++++++++++++++ app/src/main/res/drawable/ic_singledown.xml | 9 +++++++++ app/src/main/res/drawable/ic_singleup.xml | 9 +++++++++ icons/ic_DoubleDown.svg | 12 ++++++++++++ icons/ic_DoubleUp.svg | 12 ++++++++++++ icons/ic_Flat.svg | 9 +++++++++ icons/ic_FortyFiveDown.svg | 9 +++++++++ icons/ic_FortyFiveUp.svg | 9 +++++++++ icons/ic_Invalid.svg | 18 ++++++++++++++++++ icons/ic_SingleDown.svg | 9 +++++++++ icons/ic_SingleUp.svg | 9 +++++++++ 16 files changed, 174 insertions(+) create mode 100644 app/src/main/res/drawable/ic_doubledown.xml create mode 100644 app/src/main/res/drawable/ic_doubleup.xml create mode 100644 app/src/main/res/drawable/ic_flat.xml create mode 100644 app/src/main/res/drawable/ic_fortyfivedown.xml create mode 100644 app/src/main/res/drawable/ic_fortyfiveup.xml create mode 100644 app/src/main/res/drawable/ic_invalid.xml create mode 100644 app/src/main/res/drawable/ic_singledown.xml create mode 100644 app/src/main/res/drawable/ic_singleup.xml create mode 100644 icons/ic_DoubleDown.svg create mode 100644 icons/ic_DoubleUp.svg create mode 100644 icons/ic_Flat.svg create mode 100644 icons/ic_FortyFiveDown.svg create mode 100644 icons/ic_FortyFiveUp.svg create mode 100644 icons/ic_Invalid.svg create mode 100644 icons/ic_SingleDown.svg create mode 100644 icons/ic_SingleUp.svg diff --git a/app/src/main/res/drawable/ic_doubledown.xml b/app/src/main/res/drawable/ic_doubledown.xml new file mode 100644 index 0000000000..1b6174f3d0 --- /dev/null +++ b/app/src/main/res/drawable/ic_doubledown.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_doubleup.xml b/app/src/main/res/drawable/ic_doubleup.xml new file mode 100644 index 0000000000..32e541163a --- /dev/null +++ b/app/src/main/res/drawable/ic_doubleup.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_flat.xml b/app/src/main/res/drawable/ic_flat.xml new file mode 100644 index 0000000000..ed4986a65d --- /dev/null +++ b/app/src/main/res/drawable/ic_flat.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_fortyfivedown.xml b/app/src/main/res/drawable/ic_fortyfivedown.xml new file mode 100644 index 0000000000..199b8f4984 --- /dev/null +++ b/app/src/main/res/drawable/ic_fortyfivedown.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_fortyfiveup.xml b/app/src/main/res/drawable/ic_fortyfiveup.xml new file mode 100644 index 0000000000..24814d6714 --- /dev/null +++ b/app/src/main/res/drawable/ic_fortyfiveup.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_invalid.xml b/app/src/main/res/drawable/ic_invalid.xml new file mode 100644 index 0000000000..ab59d070b2 --- /dev/null +++ b/app/src/main/res/drawable/ic_invalid.xml @@ -0,0 +1,18 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_singledown.xml b/app/src/main/res/drawable/ic_singledown.xml new file mode 100644 index 0000000000..ec4c30af82 --- /dev/null +++ b/app/src/main/res/drawable/ic_singledown.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_singleup.xml b/app/src/main/res/drawable/ic_singleup.xml new file mode 100644 index 0000000000..9ec675864b --- /dev/null +++ b/app/src/main/res/drawable/ic_singleup.xml @@ -0,0 +1,9 @@ + + + diff --git a/icons/ic_DoubleDown.svg b/icons/ic_DoubleDown.svg new file mode 100644 index 0000000000..59a49688fd --- /dev/null +++ b/icons/ic_DoubleDown.svg @@ -0,0 +1,12 @@ + + + + + + + diff --git a/icons/ic_DoubleUp.svg b/icons/ic_DoubleUp.svg new file mode 100644 index 0000000000..ffe05f5740 --- /dev/null +++ b/icons/ic_DoubleUp.svg @@ -0,0 +1,12 @@ + + + + + + + diff --git a/icons/ic_Flat.svg b/icons/ic_Flat.svg new file mode 100644 index 0000000000..1ec4fa8e6c --- /dev/null +++ b/icons/ic_Flat.svg @@ -0,0 +1,9 @@ + + + + + + diff --git a/icons/ic_FortyFiveDown.svg b/icons/ic_FortyFiveDown.svg new file mode 100644 index 0000000000..5ea545a3a4 --- /dev/null +++ b/icons/ic_FortyFiveDown.svg @@ -0,0 +1,9 @@ + + + + + + diff --git a/icons/ic_FortyFiveUp.svg b/icons/ic_FortyFiveUp.svg new file mode 100644 index 0000000000..91d223b371 --- /dev/null +++ b/icons/ic_FortyFiveUp.svg @@ -0,0 +1,9 @@ + + + + + + diff --git a/icons/ic_Invalid.svg b/icons/ic_Invalid.svg new file mode 100644 index 0000000000..79de4c9ad7 --- /dev/null +++ b/icons/ic_Invalid.svg @@ -0,0 +1,18 @@ + + + + + + + + + diff --git a/icons/ic_SingleDown.svg b/icons/ic_SingleDown.svg new file mode 100644 index 0000000000..ca673aee12 --- /dev/null +++ b/icons/ic_SingleDown.svg @@ -0,0 +1,9 @@ + + + + + + diff --git a/icons/ic_SingleUp.svg b/icons/ic_SingleUp.svg new file mode 100644 index 0000000000..b508a6fc93 --- /dev/null +++ b/icons/ic_SingleUp.svg @@ -0,0 +1,9 @@ + + + + + + From adc71aae08f6e15eab6690e0f8f79b00882bad04 Mon Sep 17 00:00:00 2001 From: Philoul Date: Sat, 8 Aug 2020 19:09:21 +0200 Subject: [PATCH 2/4] Update Overview Layout for Arrow icons Add a directionToIcon function in BGReading Move arrow icons to core --- .../general/overview/OverviewFragment.kt | 5 ++-- .../main/res/layout/overview_info_layout.xml | 15 +++++------ .../nightscout/androidaps/db/BgReading.java | 26 +++++++++++++++++++ .../src/main/res/drawable/ic_doubledown.xml | 0 .../src/main/res/drawable/ic_doubleup.xml | 0 .../src/main/res/drawable/ic_flat.xml | 0 .../main/res/drawable/ic_fortyfivedown.xml | 0 .../src/main/res/drawable/ic_fortyfiveup.xml | 0 .../src/main/res/drawable/ic_invalid.xml | 0 .../src/main/res/drawable/ic_singledown.xml | 0 .../src/main/res/drawable/ic_singleup.xml | 0 11 files changed, 34 insertions(+), 12 deletions(-) rename {app => core}/src/main/res/drawable/ic_doubledown.xml (100%) rename {app => core}/src/main/res/drawable/ic_doubleup.xml (100%) rename {app => core}/src/main/res/drawable/ic_flat.xml (100%) rename {app => core}/src/main/res/drawable/ic_fortyfivedown.xml (100%) rename {app => core}/src/main/res/drawable/ic_fortyfiveup.xml (100%) rename {app => core}/src/main/res/drawable/ic_invalid.xml (100%) rename {app => core}/src/main/res/drawable/ic_singledown.xml (100%) rename {app => core}/src/main/res/drawable/ic_singleup.xml (100%) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt index 240a396d92..595be6943f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt @@ -179,7 +179,6 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - if (smallWidth) overview_arrow?.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 35f) overview_pumpstatus?.setBackgroundColor(resourceHelper.gc(R.color.colorInitializingBorder)) overview_notifications?.setHasFixedSize(false) @@ -567,8 +566,8 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList overview_bg?.text = lastBG.valueToUnitsToString(units) overview_bg?.setTextColor(color) - overview_arrow?.text = lastBG.directionToSymbol(databaseHelper) - overview_arrow?.setTextColor(color) + overview_arrow?.setImageResource(lastBG.directionToIcon(databaseHelper)) + overview_arrow?.setColorFilter(color) val glucoseStatus = GlucoseStatus(injector).glucoseStatusData if (glucoseStatus != null) { diff --git a/app/src/main/res/layout/overview_info_layout.xml b/app/src/main/res/layout/overview_info_layout.xml index 46b9ab16f4..193563ee09 100644 --- a/app/src/main/res/layout/overview_info_layout.xml +++ b/app/src/main/res/layout/overview_info_layout.xml @@ -17,21 +17,18 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - - + app:layout_constraintTop_toTopOf="@+id/overview_bg" + android:paddingTop="18dp" + android:src="@drawable/ic_flat" /> Date: Sun, 9 Aug 2020 10:49:54 +0200 Subject: [PATCH 3/4] Update BGSourceFragment Arrow color a little bit lighter than text (don't find exact text color) Default color for arrows swtiched to white --- .../plugins/source/BGSourceFragment.kt | 5 ++-- app/src/main/res/layout/bgsource_item.xml | 9 +++++++- .../nightscout/androidaps/db/BgReadingTest.kt | 23 +++++++++++++++++++ core/src/main/res/drawable/ic_doubledown.xml | 4 ++-- core/src/main/res/drawable/ic_doubleup.xml | 4 ++-- core/src/main/res/drawable/ic_flat.xml | 2 +- .../main/res/drawable/ic_fortyfivedown.xml | 2 +- core/src/main/res/drawable/ic_fortyfiveup.xml | 2 +- core/src/main/res/drawable/ic_invalid.xml | 8 +++---- core/src/main/res/drawable/ic_singledown.xml | 2 +- core/src/main/res/drawable/ic_singleup.xml | 2 +- 11 files changed, 47 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/BGSourceFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/BGSourceFragment.kt index b01ba8d470..2b0d38fab8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/BGSourceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/BGSourceFragment.kt @@ -5,6 +5,7 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import android.widget.ImageView import android.widget.TextView import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView @@ -86,7 +87,7 @@ class BGSourceFragment : DaggerFragment() { holder.invalid.visibility = if (!bgReading.isValid) View.VISIBLE else View.GONE holder.date.text = dateUtil.dateAndTimeString(bgReading.date) holder.value.text = bgReading.valueToUnitsToString(profileFunction.getUnits()) - holder.direction.text = bgReading.directionToSymbol(databaseHelper) + holder.direction.setImageResource(bgReading.directionToIcon(databaseHelper)) holder.remove.tag = bgReading } @@ -97,7 +98,7 @@ class BGSourceFragment : DaggerFragment() { inner class BgReadingsViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var date: TextView = itemView.findViewById(R.id.bgsource_date) var value: TextView = itemView.findViewById(R.id.bgsource_value) - var direction: TextView = itemView.findViewById(R.id.bgsource_direction) + var direction: ImageView = itemView.findViewById(R.id.bgsource_direction) var invalid: TextView = itemView.findViewById(R.id.invalid_sign) var ns: TextView = itemView.findViewById(R.id.ns_sign) var remove: TextView = itemView.findViewById(R.id.bgsource_remove) diff --git a/app/src/main/res/layout/bgsource_item.xml b/app/src/main/res/layout/bgsource_item.xml index 5d1842b8c6..f7d5d54d57 100644 --- a/app/src/main/res/layout/bgsource_item.xml +++ b/app/src/main/res/layout/bgsource_item.xml @@ -34,7 +34,7 @@ android:paddingStart="10dp" android:text="Name" android:textStyle="bold" /> - + + + android:fillColor="@color/white"/> + android:fillColor="@color/white"/> diff --git a/core/src/main/res/drawable/ic_doubleup.xml b/core/src/main/res/drawable/ic_doubleup.xml index 32e541163a..9c56d4cf85 100644 --- a/core/src/main/res/drawable/ic_doubleup.xml +++ b/core/src/main/res/drawable/ic_doubleup.xml @@ -5,8 +5,8 @@ android:viewportHeight="24"> + android:fillColor="@color/white"/> + android:fillColor="@color/white"/> diff --git a/core/src/main/res/drawable/ic_flat.xml b/core/src/main/res/drawable/ic_flat.xml index ed4986a65d..487a647f10 100644 --- a/core/src/main/res/drawable/ic_flat.xml +++ b/core/src/main/res/drawable/ic_flat.xml @@ -5,5 +5,5 @@ android:viewportHeight="24"> + android:fillColor="@color/white"/> diff --git a/core/src/main/res/drawable/ic_fortyfivedown.xml b/core/src/main/res/drawable/ic_fortyfivedown.xml index 199b8f4984..673a965fe4 100644 --- a/core/src/main/res/drawable/ic_fortyfivedown.xml +++ b/core/src/main/res/drawable/ic_fortyfivedown.xml @@ -5,5 +5,5 @@ android:viewportHeight="24"> + android:fillColor="@color/white"/> diff --git a/core/src/main/res/drawable/ic_fortyfiveup.xml b/core/src/main/res/drawable/ic_fortyfiveup.xml index 24814d6714..930857ec66 100644 --- a/core/src/main/res/drawable/ic_fortyfiveup.xml +++ b/core/src/main/res/drawable/ic_fortyfiveup.xml @@ -5,5 +5,5 @@ android:viewportHeight="24"> + android:fillColor="@color/white"/> diff --git a/core/src/main/res/drawable/ic_invalid.xml b/core/src/main/res/drawable/ic_invalid.xml index ab59d070b2..bdda131e7d 100644 --- a/core/src/main/res/drawable/ic_invalid.xml +++ b/core/src/main/res/drawable/ic_invalid.xml @@ -5,14 +5,14 @@ android:viewportHeight="24"> + android:fillColor="@color/white"/> + android:fillColor="@color/white"/> + android:fillColor="@color/white"/> + android:fillColor="@color/white"/> diff --git a/core/src/main/res/drawable/ic_singledown.xml b/core/src/main/res/drawable/ic_singledown.xml index ec4c30af82..bc3a0e7501 100644 --- a/core/src/main/res/drawable/ic_singledown.xml +++ b/core/src/main/res/drawable/ic_singledown.xml @@ -5,5 +5,5 @@ android:viewportHeight="24"> + android:fillColor="@color/white"/> diff --git a/core/src/main/res/drawable/ic_singleup.xml b/core/src/main/res/drawable/ic_singleup.xml index 9ec675864b..6dda71fc74 100644 --- a/core/src/main/res/drawable/ic_singleup.xml +++ b/core/src/main/res/drawable/ic_singleup.xml @@ -5,5 +5,5 @@ android:viewportHeight="24"> + android:fillColor="@color/white"/> From d89d760a5e30f5c5f09f339327b96d1cfdf35abd Mon Sep 17 00:00:00 2001 From: Philoul Date: Sun, 9 Aug 2020 10:59:56 +0200 Subject: [PATCH 4/4] Remove old TextView --- app/src/main/res/layout/bgsource_item.xml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/app/src/main/res/layout/bgsource_item.xml b/app/src/main/res/layout/bgsource_item.xml index f7d5d54d57..ff84837cba 100644 --- a/app/src/main/res/layout/bgsource_item.xml +++ b/app/src/main/res/layout/bgsource_item.xml @@ -34,15 +34,7 @@ android:paddingStart="10dp" android:text="Name" android:textStyle="bold" /> - +