diff --git a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/data/BTDeviceInfo.kt b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/data/BTDeviceInfo.kt new file mode 100644 index 00000000000..bdbf723d539 --- /dev/null +++ b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/data/BTDeviceInfo.kt @@ -0,0 +1,9 @@ +package net.osmand.shared.data + +import net.osmand.shared.util.Localization + +data class BTDeviceInfo(val name: String, val address: String) { + companion object { + val UNKNOWN_DEVICE = BTDeviceInfo(Localization.getString("unknown_bt_device"), "") + } +} \ No newline at end of file diff --git a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDCommand.kt b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDCommand.kt index 0fb526e88e4..7b5f9f552a1 100644 --- a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDCommand.kt +++ b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDCommand.kt @@ -1,21 +1,24 @@ package net.osmand.shared.obd enum class OBDCommand( + val commandGroup: String, val command: String, private val responseParser: (String) -> String, - val isStale: Boolean = false) { - OBD_SUPPORTED_LIST1_COMMAND("00", OBDUtils::parseSupportedCommandsResponse, true), - OBD_SUPPORTED_LIST2_COMMAND("20", OBDUtils::parseSupportedCommandsResponse, true), - OBD_SUPPORTED_LIST3_COMMAND("40", OBDUtils::parseSupportedCommandsResponse, true), - OBD_BATTERY_VOLTAGE_COMMAND("42", OBDUtils::parseBatteryVoltageResponse), - OBD_AMBIENT_AIR_TEMPERATURE_COMMAND("46", OBDUtils::parseAmbientTempResponse), - OBD_RPM_COMMAND("0C", OBDUtils::parseRpmResponse), - OBD_SPEED_COMMAND("0D", OBDUtils::parseSpeedResponse), - OBD_AIR_INTAKE_TEMP_COMMAND("0F", OBDUtils::parseIntakeAirTempResponse), - OBD_ENGINE_COOLANT_TEMP_COMMAND("05", OBDUtils::parseEngineCoolantTempResponse), - OBD_FUEL_CONSUMPTION_RATE_COMMAND("5E", OBDUtils::parseFuelConsumptionRateResponse), - OBD_FUEL_TYPE_COMMAND("51", OBDUtils::parseFuelTypeResponse, true), - OBD_FUEL_LEVEL_COMMAND("2F", OBDUtils::parseFuelLevelResponse); + val isStale: Boolean = false, + val isMultiPartResponse: Boolean = false) { + OBD_SUPPORTED_LIST1_COMMAND("01", "00", OBDUtils::parseSupportedCommandsResponse, true), + OBD_SUPPORTED_LIST2_COMMAND("01", "20", OBDUtils::parseSupportedCommandsResponse, true), + OBD_SUPPORTED_LIST3_COMMAND("01", "40", OBDUtils::parseSupportedCommandsResponse, true), + OBD_BATTERY_VOLTAGE_COMMAND("01", "42", OBDUtils::parseBatteryVoltageResponse), + OBD_AMBIENT_AIR_TEMPERATURE_COMMAND("01", "46", OBDUtils::parseAmbientTempResponse), + OBD_RPM_COMMAND("01", "0C", OBDUtils::parseRpmResponse), + OBD_SPEED_COMMAND("01", "0D", OBDUtils::parseSpeedResponse), + OBD_AIR_INTAKE_TEMP_COMMAND("01", "0F", OBDUtils::parseIntakeAirTempResponse), + OBD_ENGINE_COOLANT_TEMP_COMMAND("01", "05", OBDUtils::parseEngineCoolantTempResponse), + OBD_FUEL_CONSUMPTION_RATE_COMMAND("01", "5E", OBDUtils::parseFuelConsumptionRateResponse), + OBD_FUEL_TYPE_COMMAND("01", "51", OBDUtils::parseFuelTypeResponse, true), + OBD_VIN_COMMAND("09", "02", OBDUtils::parseVINResponse, true, true), + OBD_FUEL_LEVEL_COMMAND("01", "2F", OBDUtils::parseFuelLevelResponse); fun parseResponse(response: String): String { return responseParser.invoke(response.lowercase()) diff --git a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDDataComputer.kt b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDDataComputer.kt index 02e942f2a09..ccc860192e7 100644 --- a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDDataComputer.kt +++ b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDDataComputer.kt @@ -101,7 +101,8 @@ object OBDDataComputer { FUEL_LEFT_DISTANCE(true, listOf(OBD_FUEL_LEVEL_COMMAND), { data -> OBDValue(OBD_FUEL_LEVEL_COMMAND, data) }), -// FUEL_LEFT_LITERS(false, + + // FUEL_LEFT_LITERS(false, // listOf(OBD_FUEL_LEVEL_COMMAND), // { data -> OBDValue(OBD_FUEL_LEVEL_COMMAND, data) }), FUEL_LEFT_PERCENT(false, @@ -122,6 +123,9 @@ object OBDDataComputer { FUEL_TYPE(false, listOf(OBD_FUEL_TYPE_COMMAND), { data -> OBDIntValue(OBD_FUEL_TYPE_COMMAND, data) }), + VIN(false, + listOf(OBD_VIN_COMMAND), + { data -> OBDStringValue(OBD_VIN_COMMAND, data) }), TEMPERATURE_COOLANT(false, listOf(OBD_ENGINE_COOLANT_TEMP_COMMAND), { data -> OBDIntValue(OBD_ENGINE_COOLANT_TEMP_COMMAND, data) }); @@ -247,6 +251,12 @@ object OBDDataComputer { null } } + + VIN -> if (locValues.size > 0) { + (locValues[locValues.size - 1] as OBDStringValue).value + } else { + null + } } } @@ -317,4 +327,17 @@ object OBDDataComputer { return accepted } } + + class OBDStringValue(cmd: OBDCommand, data: Map) : + OBDValue(cmd, data) { + var value = "" + override fun acceptData(dataField: OBDDataField?): Boolean { + var accepted = false + dataField?.let { + value = it.getValue() + accepted = true + } + return accepted + } + } } \ No newline at end of file diff --git a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDDataFieldType.kt b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDDataFieldType.kt index 9e37cd56e4c..239f2603e52 100644 --- a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDDataFieldType.kt +++ b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDDataFieldType.kt @@ -10,6 +10,7 @@ enum class OBDDataFieldType(val nameId: String, private val unitNameId: String) BATTERY_VOLTAGE("obd_battery_voltage_desc", "unit_volt"), AIR_INTAKE_TEMP("obd_air_intake_temp_desc", "degree_celsius"), COOLANT_TEMP("obd_engine_coolant_temp", "degree_celsius"), + VIN("obd_vin", ""), FUEL_TYPE("obd_fuel_type", ""); fun getDisplayName(): String { diff --git a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDDispatcher.kt b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDDispatcher.kt index 0ec4bb8d2c5..4b2a4c88d2b 100644 --- a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDDispatcher.kt +++ b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDDispatcher.kt @@ -26,7 +26,6 @@ object OBDDispatcher { private val log = LoggerFactory.getLogger("OBDDispatcher") private const val TERMINATE_SYMBOL = "\r\r>" private const val RESPONSE_LINE_TERMINATOR = "\r" - private const val READ_DATA_COMMAND_CODE = "01" private var job: Job? = null private var scope: CoroutineScope? = null private var readStatusListener: OBDReadStatusListener? = null @@ -49,12 +48,12 @@ object OBDDispatcher { for (command in commandQueue) { if (command.isStale) { val cachedCommandResponse = staleCommandsCache[command] - if (cachedCommandResponse != null) { + if (cachedCommandResponse != null && cachedCommandResponse != OBDUtils.INVALID_RESPONSE_CODE) { consumeResponse(command, cachedCommandResponse) continue } } - val fullCommand = "$READ_DATA_COMMAND_CODE${command.command}\r" + val fullCommand = "${command.commandGroup}${command.command}\r" val bufferToWrite = Buffer() bufferToWrite.write(fullCommand.encodeToByteArray()) outStream.write(bufferToWrite, bufferToWrite.size) @@ -99,7 +98,14 @@ object OBDDispatcher { } var response = resultRaw.toString() response = response.replace(TERMINATE_SYMBOL, "") - val listResponses = response.split(RESPONSE_LINE_TERMINATOR) + var listResponses = response.split(RESPONSE_LINE_TERMINATOR) +// val listResponses = if(command.isMultiPartResponse) { +// listOf(response) +// } else { +// } + if(command.isMultiPartResponse) { + listResponses = listOf(response.split(RESPONSE_LINE_TERMINATOR).subList(2, listResponses.size).joinToString(separator = "")) + } for (responseIndex in 1 until listResponses.size) { val result = command.parseResponse(listResponses[responseIndex]) log.debug("raw_response_$responseIndex: $result") @@ -161,6 +167,7 @@ object OBDDispatcher { OBDCommand.OBD_AIR_INTAKE_TEMP_COMMAND -> OBDDataField(OBDDataFieldType.AIR_INTAKE_TEMP, result) OBDCommand.OBD_ENGINE_COOLANT_TEMP_COMMAND -> OBDDataField(OBDDataFieldType.COOLANT_TEMP, result) OBDCommand.OBD_FUEL_TYPE_COMMAND -> OBDDataField(OBDDataFieldType.FUEL_TYPE, result) + OBDCommand.OBD_VIN_COMMAND -> OBDDataField(OBDDataFieldType.VIN, result) OBDCommand.OBD_FUEL_LEVEL_COMMAND -> OBDDataField(OBDDataFieldType.FUEL_LVL, result) OBDCommand.OBD_AMBIENT_AIR_TEMPERATURE_COMMAND -> OBDDataField(OBDDataFieldType.AMBIENT_AIR_TEMP, result) OBDCommand.OBD_BATTERY_VOLTAGE_COMMAND -> OBDDataField(OBDDataFieldType.BATTERY_VOLTAGE, result) diff --git a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDUtils.kt b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDUtils.kt index c4b44b1e404..392189db97f 100644 --- a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDUtils.kt +++ b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/obd/OBDUtils.kt @@ -96,6 +96,22 @@ object OBDUtils { return INVALID_RESPONSE_CODE } + fun parseVINResponse(response: String): String { + val responseParts = response.split(" ") + + if (responseParts[0] == "49" && + responseParts[1] == OBDCommand.OBD_VIN_COMMAND.command.lowercase() && + responseParts.size > 3) { + val vinBuilder = StringBuilder() + for (i in 3 .. responseParts.size) { + val hexByte = responseParts[i] + vinBuilder.append(hexByte.toInt(16).toChar()) + } + return vinBuilder.toString() + } + return INVALID_RESPONSE_CODE + } + fun parseFuelConsumptionRateResponse(response: String): String { val hexValues = response.trim().split(" ") if (hexValues.size >= 4 && hexValues[0] == "41" && hexValues[1] == OBDCommand.OBD_FUEL_CONSUMPTION_RATE_COMMAND.command.lowercase()) { diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index f12d45423ac..238f07af225 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -10,6 +10,9 @@ - For wording and consistency, please note https://docs.osmand.net/docs/technical/contributions/translating-osmand Thx - Hardy --> + Unknown device + VIN + VIN code over OBD V Wikimedia Open in browser diff --git a/OsmAnd/src/net/osmand/plus/plugins/odb/OBDTextWidget.kt b/OsmAnd/src/net/osmand/plus/plugins/odb/OBDTextWidget.kt index b01901d78a4..ac328464c30 100644 --- a/OsmAnd/src/net/osmand/plus/plugins/odb/OBDTextWidget.kt +++ b/OsmAnd/src/net/osmand/plus/plugins/odb/OBDTextWidget.kt @@ -68,6 +68,10 @@ class OBDTextWidget @JvmOverloads constructor( obdDataWidgetType = OBDTypeWidget.FUEL_TYPE formatter = OBDFuelTypeFormatter() } + VIN -> { + obdDataWidgetType = OBDTypeWidget.VIN + formatter = OBDComputerWidgetFormatter("%s") + } } //todo implement setting correct time for widget (0 for instant) widgetComputer = OBDDataComputer.registerWidget(obdDataWidgetType, averageTimeSeconds, formatter) diff --git a/OsmAnd/src/net/osmand/plus/plugins/odb/OBDWidgetDataFieldType.kt b/OsmAnd/src/net/osmand/plus/plugins/odb/OBDWidgetDataFieldType.kt index b03b4daf7ee..3097b29e899 100644 --- a/OsmAnd/src/net/osmand/plus/plugins/odb/OBDWidgetDataFieldType.kt +++ b/OsmAnd/src/net/osmand/plus/plugins/odb/OBDWidgetDataFieldType.kt @@ -17,5 +17,6 @@ enum class OBDWidgetDataFieldType( BATTERY_VOLTAGE(WidgetType.OBD_BATTERY_VOLTAGE, R.drawable.ic_action_thermometer, OBDCommand.OBD_BATTERY_VOLTAGE_COMMAND, OBDDataFieldType.BATTERY_VOLTAGE), AIR_INTAKE_TEMP(WidgetType.OBD_AIR_INTAKE_TEMP, R.drawable.ic_action_signal, OBDCommand.OBD_AIR_INTAKE_TEMP_COMMAND, OBDDataFieldType.AIR_INTAKE_TEMP), COOLANT_TEMP(WidgetType.OBD_ENGINE_COOLANT_TEMP, R.drawable.ic_action_sensor_bicycle_power_outlined, OBDCommand.OBD_ENGINE_COOLANT_TEMP_COMMAND, OBDDataFieldType.COOLANT_TEMP), + VIN(WidgetType.OBD_VIN, R.drawable.ic_action_sensor_bicycle_power_outlined, OBDCommand.OBD_ENGINE_COOLANT_TEMP_COMMAND, OBDDataFieldType.COOLANT_TEMP), FUEL_TYPE(WidgetType.OBD_FUEL_TYPE, R.drawable.ic_action_speed_outlined, OBDCommand.OBD_FUEL_TYPE_COMMAND, OBDDataFieldType.FUEL_TYPE) } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/plugins/odb/VehicleMetricsPlugin.kt b/OsmAnd/src/net/osmand/plus/plugins/odb/VehicleMetricsPlugin.kt index fa7e9bef95b..9bc4a10da4e 100644 --- a/OsmAnd/src/net/osmand/plus/plugins/odb/VehicleMetricsPlugin.kt +++ b/OsmAnd/src/net/osmand/plus/plugins/odb/VehicleMetricsPlugin.kt @@ -30,6 +30,7 @@ import net.osmand.plus.views.mapwidgets.widgets.MapWidget import net.osmand.plus.widgets.ctxmenu.ContextMenuAdapter import net.osmand.plus.widgets.ctxmenu.callback.OnDataChangeUiAdapter import net.osmand.plus.widgets.ctxmenu.data.ContextMenuItem +import net.osmand.shared.data.BTDeviceInfo import net.osmand.shared.data.KLatLon import net.osmand.shared.obd.OBDCommand import net.osmand.shared.obd.OBDDataComputer @@ -194,8 +195,8 @@ class VehicleMetricsPlugin(app: OsmandApplication) : OsmandPlugin(app), } @SuppressLint("MissingPermission") - fun getPairedOBDDevicesList(activity: Activity): List { - var deviceList = listOf() + fun getPairedOBDDevicesList(activity: Activity): List { + var deviceList = listOf() if (BLEUtils.isBLEEnabled(activity) && AndroidUtils.hasBLEPermission(activity)) { val bluetoothAdapter = BLEUtils.getBluetoothAdapter(activity) bluetoothAdapter?.let { adapter -> @@ -203,7 +204,7 @@ class VehicleMetricsPlugin(app: OsmandApplication) : OsmandPlugin(app), val pairedDevices = adapter.bondedDevices.toList() deviceList = pairedDevices.filter { device -> device.uuids?.any { parcelUuid -> parcelUuid.uuid == uuid } == true - }.map { it.name ?: "Unknown Device" } + }.map { if (it != null) BTDeviceInfo(it.name, it.address) else BTDeviceInfo.UNKNOWN_DEVICE } } } else { @@ -221,10 +222,11 @@ class VehicleMetricsPlugin(app: OsmandApplication) : OsmandPlugin(app), OBDDispatcher.stopReading() } } + connectedDevice = null } @SuppressLint("MissingPermission") - fun connectToObd(activity: Activity, name: String): Boolean { + fun connectToObd(activity: Activity, deviceInfo: BTDeviceInfo): Boolean { if (connectedDevice == null) { if (BLEUtils.isBLEEnabled(activity)) { if (AndroidUtils.hasBLEPermission(activity)) { @@ -242,7 +244,7 @@ class VehicleMetricsPlugin(app: OsmandApplication) : OsmandPlugin(app), LOG.debug(it.name) } val obdDevice: BluetoothDevice? = - pairedDevices.find { it.name == name } + pairedDevices.find { it.name == deviceInfo.name && it.address == deviceInfo.address } connectedDevice = obdDevice connectToDevice(activity) } @@ -253,7 +255,7 @@ class VehicleMetricsPlugin(app: OsmandApplication) : OsmandPlugin(app), } else { socket?.close() connectedDevice = null - connectToObd(activity, name) + connectToObd(activity, deviceInfo) } return socket != null && socket?.isConnected == true } diff --git a/OsmAnd/src/net/osmand/plus/plugins/odb/dialogs/OBDMainFragment.kt b/OsmAnd/src/net/osmand/plus/plugins/odb/dialogs/OBDMainFragment.kt index 8954eb92602..ed37b37c108 100644 --- a/OsmAnd/src/net/osmand/plus/plugins/odb/dialogs/OBDMainFragment.kt +++ b/OsmAnd/src/net/osmand/plus/plugins/odb/dialogs/OBDMainFragment.kt @@ -28,6 +28,7 @@ import net.osmand.shared.obd.OBDDataComputer.OBDTypeWidget.SPEED import net.osmand.shared.obd.OBDDataComputer.OBDTypeWidget.TEMPERATURE_AMBIENT import net.osmand.shared.obd.OBDDataComputer.OBDTypeWidget.TEMPERATURE_COOLANT import net.osmand.shared.obd.OBDDataComputer.OBDTypeWidget.TEMPERATURE_INTAKE +import net.osmand.shared.obd.OBDDataComputer.OBDTypeWidget.VIN class OBDMainFragment : BaseOsmAndFragment() { private var deviceName: EditText? = null @@ -42,6 +43,7 @@ class OBDMainFragment : BaseOsmAndFragment() { private var fuelTypeBtn: Button? = null private var fuelLeftPersBtn: Button? = null private var tempAmbientBtn: Button? = null + private var vinBtn: Button? = null private var fuelLeftDistResp: EditText? = null private var fuelLeftLitersResp: EditText? = null private var fuelConsumptionResp: EditText? = null @@ -49,7 +51,7 @@ class OBDMainFragment : BaseOsmAndFragment() { private var speedResp: EditText? = null private var tempIntakeResp: EditText? = null private var tempCoolantResp: EditText? = null - private var resp8: EditText? = null + private var vinResp: EditText? = null private var fuelTypeResp: EditText? = null private var fuelLeftPersResp: EditText? = null private var tempAmbientResp: EditText? = null @@ -106,6 +108,7 @@ class OBDMainFragment : BaseOsmAndFragment() { fuelTypeBtn = view.findViewById(R.id.btn9) fuelLeftPersBtn = view.findViewById(R.id.btn10) tempAmbientBtn = view.findViewById(R.id.btn11) + vinBtn = view.findViewById(R.id.btn12) fuelLeftDistBtn?.text = "fuel left distance" fuelLeftLitersBtn?.text = "fuel left liters" fuelConsumptionBtn?.text = "fuel consumption" @@ -117,6 +120,7 @@ class OBDMainFragment : BaseOsmAndFragment() { fuelTypeBtn?.text = "fuel type" fuelLeftPersBtn?.text = "fuel left percent" tempAmbientBtn?.text = "ambient air temperature" + vinBtn?.text = "vin" } override fun onCreate(savedInstanceState: Bundle?) { @@ -180,6 +184,7 @@ class OBDMainFragment : BaseOsmAndFragment() { BATTERY_VOLTAGE -> updateWidgetData(batteryVoltageResp, result) FUEL_TYPE -> updateWidgetData(fuelTypeResp, result) TEMPERATURE_COOLANT -> updateWidgetData(tempCoolantResp, result) + VIN -> updateWidgetData(vinResp, result) } } diff --git a/OsmAnd/src/net/osmand/plus/plugins/odb/dialogs/VehicleMetricsSettingsFragment.kt b/OsmAnd/src/net/osmand/plus/plugins/odb/dialogs/VehicleMetricsSettingsFragment.kt index eac6670016e..e01ea9c9526 100644 --- a/OsmAnd/src/net/osmand/plus/plugins/odb/dialogs/VehicleMetricsSettingsFragment.kt +++ b/OsmAnd/src/net/osmand/plus/plugins/odb/dialogs/VehicleMetricsSettingsFragment.kt @@ -22,6 +22,7 @@ import net.osmand.plus.plugins.PluginsHelper import net.osmand.plus.plugins.odb.VehicleMetricsPlugin import net.osmand.plus.utils.AndroidUtils import net.osmand.plus.utils.ColorUtilities +import net.osmand.shared.data.BTDeviceInfo class VehicleMetricsSettingsFragment : BaseOsmAndFragment() { private var plugin: VehicleMetricsPlugin? = null @@ -30,7 +31,7 @@ class VehicleMetricsSettingsFragment : BaseOsmAndFragment() { var adapter: DeviceAdapter? = null var emptyView: View? = null - private var items = listOf() + private var items = listOf() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -127,23 +128,26 @@ class VehicleMetricsSettingsFragment : BaseOsmAndFragment() { } } - class DeviceAdapter(private val items: List) : + class DeviceAdapter(private val items: List) : RecyclerView.Adapter() { var selectedPosition: Int = RecyclerView.NO_POSITION class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { val textView: TextView = itemView.findViewById(android.R.id.text1) + val subTextView: TextView = itemView.findViewById(android.R.id.text2) } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val view = LayoutInflater.from(parent.context) - .inflate(android.R.layout.simple_list_item_1, parent, false) + .inflate(android.R.layout.simple_list_item_2, parent, false) return ViewHolder(view) } override fun onBindViewHolder(holder: ViewHolder, position: Int) { - holder.textView.text = items[position] + holder.textView.text = items[position].name + holder.subTextView.text = items[position].address holder.textView.setTextColor(Color.BLACK) + holder.subTextView.setTextColor(Color.GRAY) if (position == selectedPosition) { holder.itemView.setBackgroundColor(Color.LTGRAY) } else { diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/WidgetType.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/WidgetType.java index ae0fc625749..f6ad520fca1 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/WidgetType.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/WidgetType.java @@ -119,6 +119,7 @@ public enum WidgetType { OBD_FUEL_LEVEL("obd_fuel_level", R.string.obd_fuel_level, R.string.obd_fuel_level_desc, R.drawable.widget_weather_temperature_day, R.drawable.widget_weather_temperature_night, 0, VEHICLE_METRICS, RIGHT), OBD_FUEL_LEFT_DISTANCE("obd_fuel_left_distance", R.string.obd_fuel_left_distance, R.string.obd_fuel_left_distance_desc, R.drawable.widget_weather_temperature_day, R.drawable.widget_weather_temperature_night, 0, VEHICLE_METRICS, RIGHT), OBD_FUEL_CONSUMPTION_RATE("obd_fuel_consumption_rate", R.string.obd_fuel_consumption_rate, R.string.obd_fuel_consumption_rate_desc, R.drawable.widget_weather_temperature_day, R.drawable.widget_weather_temperature_night, 0, VEHICLE_METRICS, RIGHT), + OBD_VIN("obd_vin", R.string.obd_vin, R.string.obd_vin_desc, R.drawable.widget_weather_temperature_day, R.drawable.widget_weather_temperature_night, 0, VEHICLE_METRICS, RIGHT), OBD_FUEL_TYPE("obd_fuel_type", R.string.obd_fuel_type, R.string.obd_fuel_type_desc, R.drawable.widget_weather_temperature_day, R.drawable.widget_weather_temperature_night, 0, VEHICLE_METRICS, RIGHT), TEMPERATURE("temperature_sensor", R.string.shared_string_temperature, R.string.sensor_temperature_desc, R.drawable.widget_weather_temperature_day, R.drawable.widget_weather_temperature_night, 0, ANT_PLUS, RIGHT),