diff options
author | Tobrun <tobrun@mapbox.com> | 2017-12-19 08:55:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-19 08:55:48 +0100 |
commit | 757cc0f2be1c0972f9b74a91ed873fe8a892f27f (patch) | |
tree | 1e7bcbdebc6a3d24fbcef56f32eca2323be4fc12 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs | |
parent | 9759ba78367cea366ad28057d47725a37170c9f3 (diff) | |
download | qtlocation-mapboxgl-757cc0f2be1c0972f9b74a91ed873fe8a892f27f.tar.gz |
[android] - add binding integration for expressions (#10654)
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs index 2d3421d1d9..ed138e557a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs @@ -11,6 +11,7 @@ import android.support.annotation.ColorInt; import com.mapbox.mapboxsdk.style.functions.Function; import com.mapbox.mapboxsdk.style.functions.CameraFunction; +import com.mapbox.mapboxsdk.style.expressions.Expression; /** * Constructs paint/layout properties for Layers @@ -36,6 +37,7 @@ public class PropertyFactory { * @param function the visibility function * @return property wrapper around a String function */ + @Deprecated public static <T> PropertyValue<Function<T, String>> visibility(Function<T, String> function) { return new LayoutPropertyValue<>("visibility", function); } @@ -63,6 +65,16 @@ public class PropertyFactory { return new PaintPropertyValue<>("<%- property.name %>", value); } + /** + * <%- propertyFactoryMethodDoc(property) %> + * + * @param expression an expression statement + * @return property wrapper around an expression statement + */ + public static PropertyValue<Expression> <%- camelizeWithLeadingLowercase(property.name) %>(Expression expression) { + return new PaintPropertyValue<>("<%- property.name %>", expression); + } + <% if (supportsPropertyFunction(property)) { -%> /** @@ -72,6 +84,7 @@ public class PropertyFactory { * @param function a wrapper function for <%- propertyType(property) %> * @return property wrapper around a <%- propertyType(property) %> function */ + @Deprecated public static <T> PropertyValue<Function<T, <%- propertyType(property) %>>> <%- camelizeWithLeadingLowercase(property.name) %>(Function<T, <%- propertyType(property) %>> function) { return new PaintPropertyValue<>("<%- property.name %>", function); } @@ -85,6 +98,7 @@ public class PropertyFactory { * @param function a wrapper {@link CameraFunction} for <%- propertyType(property) %> * @return property wrapper around a <%- propertyType(property) %> function */ + @Deprecated public static <Z extends Number> PropertyValue<CameraFunction<Z, <%- propertyType(property) %>>> <%- camelizeWithLeadingLowercase(property.name) %>(CameraFunction<Z, <%- propertyType(property) %>> function) { return new PaintPropertyValue<>("<%- property.name %>", function); } @@ -102,6 +116,15 @@ public class PropertyFactory { return new LayoutPropertyValue<>("<%- property.name %>", value); } + /** + * <%- propertyFactoryMethodDoc(property) %> + * + * @param value a <%- propertyType(property) %> value + * @return property wrapper around <%- propertyType(property) %> + */ + public static PropertyValue<Expression> <%- camelizeWithLeadingLowercase(property.name) %>(Expression value) { + return new LayoutPropertyValue<>("<%- property.name %>", value); + } <% if (supportsPropertyFunction(property)) { -%> |