Theme switcher preparation: gac for TDD , automation and misc. preparation
This commit is contained in:
parent
72ed212d37
commit
4151836a9a
|
@ -143,7 +143,7 @@ class BGSourceFragment : DaggerFragment() {
|
||||||
val previous = glucoseValues[position - 1]
|
val previous = glucoseValues[position - 1]
|
||||||
val diff = previous.timestamp - glucoseValue.timestamp
|
val diff = previous.timestamp - glucoseValue.timestamp
|
||||||
if (diff < T.secs(20).msecs())
|
if (diff < T.secs(20).msecs())
|
||||||
holder.binding.root.setBackgroundColor(rh.gc(R.color.errorAlertBackground))
|
holder.binding.root.setBackgroundColor(rh.gac(context, R.attr.bgsourceError))
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.binding.root.setOnLongClickListener {
|
holder.binding.root.setOnLongClickListener {
|
||||||
|
|
|
@ -5,5 +5,5 @@
|
||||||
android:viewportHeight="24">
|
android:viewportHeight="24">
|
||||||
<path
|
<path
|
||||||
android:pathData="M12.107,3.666c-4.603,0 -8.335,3.732 -8.335,8.335s3.732,8.335 8.335,8.335s8.335,-3.731 8.335,-8.335V3.666H12.107zM12.107,18.335c-3.498,0 -6.334,-2.836 -6.334,-6.334c0,-3.498 2.836,-6.334 6.334,-6.334c3.498,0 6.334,2.836 6.334,6.334C18.442,15.499 15.606,18.335 12.107,18.335z"
|
android:pathData="M12.107,3.666c-4.603,0 -8.335,3.732 -8.335,8.335s3.732,8.335 8.335,8.335s8.335,-3.731 8.335,-8.335V3.666H12.107zM12.107,18.335c-3.498,0 -6.334,-2.836 -6.334,-6.334c0,-3.498 2.836,-6.334 6.334,-6.334c3.498,0 6.334,2.836 6.334,6.334C18.442,15.499 15.606,18.335 12.107,18.335z"
|
||||||
android:fillColor="@color/colorLightGray"/>
|
android:fillColor="?attr/cgmdexColor"/>
|
||||||
</vector>
|
</vector>
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom|center_horizontal"
|
android:layout_gravity="bottom|center_horizontal"
|
||||||
android:background="@color/black_overlay"
|
android:background="@color/black_alpha_40"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
android:paddingRight="16dp">
|
android:paddingRight="16dp">
|
||||||
|
|
|
@ -173,10 +173,10 @@ class AutomationFragment : DaggerFragment(), OnStartDragListener {
|
||||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||||
val automation = automationPlugin.at(position)
|
val automation = automationPlugin.at(position)
|
||||||
holder.binding.rootLayout.setBackgroundColor(
|
holder.binding.rootLayout.setBackgroundColor(
|
||||||
rh.gc(
|
rh.gac( context,
|
||||||
if (automation.userAction) R.color.mdtp_line_dark
|
if (automation.userAction) R.attr.userAction
|
||||||
else if (automation.areActionsValid()) R.color.ribbonDefault
|
else if (automation.areActionsValid()) R.attr.validActions
|
||||||
else R.color.errorAlertBackground
|
else R.attr.actionsError
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
holder.binding.eventTitle.text = automation.title
|
holder.binding.eventTitle.text = automation.title
|
||||||
|
|
|
@ -4,6 +4,7 @@ import android.graphics.Typeface
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
|
import info.nightscout.androidaps.automation.R
|
||||||
import info.nightscout.androidaps.plugins.general.automation.triggers.Trigger
|
import info.nightscout.androidaps.plugins.general.automation.triggers.Trigger
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
|
|
||||||
|
@ -28,7 +29,7 @@ class StaticLabel(private val rh: ResourceHelper) : Element() {
|
||||||
LinearLayout(root.context).apply {
|
LinearLayout(root.context).apply {
|
||||||
orientation = LinearLayout.HORIZONTAL
|
orientation = LinearLayout.HORIZONTAL
|
||||||
layoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
layoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||||
setBackgroundColor(rh.gc(android.R.color.black))
|
setBackgroundColor(rh.gac(context, R.attr.automationBackgroundColor))
|
||||||
addView(
|
addView(
|
||||||
TextView(root.context).apply {
|
TextView(root.context).apply {
|
||||||
text = label
|
text = label
|
||||||
|
|
|
@ -165,7 +165,7 @@ class TriggerConnector(injector: HasAndroidInjector) : Trigger(injector) {
|
||||||
text = rh.gs(connectorType.stringRes)
|
text = rh.gs(connectorType.stringRes)
|
||||||
gravity = gravity or Gravity.CENTER_VERTICAL
|
gravity = gravity or Gravity.CENTER_VERTICAL
|
||||||
setTypeface(typeface, Typeface.BOLD)
|
setTypeface(typeface, Typeface.BOLD)
|
||||||
setBackgroundColor(rh.gc(R.color.black_overlay))
|
setBackgroundColor(rh.gac(context, R.attr.automationOverlayColor))
|
||||||
layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT).also { ll ->
|
layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT).also { ll ->
|
||||||
ll.setMargins(rh.dpToPx(3), rh.dpToPx(3), rh.dpToPx(3), rh.dpToPx(3))
|
ll.setMargins(rh.dpToPx(3), rh.dpToPx(3), rh.dpToPx(3), rh.dpToPx(3))
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,27 +89,27 @@ class TDDStatsActivity : NoSplashAppCompatActivity() {
|
||||||
// add stats headers to tables
|
// add stats headers to tables
|
||||||
binding.mainTable.addView(
|
binding.mainTable.addView(
|
||||||
TableRow(this).also { trHead ->
|
TableRow(this).also { trHead ->
|
||||||
trHead.setBackgroundColor(Color.DKGRAY)
|
trHead.setBackgroundColor(rh.gac(this, R.attr.tddHeaderBackground))
|
||||||
trHead.layoutParams = TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
trHead.layoutParams = TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
||||||
trHead.addView(TextView(this).also { labelDate ->
|
trHead.addView(TextView(this).also { labelDate ->
|
||||||
labelDate.text = rh.gs(R.string.date)
|
labelDate.text = rh.gs(R.string.date)
|
||||||
labelDate.setTextColor(Color.WHITE)
|
labelDate.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
trHead.addView(TextView(this).also { labelBasalRate ->
|
trHead.addView(TextView(this).also { labelBasalRate ->
|
||||||
labelBasalRate.text = rh.gs(R.string.basalrate)
|
labelBasalRate.text = rh.gs(R.string.basalrate)
|
||||||
labelBasalRate.setTextColor(Color.WHITE)
|
labelBasalRate.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
trHead.addView(TextView(this).also { labelBolus ->
|
trHead.addView(TextView(this).also { labelBolus ->
|
||||||
labelBolus.text = rh.gs(R.string.bolus)
|
labelBolus.text = rh.gs(R.string.bolus)
|
||||||
labelBolus.setTextColor(Color.WHITE)
|
labelBolus.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
trHead.addView(TextView(this).also { labelTdd ->
|
trHead.addView(TextView(this).also { labelTdd ->
|
||||||
labelTdd.text = rh.gs(R.string.tdd)
|
labelTdd.text = rh.gs(R.string.tdd)
|
||||||
labelTdd.setTextColor(Color.WHITE)
|
labelTdd.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
trHead.addView(TextView(this).also { labelRatio ->
|
trHead.addView(TextView(this).also { labelRatio ->
|
||||||
labelRatio.text = rh.gs(R.string.ratio)
|
labelRatio.text = rh.gs(R.string.ratio)
|
||||||
labelRatio.setTextColor(Color.WHITE)
|
labelRatio.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
}, TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
}, TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
||||||
)
|
)
|
||||||
|
@ -117,19 +117,19 @@ class TDDStatsActivity : NoSplashAppCompatActivity() {
|
||||||
// cumulative table
|
// cumulative table
|
||||||
binding.cumulativeTable.addView(
|
binding.cumulativeTable.addView(
|
||||||
TableRow(this).also { ctrHead ->
|
TableRow(this).also { ctrHead ->
|
||||||
ctrHead.setBackgroundColor(Color.DKGRAY)
|
ctrHead.setBackgroundColor(rh.gac(this, R.attr.tddHeaderBackground))
|
||||||
ctrHead.layoutParams = TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
ctrHead.layoutParams = TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
||||||
ctrHead.addView(TextView(this).also { labelCumAmountDays ->
|
ctrHead.addView(TextView(this).also { labelCumAmountDays ->
|
||||||
labelCumAmountDays.text = rh.gs(R.string.amount_days)
|
labelCumAmountDays.text = rh.gs(R.string.amount_days)
|
||||||
labelCumAmountDays.setTextColor(Color.WHITE)
|
labelCumAmountDays.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
ctrHead.addView(TextView(this).also { labelCumTdd ->
|
ctrHead.addView(TextView(this).also { labelCumTdd ->
|
||||||
labelCumTdd.text = rh.gs(R.string.tdd)
|
labelCumTdd.text = rh.gs(R.string.tdd)
|
||||||
labelCumTdd.setTextColor(Color.WHITE)
|
labelCumTdd.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
ctrHead.addView(TextView(this).also { labelCumRatio ->
|
ctrHead.addView(TextView(this).also { labelCumRatio ->
|
||||||
labelCumRatio.text = rh.gs(R.string.ratio)
|
labelCumRatio.text = rh.gs(R.string.ratio)
|
||||||
labelCumRatio.setTextColor(Color.WHITE)
|
labelCumRatio.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
}, TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
}, TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
||||||
)
|
)
|
||||||
|
@ -137,19 +137,19 @@ class TDDStatsActivity : NoSplashAppCompatActivity() {
|
||||||
// exponential table
|
// exponential table
|
||||||
binding.expweightTable.addView(
|
binding.expweightTable.addView(
|
||||||
TableRow(this).also { etrHead ->
|
TableRow(this).also { etrHead ->
|
||||||
etrHead.setBackgroundColor(Color.DKGRAY)
|
etrHead.setBackgroundColor(rh.gac(this, R.attr.tddHeaderBackground))
|
||||||
etrHead.layoutParams = TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
etrHead.layoutParams = TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
||||||
etrHead.addView(TextView(this).also { labelExpWeight ->
|
etrHead.addView(TextView(this).also { labelExpWeight ->
|
||||||
labelExpWeight.text = rh.gs(R.string.weight)
|
labelExpWeight.text = rh.gs(R.string.weight)
|
||||||
labelExpWeight.setTextColor(Color.WHITE)
|
labelExpWeight.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
etrHead.addView(TextView(this).also { labelExpTdd ->
|
etrHead.addView(TextView(this).also { labelExpTdd ->
|
||||||
labelExpTdd.text = rh.gs(R.string.tdd)
|
labelExpTdd.text = rh.gs(R.string.tdd)
|
||||||
labelExpTdd.setTextColor(Color.WHITE)
|
labelExpTdd.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
etrHead.addView(TextView(this).also { labelExpRatio ->
|
etrHead.addView(TextView(this).also { labelExpRatio ->
|
||||||
labelExpRatio.text = rh.gs(R.string.ratio)
|
labelExpRatio.text = rh.gs(R.string.ratio)
|
||||||
labelExpRatio.setTextColor(Color.WHITE)
|
labelExpRatio.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
}, TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
}, TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
||||||
)
|
)
|
||||||
|
@ -285,9 +285,9 @@ class TDDStatsActivity : NoSplashAppCompatActivity() {
|
||||||
// Create the table row
|
// Create the table row
|
||||||
binding.mainTable.addView(
|
binding.mainTable.addView(
|
||||||
TableRow(this@TDDStatsActivity).also { tr ->
|
TableRow(this@TDDStatsActivity).also { tr ->
|
||||||
if (i % 2 != 0) tr.setBackgroundColor(Color.DKGRAY)
|
if (i % 2 != 0) tr.setBackgroundColor(rh.gac(this, R.attr.tddHeaderBackground))
|
||||||
if (dummies.contains(record))
|
if (dummies.contains(record))
|
||||||
tr.setBackgroundColor(Color.argb(125, 255, 0, 0))
|
tr.setBackgroundColor(rh.gac(this, R.attr.dummyBackground))
|
||||||
|
|
||||||
tr.id = 100 + i
|
tr.id = 100 + i
|
||||||
tr.layoutParams = TableLayout.LayoutParams(
|
tr.layoutParams = TableLayout.LayoutParams(
|
||||||
|
@ -299,27 +299,27 @@ class TDDStatsActivity : NoSplashAppCompatActivity() {
|
||||||
tr.addView(TextView(this@TDDStatsActivity).also { labelDATE ->
|
tr.addView(TextView(this@TDDStatsActivity).also { labelDATE ->
|
||||||
labelDATE.id = 200 + i
|
labelDATE.id = 200 + i
|
||||||
labelDATE.text = df1.format(Date(record.timestamp))
|
labelDATE.text = df1.format(Date(record.timestamp))
|
||||||
labelDATE.setTextColor(Color.WHITE)
|
labelDATE.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
tr.addView(TextView(this@TDDStatsActivity).also { labelBASAL ->
|
tr.addView(TextView(this@TDDStatsActivity).also { labelBASAL ->
|
||||||
labelBASAL.id = 300 + i
|
labelBASAL.id = 300 + i
|
||||||
labelBASAL.text = rh.gs(R.string.formatinsulinunits, record.basalAmount)
|
labelBASAL.text = rh.gs(R.string.formatinsulinunits, record.basalAmount)
|
||||||
labelBASAL.setTextColor(Color.WHITE)
|
labelBASAL.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
tr.addView(TextView(this@TDDStatsActivity).also { labelBOLUS ->
|
tr.addView(TextView(this@TDDStatsActivity).also { labelBOLUS ->
|
||||||
labelBOLUS.id = 400 + i
|
labelBOLUS.id = 400 + i
|
||||||
labelBOLUS.text = rh.gs(R.string.formatinsulinunits, record.bolusAmount)
|
labelBOLUS.text = rh.gs(R.string.formatinsulinunits, record.bolusAmount)
|
||||||
labelBOLUS.setTextColor(Color.WHITE)
|
labelBOLUS.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
tr.addView(TextView(this@TDDStatsActivity).also { labelTDD ->
|
tr.addView(TextView(this@TDDStatsActivity).also { labelTDD ->
|
||||||
labelTDD.id = 500 + i
|
labelTDD.id = 500 + i
|
||||||
labelTDD.text = rh.gs(R.string.formatinsulinunits, tdd)
|
labelTDD.text = rh.gs(R.string.formatinsulinunits, tdd)
|
||||||
labelTDD.setTextColor(Color.WHITE)
|
labelTDD.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
tr.addView(TextView(this@TDDStatsActivity).also { labelRATIO ->
|
tr.addView(TextView(this@TDDStatsActivity).also { labelRATIO ->
|
||||||
labelRATIO.id = 600 + i
|
labelRATIO.id = 600 + i
|
||||||
labelRATIO.text = (100 * tdd / magicNumber).roundToInt().toString() + "%"
|
labelRATIO.text = (100 * tdd / magicNumber).roundToInt().toString() + "%"
|
||||||
labelRATIO.setTextColor(Color.WHITE)
|
labelRATIO.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
}, TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
}, TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
||||||
)
|
)
|
||||||
|
@ -338,7 +338,7 @@ class TDDStatsActivity : NoSplashAppCompatActivity() {
|
||||||
// Create the cumulative table row
|
// Create the cumulative table row
|
||||||
binding.cumulativeTable.addView(
|
binding.cumulativeTable.addView(
|
||||||
TableRow(this@TDDStatsActivity).also { ctr ->
|
TableRow(this@TDDStatsActivity).also { ctr ->
|
||||||
if (i % 2 == 0) ctr.setBackgroundColor(Color.DKGRAY)
|
if (i % 2 == 0) ctr.setBackgroundColor(rh.gac(this, R.attr.tddHeaderBackground))
|
||||||
ctr.id = 700 + i
|
ctr.id = 700 + i
|
||||||
ctr.layoutParams = TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
ctr.layoutParams = TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
||||||
|
|
||||||
|
@ -346,19 +346,19 @@ class TDDStatsActivity : NoSplashAppCompatActivity() {
|
||||||
ctr.addView(TextView(this@TDDStatsActivity).also { labelDAYS ->
|
ctr.addView(TextView(this@TDDStatsActivity).also { labelDAYS ->
|
||||||
labelDAYS.id = 800 + i
|
labelDAYS.id = 800 + i
|
||||||
labelDAYS.text = i.toString()
|
labelDAYS.text = i.toString()
|
||||||
labelDAYS.setTextColor(Color.WHITE)
|
labelDAYS.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
|
|
||||||
ctr.addView(TextView(this@TDDStatsActivity).also { labelCUMTDD ->
|
ctr.addView(TextView(this@TDDStatsActivity).also { labelCUMTDD ->
|
||||||
labelCUMTDD.id = 900 + i
|
labelCUMTDD.id = 900 + i
|
||||||
labelCUMTDD.text = rh.gs(R.string.formatinsulinunits, sum / i)
|
labelCUMTDD.text = rh.gs(R.string.formatinsulinunits, sum / i)
|
||||||
labelCUMTDD.setTextColor(Color.WHITE)
|
labelCUMTDD.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
|
|
||||||
ctr.addView(TextView(this@TDDStatsActivity).also { labelCUMRATIO ->
|
ctr.addView(TextView(this@TDDStatsActivity).also { labelCUMRATIO ->
|
||||||
labelCUMRATIO.id = 1000 + i
|
labelCUMRATIO.id = 1000 + i
|
||||||
labelCUMRATIO.text = (100 * sum / i / magicNumber).roundToInt().toString() + "%"
|
labelCUMRATIO.text = (100 * sum / i / magicNumber).roundToInt().toString() + "%"
|
||||||
labelCUMRATIO.setTextColor(Color.WHITE)
|
labelCUMRATIO.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
}, TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
}, TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
||||||
)
|
)
|
||||||
|
@ -366,7 +366,7 @@ class TDDStatsActivity : NoSplashAppCompatActivity() {
|
||||||
if (isOldData(historyList) && activePlugin.activePump.pumpDescription.needsManualTDDLoad) {
|
if (isOldData(historyList) && activePlugin.activePump.pumpDescription.needsManualTDDLoad) {
|
||||||
binding.message.visibility = View.VISIBLE
|
binding.message.visibility = View.VISIBLE
|
||||||
binding.message.text = rh.gs(R.string.olddata_Message)
|
binding.message.text = rh.gs(R.string.olddata_Message)
|
||||||
} else binding.mainTable.setBackgroundColor(Color.TRANSPARENT)
|
} else binding.mainTable.setBackgroundColor(rh.gac(this, R.attr.mainTableBackground))
|
||||||
if (historyList.isNotEmpty() && df1.format(Date(historyList[0].timestamp)) == df1.format(Date())) {
|
if (historyList.isNotEmpty() && df1.format(Date(historyList[0].timestamp)) == df1.format(Date())) {
|
||||||
//Today should not be included
|
//Today should not be included
|
||||||
historyList.removeAt(0)
|
historyList.removeAt(0)
|
||||||
|
@ -390,7 +390,7 @@ class TDDStatsActivity : NoSplashAppCompatActivity() {
|
||||||
// Create the exponential table row
|
// Create the exponential table row
|
||||||
binding.expweightTable.addView(
|
binding.expweightTable.addView(
|
||||||
TableRow(this@TDDStatsActivity).also { etr ->
|
TableRow(this@TDDStatsActivity).also { etr ->
|
||||||
if (i % 2 != 0) etr.setBackgroundColor(Color.DKGRAY)
|
if (i % 2 != 0) etr.setBackgroundColor(rh.gac(this, R.attr.tddHeaderBackground))
|
||||||
etr.id = 1100 + i
|
etr.id = 1100 + i
|
||||||
etr.layoutParams = TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
etr.layoutParams = TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ class TDDStatsActivity : NoSplashAppCompatActivity() {
|
||||||
etr.addView(TextView(this@TDDStatsActivity).also { labelWEIGHT ->
|
etr.addView(TextView(this@TDDStatsActivity).also { labelWEIGHT ->
|
||||||
labelWEIGHT.id = 1200 + i
|
labelWEIGHT.id = 1200 + i
|
||||||
labelWEIGHT.text = "0.3\n0.5\n0.7"
|
labelWEIGHT.text = "0.3\n0.5\n0.7"
|
||||||
labelWEIGHT.setTextColor(Color.WHITE)
|
labelWEIGHT.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
etr.addView(TextView(this@TDDStatsActivity).also { labelEXPTDD ->
|
etr.addView(TextView(this@TDDStatsActivity).also { labelEXPTDD ->
|
||||||
labelEXPTDD.id = 1300 + i
|
labelEXPTDD.id = 1300 + i
|
||||||
|
@ -407,7 +407,7 @@ class TDDStatsActivity : NoSplashAppCompatActivity() {
|
||||||
${rh.gs(R.string.formatinsulinunits, weighted05)}
|
${rh.gs(R.string.formatinsulinunits, weighted05)}
|
||||||
${rh.gs(R.string.formatinsulinunits, weighted07)}
|
${rh.gs(R.string.formatinsulinunits, weighted07)}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
labelEXPTDD.setTextColor(Color.WHITE)
|
labelEXPTDD.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
etr.addView(TextView(this@TDDStatsActivity).also { labelEXPRATIO ->
|
etr.addView(TextView(this@TDDStatsActivity).also { labelEXPRATIO ->
|
||||||
labelEXPRATIO.id = 1400 + i
|
labelEXPRATIO.id = 1400 + i
|
||||||
|
@ -416,7 +416,7 @@ class TDDStatsActivity : NoSplashAppCompatActivity() {
|
||||||
${(100 * weighted05 / magicNumber).roundToInt()}%
|
${(100 * weighted05 / magicNumber).roundToInt()}%
|
||||||
${(100 * weighted07 / magicNumber).roundToInt()}%
|
${(100 * weighted07 / magicNumber).roundToInt()}%
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
labelEXPRATIO.setTextColor(Color.WHITE)
|
labelEXPRATIO.setTextColor(rh.gac(this, R.attr.defaultTextColor))
|
||||||
})
|
})
|
||||||
}, TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
}, TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)
|
||||||
)
|
)
|
||||||
|
|
|
@ -87,8 +87,8 @@ class PrefImportListActivity : DaggerAppCompatActivity() {
|
||||||
|
|
||||||
prefFile.metadata[PrefsMetadataKey.AAPS_FLAVOUR]?.let {
|
prefFile.metadata[PrefsMetadataKey.AAPS_FLAVOUR]?.let {
|
||||||
metaVariantFormat.text = it.value
|
metaVariantFormat.text = it.value
|
||||||
val color = if (it.status == PrefsStatus.OK) R.color.metadataOk else R.color.metadataTextWarning
|
val colorattr = if (it.status == PrefsStatus.OK) R.attr.metadataTextOkColor else R.attr.metadataTextWarningColor
|
||||||
metaVariantFormat.setTextColor(rh.gc(color))
|
metaVariantFormat.setTextColor(rh.gac( metaVariantFormat.context, colorattr))
|
||||||
}
|
}
|
||||||
|
|
||||||
prefFile.metadata[PrefsMetadataKey.CREATED_AT]?.let {
|
prefFile.metadata[PrefsMetadataKey.CREATED_AT]?.let {
|
||||||
|
@ -97,8 +97,8 @@ class PrefImportListActivity : DaggerAppCompatActivity() {
|
||||||
|
|
||||||
prefFile.metadata[PrefsMetadataKey.AAPS_VERSION]?.let {
|
prefFile.metadata[PrefsMetadataKey.AAPS_VERSION]?.let {
|
||||||
metaAppVersion.text = it.value
|
metaAppVersion.text = it.value
|
||||||
val color = if (it.status == PrefsStatus.OK) R.color.metadataOk else R.color.metadataTextWarning
|
val colorattr = if (it.status == PrefsStatus.OK) R.attr.metadataTextOkColor else R.attr.metadataTextWarningColor
|
||||||
metaAppVersion.setTextColor(rh.gc(color))
|
metaAppVersion.setTextColor(rh.gac( metaVariantFormat.context, colorattr))
|
||||||
}
|
}
|
||||||
|
|
||||||
prefFile.metadata[PrefsMetadataKey.DEVICE_NAME]?.let {
|
prefFile.metadata[PrefsMetadataKey.DEVICE_NAME]?.let {
|
||||||
|
|
|
@ -5,5 +5,5 @@
|
||||||
android:viewportHeight="24">
|
android:viewportHeight="24">
|
||||||
<path
|
<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: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="@color/white"/>
|
android:fillColor="?attr/icCheckboxTrendColor"/>
|
||||||
</vector>
|
</vector>
|
||||||
|
|
|
@ -179,7 +179,7 @@
|
||||||
|
|
||||||
<info.nightscout.androidaps.utils.ui.SingleClickButton
|
<info.nightscout.androidaps.utils.ui.SingleClickButton
|
||||||
android:id="@+id/reload"
|
android:id="@+id/reload"
|
||||||
style="@style/ButtonSmallFontStyle"
|
style="?android:attr/buttonStyle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
<color name="mdtp_line_dark">#808080</color>
|
<color name="mdtp_line_dark">#808080</color>
|
||||||
<color name="colorLightGray">#d8d8d8</color>
|
<color name="colorLightGray">#d8d8d8</color>
|
||||||
<color name="cardColorBackground">#212121</color>
|
<color name="cardColorBackground">#212121</color>
|
||||||
<color name="black_overlay">#66000000</color>
|
|
||||||
<color name="gray">#BBBBBB</color>
|
<color name="gray">#BBBBBB</color>
|
||||||
<color name="black">#FF000000</color>
|
<color name="black">#FF000000</color>
|
||||||
<color name="white">#FFFFFFFF</color>
|
<color name="white">#FFFFFFFF</color>
|
||||||
|
@ -172,6 +171,7 @@
|
||||||
<color name="info">#77dd77</color>
|
<color name="info">#77dd77</color>
|
||||||
<color name="error_background">#66FC0000</color>
|
<color name="error_background">#66FC0000</color>
|
||||||
<color name="ok_background">@color/colorPrimaryDark</color>
|
<color name="ok_background">@color/colorPrimaryDark</color>
|
||||||
|
<color name="dummy_background">#7DFF0000</color>
|
||||||
|
|
||||||
<color name="tempTargetBackground">#77dd77</color>
|
<color name="tempTargetBackground">#77dd77</color>
|
||||||
<color name="exercise">#67DFE8</color>
|
<color name="exercise">#67DFE8</color>
|
||||||
|
|
|
@ -155,6 +155,20 @@
|
||||||
<item name="warnColor">@color/omni_yellow</item>
|
<item name="warnColor">@color/omni_yellow</item>
|
||||||
<item name="urgentColor">@color/alarm</item>
|
<item name="urgentColor">@color/alarm</item>
|
||||||
|
|
||||||
|
<!---Automation -->
|
||||||
|
<item name="userAction">@color/mdtp_line_dark</item>
|
||||||
|
<item name="validActions">@color/ribbonDefault</item>
|
||||||
|
<item name="actionsError">@color/errorAlertBackground</item>
|
||||||
|
<item name="automationBackgroundColor">@color/black</item>
|
||||||
|
<item name="automationOverlayColor">@color/black_alpha_40</item>
|
||||||
|
<!---BG source -->
|
||||||
|
<item name="bgsourceError">@color/errorAlertBackground</item>
|
||||||
|
<!---TDD-statistics -->
|
||||||
|
<item name="tddHeaderBackground">@android:color/darker_gray</item>
|
||||||
|
<item name="mainTableBackground">@android:color/transparent</item>
|
||||||
|
<item name="dummyBackground">@color/dummy_background</item>
|
||||||
|
<!-- Icon Colors -->
|
||||||
|
<item name="icCheckboxTrendColor">@color/white</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.MaterialComponents.DayNight.DarkActionBar" parent="Theme.MaterialComponents.DayNight.Bridge"/>
|
<style name="Theme.MaterialComponents.DayNight.DarkActionBar" parent="Theme.MaterialComponents.DayNight.Bridge"/>
|
||||||
|
|
|
@ -129,4 +129,18 @@
|
||||||
<attr name="omniGreenColor" format="reference|color" />
|
<attr name="omniGreenColor" format="reference|color" />
|
||||||
<attr name="omniGrayColor" format="reference|color" />
|
<attr name="omniGrayColor" format="reference|color" />
|
||||||
<attr name="omniWizardFinishButtonColor" format="reference|color" />
|
<attr name="omniWizardFinishButtonColor" format="reference|color" />
|
||||||
|
<!---Automation -->
|
||||||
|
<attr name="userAction" format="reference|color" />
|
||||||
|
<attr name="validActions" format="reference|color" />
|
||||||
|
<attr name="actionsError" format="reference|color" />
|
||||||
|
<attr name="automationBackgroundColor" format="reference|color" />
|
||||||
|
<attr name="automationOverlayColor" format="reference|color" />
|
||||||
|
<!---BG source -->
|
||||||
|
<attr name="bgsourceError" format="reference|color" />
|
||||||
|
<!---TDD-statistics -->
|
||||||
|
<attr name="tddHeaderBackground" format="reference|color" />
|
||||||
|
<attr name="mainTableBackground" format="reference|color" />
|
||||||
|
<attr name="dummyBackground" format="reference|color" />
|
||||||
|
<!-- Icon Colors -->
|
||||||
|
<attr name="icCheckboxTrendColor" format="reference|color" />
|
||||||
</resources>
|
</resources>
|
|
@ -9,7 +9,6 @@
|
||||||
<color name="mdtp_line_dark">#808080</color>
|
<color name="mdtp_line_dark">#808080</color>
|
||||||
<color name="colorLightGray">#d8d8d8</color>
|
<color name="colorLightGray">#d8d8d8</color>
|
||||||
<color name="cardColorBackground">@color/lightgray</color>
|
<color name="cardColorBackground">@color/lightgray</color>
|
||||||
<color name="black_overlay">#66000000</color>
|
|
||||||
<color name="gray">#BBBBBB</color>
|
<color name="gray">#BBBBBB</color>
|
||||||
<color name="black">#FF000000</color>
|
<color name="black">#FF000000</color>
|
||||||
<color name="white">#FFFFFFFF</color>
|
<color name="white">#FFFFFFFF</color>
|
||||||
|
@ -173,6 +172,7 @@
|
||||||
<color name="info">#77dd77</color>
|
<color name="info">#77dd77</color>
|
||||||
<color name="error_background">#66FC0000</color>
|
<color name="error_background">#66FC0000</color>
|
||||||
<color name="ok_background">@color/white</color>
|
<color name="ok_background">@color/white</color>
|
||||||
|
<color name="dummy_background">#7DFF0000</color>
|
||||||
|
|
||||||
<color name="tempTargetBackground">#77dd77</color>
|
<color name="tempTargetBackground">#77dd77</color>
|
||||||
<color name="exercise">#67DFE8</color>
|
<color name="exercise">#67DFE8</color>
|
||||||
|
@ -273,4 +273,17 @@
|
||||||
<color name="ic_pod_management_rl_stats">@color/rl_board_shape</color>
|
<color name="ic_pod_management_rl_stats">@color/rl_board_shape</color>
|
||||||
<color name="ic_pod_management_rl_stats_outline">@color/rl_icon_outline</color>
|
<color name="ic_pod_management_rl_stats_outline">@color/rl_icon_outline</color>
|
||||||
|
|
||||||
|
<!---Example light theme colors -->
|
||||||
|
<color name="aaps_theme_light_primary">#1D5FA5</color>
|
||||||
|
<color name="aaps_theme_light_onPrimary">#FFFFFF</color>
|
||||||
|
<color name="aaps_theme_light_secondary">#5954A8</color>
|
||||||
|
<color name="aaps_theme_light_onSecondary">#FFFFFF</color>
|
||||||
|
<color name="aaps_theme_light_error">#B3261E</color>
|
||||||
|
<color name="aaps_theme_light_onError">#FFFFFF</color>
|
||||||
|
<color name="aaps_theme_light_background">#FFFBFE</color>
|
||||||
|
<color name="aaps_theme_light_onBackground">#1C1B1F</color>
|
||||||
|
<color name="aaps_theme_light_surface">#FFFBFE</color>
|
||||||
|
<color name="aaps_theme_light_onSurface">#1C1B1F</color>
|
||||||
|
<color name="aaps_theme_light_surfaceVariant">#E7E0EC</color>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -2,22 +2,26 @@
|
||||||
<resources xmlns:ns2="http://schemas.android.com/tools">
|
<resources xmlns:ns2="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
|
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
<!---Example light theme colors -->
|
||||||
|
<item name="colorPrimary">@color/lightSandGray</item>
|
||||||
|
<item name="colorOnPrimary">@color/aaps_theme_light_onPrimary</item>
|
||||||
|
<item name="colorSecondary">@color/aaps_theme_light_secondary</item>
|
||||||
|
<item name="colorOnSecondary">@color/aaps_theme_light_onSecondary</item>
|
||||||
|
<item name="colorError">@color/aaps_theme_light_error</item>
|
||||||
|
<item name="colorOnError">@color/aaps_theme_light_onError</item>
|
||||||
|
<item name="android:colorBackground">@color/aaps_theme_light_background</item>
|
||||||
|
<item name="colorOnBackground">@color/aaps_theme_light_onBackground</item>
|
||||||
|
<item name="colorSurface">@color/aaps_theme_light_surface</item>
|
||||||
|
<item name="colorOnSurface">@color/aaps_theme_light_onSurface</item>
|
||||||
|
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
<item name="colorAccent">@android:color/holo_blue_light</item>
|
<item name="colorAccent">@color/aaps_theme_light_secondary</item>
|
||||||
<item name="dialogTitleBackground">@color/dialog_title_background</item>
|
<item name="dialogTitleBackground">@color/dialog_title_background</item>
|
||||||
<item name="dialogTitleColor">@color/dialog_title_color</item>
|
<item name="dialogTitleColor">@color/dialog_title_color</item>
|
||||||
<item name="dialogTitleIconTint">@color/dialog_title_icon_tint</item>
|
<item name="dialogTitleIconTint">@color/dialog_title_icon_tint</item>
|
||||||
<!-- New MaterialComponents attributes. -->
|
<!-- New MaterialComponents attributes. -->
|
||||||
<item name="colorSecondary">@android:color/holo_blue_light</item>
|
|
||||||
<item name="colorPrimaryVariant">@color/primaryLightColorDefault</item>
|
<item name="colorPrimaryVariant">@color/primaryLightColorDefault</item>
|
||||||
<item name="colorSecondaryVariant">@color/secondaryLightColorDefault</item>
|
<item name="colorSecondaryVariant">@color/secondaryLightColorDefault</item>
|
||||||
<item name="colorOnPrimary">@color/primaryTextColorDefault</item>
|
|
||||||
<item name="colorSurface">@color/white</item>
|
|
||||||
<item name="colorOnSurface">@color/gray</item>
|
|
||||||
<item name="colorOnSecondary">@color/black</item>
|
|
||||||
<item name="colorOnBackground">@color/white</item>
|
|
||||||
<item name="colorOnError">@color/black</item>
|
|
||||||
<item name="scrimBackground">@color/white</item>
|
<item name="scrimBackground">@color/white</item>
|
||||||
<item name="popupMenuStyle">@style/Widget.MaterialComponents.PopupMenu</item>
|
<item name="popupMenuStyle">@style/Widget.MaterialComponents.PopupMenu</item>
|
||||||
<item name="actionOverflowMenuStyle">@style/Widget.MaterialComponents.PopupMenu.Overflow</item>
|
<item name="actionOverflowMenuStyle">@style/Widget.MaterialComponents.PopupMenu.Overflow</item>
|
||||||
|
@ -120,7 +124,7 @@
|
||||||
<item name="viewPortbackgroundColor">@color/white_alpha_20</item>
|
<item name="viewPortbackgroundColor">@color/white_alpha_20</item>
|
||||||
<item name="tempTargetBackgroundColor">@color/tempTargetBackground</item>
|
<item name="tempTargetBackgroundColor">@color/tempTargetBackground</item>
|
||||||
<!---CGM source-->
|
<!---CGM source-->
|
||||||
<item name="cgmdexColor">@color/colorLightGray</item>
|
<item name="cgmdexColor">@color/mdtp_line_dark</item>
|
||||||
<item name="cgmxdripColor">@color/colorCalibrationButton</item>
|
<item name="cgmxdripColor">@color/colorCalibrationButton</item>
|
||||||
<!---BG color-->
|
<!---BG color-->
|
||||||
<item name="bgLow">@color/low</item>
|
<item name="bgLow">@color/low</item>
|
||||||
|
@ -153,6 +157,21 @@
|
||||||
<!---Warning Colors : WarnColors.kt-->
|
<!---Warning Colors : WarnColors.kt-->
|
||||||
<item name="warnColor">@color/high</item>
|
<item name="warnColor">@color/high</item>
|
||||||
<item name="urgentColor">@color/alarm</item>
|
<item name="urgentColor">@color/alarm</item>
|
||||||
|
<!---Automation -->
|
||||||
|
<item name="userAction">@color/mdtp_line_dark</item>
|
||||||
|
<item name="validActions">@color/ribbonDefault</item>
|
||||||
|
<item name="actionsError">@color/errorAlertBackground</item>
|
||||||
|
<item name="automationBackgroundColor">@color/black</item>
|
||||||
|
<item name="automationOverlayColor">@color/black_alpha_40</item>
|
||||||
|
<!---BG source -->
|
||||||
|
<item name="bgsourceError">@color/errorAlertBackground</item>
|
||||||
|
<!---TDD-statistics -->
|
||||||
|
<item name="tddHeaderBackground">@android:color/darker_gray</item>
|
||||||
|
<item name="mainTableBackground">@android:color/transparent</item>
|
||||||
|
<item name="dummyBackground">@color/dummy_background</item>
|
||||||
|
<!-- Icon Colors -->
|
||||||
|
<!-- Trend Arrow -->
|
||||||
|
<item name="icCheckboxTrendColor">@color/black</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.MaterialComponents.DayNight.DarkActionBar" parent="Theme.MaterialComponents.DayNight.Bridge"/>
|
<style name="Theme.MaterialComponents.DayNight.DarkActionBar" parent="Theme.MaterialComponents.DayNight.Bridge"/>
|
||||||
|
|
Loading…
Reference in a new issue