Update BGSourceFragment
Arrow color a little bit lighter than text (don't find exact text color) Default color for arrows swtiched to white
This commit is contained in:
parent
adc71aae08
commit
b70c6c9f1b
|
@ -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)
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
android:paddingStart="10dp"
|
||||
android:text="Name"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!--
|
||||
<TextView
|
||||
android:id="@+id/bgsource_direction"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -42,6 +42,13 @@
|
|||
android:layout_weight="1"
|
||||
android:paddingStart="10dp"
|
||||
android:text="-" />
|
||||
-->
|
||||
<ImageView
|
||||
android:id="@+id/bgsource_direction"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="@drawable/ic_flat" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ns_sign"
|
||||
|
|
|
@ -10,6 +10,7 @@ import info.nightscout.androidaps.interfaces.DatabaseHelperInterface
|
|||
import info.nightscout.androidaps.logging.L
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
|
@ -76,6 +77,28 @@ class BgReadingTest : TestBase() {
|
|||
Assert.assertEquals("??", bgReading.directionToSymbol(databaseHelper))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun directionToIcon() {
|
||||
val bgReading = BgReading(injector)
|
||||
bgReading.direction = "DoubleDown"
|
||||
Assert.assertEquals(R.drawable.ic_doubledown, bgReading.directionToIcon(databaseHelper))
|
||||
bgReading.direction = "SingleDown"
|
||||
Assert.assertEquals(R.drawable.ic_singledown, bgReading.directionToIcon(databaseHelper))
|
||||
bgReading.direction = "FortyFiveDown"
|
||||
Assert.assertEquals(R.drawable.ic_fortyfivedown, bgReading.directionToIcon(databaseHelper))
|
||||
bgReading.direction = "Flat"
|
||||
Assert.assertEquals(R.drawable.ic_flat, bgReading.directionToIcon(databaseHelper))
|
||||
bgReading.direction = "FortyFiveUp"
|
||||
Assert.assertEquals(R.drawable.ic_fortyfiveup, bgReading.directionToIcon(databaseHelper))
|
||||
bgReading.direction = "SingleUp"
|
||||
Assert.assertEquals(R.drawable.ic_singleup, bgReading.directionToIcon(databaseHelper))
|
||||
bgReading.direction = "DoubleUp"
|
||||
Assert.assertEquals(R.drawable.ic_doubleup, bgReading.directionToIcon(databaseHelper))
|
||||
bgReading.direction = "OUT OF RANGE"
|
||||
Assert.assertEquals(R.drawable.ic_invalid, bgReading.directionToIcon(databaseHelper))
|
||||
}
|
||||
|
||||
|
||||
@Test fun dateTest() {
|
||||
val bgReading = BgReading(injector)
|
||||
val now = System.currentTimeMillis()
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M2.702,16.281c1.952,1.81 4.279,4.076 5.31,5.654v0.002c0,0 0.001,-0.001 0.001,-0.001c0,0 0.001,0.001 0.001,0.001v-0.002c1.032,-1.578 3.359,-3.844 5.31,-5.654l-1.325,-1.821c0,0 -1.578,1.408 -2.934,2.728V2.063H6.961l0,15.125c-1.356,-1.319 -2.934,-2.728 -2.934,-2.728L2.702,16.281z"
|
||||
android:fillColor="#36FF00"/>
|
||||
android:fillColor="@color/white"/>
|
||||
<path
|
||||
android:pathData="M10.676,16.281c1.952,1.81 4.279,4.076 5.31,5.654v0.002c0,0 0.001,-0.001 0.001,-0.001c0,0 0.001,0.001 0.001,0.001v-0.002c1.032,-1.578 3.359,-3.844 5.31,-5.654l-1.325,-1.821c0,0 -1.578,1.408 -2.934,2.728V2.063h-2.104v15.125c-1.356,-1.319 -2.934,-2.728 -2.934,-2.728L10.676,16.281z"
|
||||
android:fillColor="#36FF00"/>
|
||||
android:fillColor="@color/white"/>
|
||||
</vector>
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M2.702,7.719c1.952,-1.81 4.279,-4.076 5.31,-5.654V2.063c0,0 0.001,0.001 0.001,0.001c0,0 0.001,-0.001 0.001,-0.001v0.002c1.032,1.578 3.359,3.844 5.31,5.654L11.999,9.54c0,0 -1.578,-1.408 -2.934,-2.728v15.125H6.961l0,-15.125C5.605,8.132 4.027,9.54 4.027,9.54L2.702,7.719z"
|
||||
android:fillColor="#36FF00"/>
|
||||
android:fillColor="@color/white"/>
|
||||
<path
|
||||
android:pathData="M10.676,7.719c1.952,-1.81 4.279,-4.076 5.31,-5.654V2.063c0,0 0.001,0.001 0.001,0.001c0,0 0.001,-0.001 0.001,-0.001v0.002c1.032,1.578 3.359,3.844 5.31,5.654L19.973,9.54c0,0 -1.578,-1.408 -2.934,-2.728v15.125h-2.104V6.813c-1.356,1.319 -2.934,2.728 -2.934,2.728L10.676,7.719z"
|
||||
android:fillColor="#36FF00"/>
|
||||
android:fillColor="@color/white"/>
|
||||
</vector>
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M16.281,17.311c1.81,-1.952 4.076,-4.279 5.654,-5.31h0.002c0,0 -0.001,-0.001 -0.001,-0.001c0,0 0.001,-0.001 0.001,-0.001h-0.002c-1.578,-1.032 -3.844,-3.359 -5.654,-5.31L14.46,8.014c0,0 1.408,1.578 2.728,2.934H2.063v2.104h15.125c-1.319,1.356 -2.728,2.934 -2.728,2.934L16.281,17.311z"
|
||||
android:fillColor="#36FF00"/>
|
||||
android:fillColor="@color/white"/>
|
||||
</vector>
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M11.272,18.783c2.66,-0.1 5.908,-0.143 7.753,0.243l0.001,0.001c0,0 0,-0.001 0,-0.001c0,0 0.001,0 0.001,0l-0.001,-0.001c-0.386,-1.845 -0.343,-5.093 -0.243,-7.753l-2.225,-0.351c0,0 -0.12,2.111 -0.146,4.003L5.717,4.229L4.229,5.717l10.695,10.695c-1.892,0.026 -4.003,0.146 -4.003,0.146L11.272,18.783z"
|
||||
android:fillColor="#36FF00"/>
|
||||
android:fillColor="@color/white"/>
|
||||
</vector>
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M18.783,12.728c-0.1,-2.66 -0.143,-5.908 0.243,-7.753l0.001,-0.001c0,0 -0.001,0 -0.001,0c0,0 0,-0.001 0,-0.001l-0.001,0.001c-1.845,0.386 -5.093,0.343 -7.753,0.243l-0.351,2.225c0,0 2.111,0.12 4.003,0.146L4.229,18.283l1.488,1.488L16.412,9.076c0.026,1.892 0.146,4.003 0.146,4.003L18.783,12.728z"
|
||||
android:fillColor="#36FF00"/>
|
||||
android:fillColor="@color/white"/>
|
||||
</vector>
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M17.35,19.561m-1.147,0a1.147,1.147 0,1 1,2.294 0a1.147,1.147 0,1 1,-2.294 0"
|
||||
android:fillColor="#36FF00"/>
|
||||
android:fillColor="@color/white"/>
|
||||
<path
|
||||
android:pathData="M17.301,16.804c-0.459,0 -0.83,-0.372 -0.83,-0.831c0,-2.985 1.391,-4.027 2.51,-4.864c0.937,-0.702 1.614,-1.209 1.614,-2.849c0,-2.262 -2.173,-2.965 -2.964,-2.965c-1.705,0 -3.083,1.022 -3.778,2.804c-0.167,0.427 -0.65,0.64 -1.075,0.471c-0.427,-0.167 -0.638,-0.648 -0.471,-1.075c0.944,-2.417 2.935,-3.86 5.325,-3.86c1.865,0 4.626,1.47 4.626,4.626c0,2.472 -1.264,3.418 -2.28,4.178c-1.031,0.772 -1.844,1.38 -1.844,3.535C18.131,16.432 17.76,16.804 17.301,16.804z"
|
||||
android:fillColor="#36FF00"/>
|
||||
android:fillColor="@color/white"/>
|
||||
<path
|
||||
android:pathData="M6.846,19.561m-1.147,0a1.147,1.147 0,1 1,2.294 0a1.147,1.147 0,1 1,-2.294 0"
|
||||
android:fillColor="#36FF00"/>
|
||||
android:fillColor="@color/white"/>
|
||||
<path
|
||||
android:pathData="M6.797,16.804c-0.459,0 -0.83,-0.372 -0.83,-0.831c0,-2.985 1.391,-4.027 2.51,-4.864c0.937,-0.702 1.614,-1.209 1.614,-2.849c0,-2.262 -2.173,-2.965 -2.964,-2.965c-1.705,0 -3.083,1.022 -3.778,2.804c-0.167,0.427 -0.65,0.64 -1.075,0.471C1.845,8.403 1.635,7.922 1.801,7.495c0.944,-2.417 2.935,-3.86 5.325,-3.86c1.865,0 4.626,1.47 4.626,4.626c0,2.472 -1.264,3.418 -2.28,4.178c-1.031,0.772 -1.844,1.38 -1.844,3.535C7.627,16.432 7.256,16.804 6.797,16.804z"
|
||||
android:fillColor="#36FF00"/>
|
||||
android:fillColor="@color/white"/>
|
||||
</vector>
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M6.689,16.281c1.952,1.81 4.279,4.076 5.31,5.654v0.002c0,0 0.001,-0.001 0.001,-0.001c0,0 0.001,0.001 0.001,0.001v-0.002c1.032,-1.578 3.359,-3.844 5.31,-5.654l-1.325,-1.821c0,0 -1.578,1.408 -2.934,2.728V2.063h-2.104v15.125c-1.356,-1.319 -2.934,-2.728 -2.934,-2.728L6.689,16.281z"
|
||||
android:fillColor="#36FF00"/>
|
||||
android:fillColor="@color/white"/>
|
||||
</vector>
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M17.102,7.719c-1.952,-1.81 -4.279,-4.076 -5.31,-5.654V2.063c0,0 -0.001,0.001 -0.001,0.001c0,0 -0.001,-0.001 -0.001,-0.001v0.002c-1.032,1.578 -3.359,3.844 -5.31,5.654L7.805,9.54c0,0 1.578,-1.408 2.934,-2.728v15.125h2.104V6.813c1.356,1.319 2.934,2.728 2.934,2.728L17.102,7.719z"
|
||||
android:fillColor="#36FF00"/>
|
||||
android:fillColor="@color/white"/>
|
||||
</vector>
|
||||
|
|
Loading…
Reference in a new issue