Add custom activity type

This commit is contained in:
Dima-1 2021-02-08 18:27:18 +02:00
parent e261150279
commit 2efd0cad00

View file

@ -5,6 +5,8 @@ import java.util.List;
public class RouteActivityType { public class RouteActivityType {
private static final List<RouteActivityType> values = new ArrayList<>(); private static final List<RouteActivityType> values = new ArrayList<>();
public static final String DEFAULT_ICON = "special_marker";
public static final String DEFAULT_COLOR = "orange";
public static final RouteActivityType WATER = createType("water", "yellow").icon("special_kayak").reg(); public static final RouteActivityType WATER = createType("water", "yellow").icon("special_kayak").reg();
public static final RouteActivityType WINTER = createType("winter", "yellow").icon("special_skiing").reg(); public static final RouteActivityType WINTER = createType("winter", "yellow").icon("special_skiing").reg();
@ -47,7 +49,7 @@ public class RouteActivityType {
return rat; return rat;
} }
} }
return null; return createType(name.toLowerCase(), DEFAULT_COLOR).icon(DEFAULT_ICON).reg();
} }
private static RouteActivityTypeBuilder createType(String name, String color) { private static RouteActivityTypeBuilder createType(String name, String color) {