make deliveryStatus engineering mode only

This commit is contained in:
AdrianLxM 2021-07-31 13:34:35 +02:00
parent 5f22d0ba89
commit b6d41e7d73
3 changed files with 54 additions and 54 deletions

View file

@ -3,27 +3,10 @@
<option name="AUTODETECT_INDENTS" value="false" />
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="true" />
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value>
<package name="java.util" alias="false" withSubpackages="false" />
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
<package name="io.ktor" alias="false" withSubpackages="true" />
</value>
</option>
<option name="PACKAGES_IMPORT_LAYOUT">
<value>
<package name="" alias="false" withSubpackages="true" />
<package name="java" alias="false" withSubpackages="true" />
<package name="javax" alias="false" withSubpackages="true" />
<package name="kotlin" alias="false" withSubpackages="true" />
<package name="" alias="true" withSubpackages="true" />
</value>
</option>
<option name="ALIGN_IN_COLUMNS_CASE_BRANCH" value="true" />
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="6" />
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="6" />
<option name="BLANK_LINES_AROUND_BLOCK_WHEN_BRANCHES" value="1" />
<option name="WRAP_EXPRESSION_BODY_FUNCTIONS" value="1" />
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="JAVA">
@ -143,8 +126,8 @@
</arrangement>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="RIGHT_MARGIN" value="120" />
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
<option name="RIGHT_MARGIN" value="120" />
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="LINE_COMMENT_ADD_SPACE" value="true" />
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
@ -152,13 +135,6 @@
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="5" />
<option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="CALL_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="5" />
<option name="METHOD_ANNOTATION_WRAP" value="5" />
<option name="CLASS_ANNOTATION_WRAP" value="1" />

View file

@ -167,6 +167,9 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
.messageOnSuccess(resourceHelper.gs(R.string.omnipod_common_confirmation_time_on_pod_updated))
)
}
if (buildHelper.isEngineeringMode()) {
bluetoothStatusBinding.deliveryStatus.visibility = View.VISIBLE
}
}
override fun onResume() {
@ -238,7 +241,8 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
val connectionSuccessPercentage = podStateManager.connectionSuccessRatio() * 100
val successPercentageString = String.format("%.2f %", podStateManager.connectionSuccessRatio())
val connectionQuality = "${podStateManager.successfulConnections}/${podStateManager.connectionAttempts} :: $successPercentageString"
val connectionQuality =
"${podStateManager.successfulConnections}/${podStateManager.connectionAttempts} :: $successPercentageString"
bluetoothStatusBinding.omnipodDashBluetoothConnectionQuality.text = connectionQuality
val connectionStatsColor = when {
connectionSuccessPercentage > 90 ->
@ -334,7 +338,8 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
}
// base basal rate
podInfoBinding.baseBasalRate.text = if (podStateManager.basalProgram != null && !podStateManager.isSuspended) {
podInfoBinding.baseBasalRate.text =
if (podStateManager.basalProgram != null && !podStateManager.isSuspended) {
resourceHelper.gs(
R.string.pump_basebasalrate,
omnipodDashPumpPlugin.model()
@ -637,7 +642,10 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
}
seconds < 60 * 60 -> { // < 1 hour
return resourceHelper.gs(R.string.omnipod_common_time_ago, resourceHelper.gq(R.plurals.omnipod_common_minutes, minutes, minutes))
return resourceHelper.gs(
R.string.omnipod_common_time_ago,
resourceHelper.gq(R.plurals.omnipod_common_minutes, minutes, minutes)
)
}
seconds < 24 * 60 * 60 -> { // < 1 day
@ -645,9 +653,16 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
if (minutesLeft > 0)
return resourceHelper.gs(
R.string.omnipod_common_time_ago,
resourceHelper.gs(R.string.omnipod_common_composite_time, resourceHelper.gq(R.plurals.omnipod_common_hours, hours, hours), resourceHelper.gq(R.plurals.omnipod_common_minutes, minutesLeft, minutesLeft))
resourceHelper.gs(
R.string.omnipod_common_composite_time,
resourceHelper.gq(R.plurals.omnipod_common_hours, hours, hours),
resourceHelper.gq(R.plurals.omnipod_common_minutes, minutesLeft, minutesLeft)
)
)
return resourceHelper.gs(
R.string.omnipod_common_time_ago,
resourceHelper.gq(R.plurals.omnipod_common_hours, hours, hours)
)
return resourceHelper.gs(R.string.omnipod_common_time_ago, resourceHelper.gq(R.plurals.omnipod_common_hours, hours, hours))
}
else -> {
@ -656,9 +671,16 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
if (hoursLeft > 0)
return resourceHelper.gs(
R.string.omnipod_common_time_ago,
resourceHelper.gs(R.string.omnipod_common_composite_time, resourceHelper.gq(R.plurals.omnipod_common_days, days, days), resourceHelper.gq(R.plurals.omnipod_common_hours, hoursLeft, hoursLeft))
resourceHelper.gs(
R.string.omnipod_common_composite_time,
resourceHelper.gq(R.plurals.omnipod_common_days, days, days),
resourceHelper.gq(R.plurals.omnipod_common_hours, hoursLeft, hoursLeft)
)
)
return resourceHelper.gs(
R.string.omnipod_common_time_ago,
resourceHelper.gq(R.plurals.omnipod_common_days, days, days)
)
return resourceHelper.gs(R.string.omnipod_common_time_ago, resourceHelper.gq(R.plurals.omnipod_common_days, days, days))
}
}
}

View file

@ -118,9 +118,11 @@
</LinearLayout>
<LinearLayout
android:id="@+id/deliveryStatus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:orientation="horizontal"
android:visibility="gone">
<TextView
android:layout_width="match_parent"