<% const paintProperties = locals.paintProperties; const layoutProperties = locals.layoutProperties; -%> // This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`. package com.mapbox.mapboxsdk.style.layers; import android.annotation.SuppressLint; import android.support.annotation.ColorInt; /** * Constructs paint/layout properties for Layers * @see <% if (property.type == 'color') { -%> public static Property <%- camelizeWithLeadingLowercase(property.name) %>(@ColorInt int value) { return new PaintProperty<>("<%- property.name %>", colorToRgbaString(value)); } <% } -%> public static Property<<%- propertyType(property) %>> <%- camelizeWithLeadingLowercase(property.name) %>(<%- propertyTypeAnnotation(property) %><%- iff(() => propertyTypeAnnotation(property), " ") %><%- propertyType(property) %> value) { return new PaintProperty<>("<%- property.name %>", value); } <% } -%> <% for (const property of layoutProperties) { -%> public static Property<<%- propertyType(property) %>> <%- camelizeWithLeadingLowercase(property.name) %>(<%- propertyTypeAnnotation(property) %><%- iff(() => propertyTypeAnnotation(property), " ") %><%- propertyType(property) %> value) { return new LayoutProperty<>("<%- property.name %>", value); } <% } -%> @SuppressLint("DefaultLocale") static String colorToRgbaString(@ColorInt int value) { return String.format("rgba(%d, %d, %d, %d)", (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF, (value >> 24) & 0xFF); } }