diff options
author | Łukasz Paczos <lukas.paczos@gmail.com> | 2019-03-14 18:37:54 +0100 |
---|---|---|
committer | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2019-03-15 16:17:59 +0100 |
commit | f1ac3f29c3f1255299db6cf19f7a28d66014593d (patch) | |
tree | 132359f7fa31276056f285c6d7a939165411d584 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/Expression.java | |
parent | 69e11155c839b1f2a8685331b4104f82f1aa9882 (diff) | |
download | qtlocation-mapboxgl-f1ac3f29c3f1255299db6cf19f7a28d66014593d.tar.gz |
[android] text-color option for formatted sections
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/Expression.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/Expression.java | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/Expression.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/Expression.java index 25ff819470..c3451845dd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/Expression.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/Expression.java @@ -2843,7 +2843,8 @@ public class Expression { * CircleLayer circleLayer = new CircleLayer("layer-id", "source-id"); * circleLayer.setProperties( * circleColor(switchCase( - * eq(literal("it"), resolvedLocale(collator(true, true, Locale.ITALY))), literal(ColorUtils.colorToRgbaString(Color.GREEN)), + * eq(literal("it"), resolvedLocale(collator(true, true, Locale.ITALY))), literal(ColorUtils.colorToRgbaString + * (Color.GREEN)), * literal(ColorUtils.colorToRgbaString(Color.RED)))) * ); * } @@ -3626,7 +3627,8 @@ public class Expression { * @return expression * @see <a href="https://www.mapbox.com/mapbox-gl-js/style-spec/#expressions-step">Style specification</a> */ - public static Expression step(@NonNull Expression input, @NonNull Expression defaultOutput, @NonNull Expression... stops) { + public static Expression step(@NonNull Expression input, @NonNull Expression defaultOutput, + @NonNull Expression... stops) { return new Expression("step", join(new Expression[] {input, defaultOutput}, stops)); } @@ -4411,7 +4413,7 @@ public class Expression { /** * If set, the text-font argument overrides the font specified by the root layout properties. * <p> - * "text-font" is required to a literal array. + * "text-font" is required to be a literal array. * <p> * The requested font stack has to be a part of the used style. * For more information see <a href="https://www.mapbox.com/help/define-font-stack/">the documentation</a>. @@ -4427,7 +4429,7 @@ public class Expression { /** * If set, the text-font argument overrides the font specified by the root layout properties. * <p> - * "text-font" is required to a literal array. + * "text-font" is required to be a literal array. * <p> * The requested font stack has to be a part of the used style. * For more information see <a href="https://www.mapbox.com/help/define-font-stack/">the documentation</a>. @@ -4439,6 +4441,28 @@ public class Expression { public static FormatOption formatTextFont(@NonNull String[] fontStack) { return new FormatOption("text-font", literal(fontStack)); } + + /** + * If set, the text-color argument overrides the color specified by the root paint properties. + * + * @param expression expression + * @return format option + */ + @NonNull + public static FormatOption formatTextColor(@NonNull Expression expression) { + return new FormatOption("text-color", expression); + } + + /** + * If set, the text-color argument overrides the color specified by the root paint properties. + * + * @param color value + * @return format option + */ + @NonNull + public static FormatOption formatTextColor(@ColorInt int color) { + return new FormatOption("text-color", color(color)); + } } /** |