Skip to content

Commit

Permalink
hide "only chargers along driving direction" option for Car App API l…
Browse files Browse the repository at this point in the history
…evel 7
  • Loading branch information
johan12345 committed Jun 30, 2024
1 parent ad15cae commit b0e84c5
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions app/src/main/java/net/vonforst/evmap/auto/SettingsScreens.kt
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,25 @@ class SettingsScreen(ctx: CarContext, val session: EVMapSession) : Screen(ctx) {
}
.build()
)
addItem(
Row.Builder()
.setTitle(carContext.getString(R.string.auto_chargers_ahead))
.setToggle(Toggle.Builder {
prefs.showChargersAheadAndroidAuto = it
}.setChecked(prefs.showChargersAheadAndroidAuto).build())
.setImage(
CarIcon.Builder(
IconCompat.createWithResource(
carContext,
R.drawable.ic_navigation
)
).setTint(CarColor.DEFAULT).build()
)
.build()
)
if (carContext.carAppApiLevel < 7 || !carContext.isAppDrivenRefreshSupported) {
// this option is only supported in LegacyMapScreen
addItem(
Row.Builder()
.setTitle(carContext.getString(R.string.auto_chargers_ahead))
.setToggle(Toggle.Builder {
prefs.showChargersAheadAndroidAuto = it
}.setChecked(prefs.showChargersAheadAndroidAuto).build())
.setImage(
CarIcon.Builder(
IconCompat.createWithResource(
carContext,
R.drawable.ic_navigation
)
).setTint(CarColor.DEFAULT).build()
)
.build()
)
}
}
addItem(
Row.Builder()
Expand Down

0 comments on commit b0e84c5

Please sign in to comment.