Skip to content

Commit

Permalink
UI fixes for chargers with unknown power
Browse files Browse the repository at this point in the history
  • Loading branch information
johan12345 committed Aug 16, 2024
1 parent 520d753 commit 5130b93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ data class ChargeLocation(

fun formatChargepoints(sp: StringProvider): String {
return chargepointsMerged.joinToString(" · ") {
"${it.count} × ${nameForPlugType(sp, it.type)} ${it.formatPower()}"
"${it.count} × ${nameForPlugType(sp, it.type)}${it.formatPower()?.let { " $it" } ?: ""}"
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout/dialog_connector_details_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@
android:layout_height="wrap_content"
android:layout_marginStart="36dp"
android:layout_marginTop="4dp"
android:text="@{item != null ? UtilsKt.nameForPlugType(ChargepointApiKt.stringProvider(context), item.chargepoint.type) + " · " + item.chargepoint.formatPower() : null}"
android:text="@{item != null ? UtilsKt.nameForPlugType(ChargepointApiKt.stringProvider(context), item.chargepoint.type) + (item.chargepoint.hasKnownPower() ? " · " + item.chargepoint.formatPower() : "") : null}"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
app:goneUnless="@{item.chargepoint.hasKnownPower()}"
app:layout_constraintBottom_toTopOf="@id/textView8"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/imageView"
Expand Down

0 comments on commit 5130b93

Please sign in to comment.