[android] add support for schuko/type-E charge sockets

The commit is slightly more complicated that expected because:

- it adds supports for both schuko and type-E, using the same icon (but
  maintaining the underlying type annotated in OSM)

- it adds logic to *not* display the power of schuko socket as 'unknown'
  when not provided in OSM, as it is 'implicit' (3.7kW in most
  countries)

Signed-off-by: Séverin Lemaignan <severin@guakamole.org>
This commit is contained in:
Séverin Lemaignan
2025-11-25 22:44:34 +01:00
committed by x7z4w
parent 610737d295
commit 6d0111b434
8 changed files with 108 additions and 18 deletions

View File

@@ -1,7 +1,33 @@
package app.organicmaps.sdk.bookmarks.data;
import java.text.DecimalFormat;
/**
* represents the details of the socket available on a particular charging station
*
*/
public record ChargeSocketDescriptor(String type, int count, double power) {}
public record ChargeSocketDescriptor(String type, int count, double power) {
/**
* Some charge sockets have the same visuals as other sockets, even though they are different and are tagged
* differently in OSM. This method returns the 'visual' type that should be used for the socket.
*
* @return the 'equivalent' visual style that should be used for this socket
*/
public String visualType() {
if (type.equals("typee")) {
return "schuko";
}
return type;
}
/**
* For some sockets (eg, domestic sockets), the power is usually not provided, as it is 'implicit'
*
* @return true if this socket type does not require displaying the power
*/
public Boolean ignorePower() {
return type.equals("typee") || type.equals("schuko");
}
}