Skip to content

Commit

Permalink
Image expression options (#2866)
Browse files Browse the repository at this point in the history
* Image options expression

* Add tests

* Add changelog entry

* update api

* Add compability overrides

* Address review feedback

* Add tests for image expression unwrapping

* Restore old image expression factory

* lint

* Remove extra image expression overloads
  • Loading branch information
evil159 authored Nov 28, 2024
1 parent 2f0e074 commit a975c25
Show file tree
Hide file tree
Showing 8 changed files with 217 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Mapbox welcomes participation and contributions from everyone.
* Introduce `BackgroundLayer.backgroundPitchAlignment` API to configure the orientation of background layer.
* Introduce `LocationIndicatorLayer.emphasisCircleGlowRange` and `LocationIndicatorLayer.emphasisCircleGlowRangeTransition` APIs to control the glow effect of the emphasis circle from the solid start to the fully transparent end and to set the transition options for the `emphasisCircleGlowRange` property, respectively.
* Introduce `radius` parameter for `ClickInteraction` and `LongClickInteraction` to support an extra area around the interaction.
* Add a way to specify options for `Expression.image()`.

* [compose] Introduce `LocationIndicatorLayerState.emphasisCircleGlowRange` and `LocationIndicatorLayerState.emphasisCircleGlowRangeTransition` properties.
* [compose] Introduce `FillLayerState.fillZOffset` and `FillLayerState.fillZOffsetTransition` properties.
* [compose] Introduce `FillExtrusionLayerState.fillExtrusionBaseAlignment` and `FillExtrusionLayerState.fillExtrusionHeightAlignment` properties.
Expand Down
15 changes: 12 additions & 3 deletions extension-style/api/Release/metalava.txt
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ package com.mapbox.maps.extension.style.expressions.dsl.generated {
method public static com.mapbox.maps.extension.style.expressions.generated.Expression hsl(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder,kotlin.Unit> block);
method public static com.mapbox.maps.extension.style.expressions.generated.Expression hsla(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder,kotlin.Unit> block);
method public static com.mapbox.maps.extension.style.expressions.generated.Expression id();
method public static com.mapbox.maps.extension.style.expressions.generated.Expression image(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder,kotlin.Unit> block);
method public static com.mapbox.maps.extension.style.expressions.generated.Expression image(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.expressions.generated.Expression.ImageBuilder,kotlin.Unit> block);
method public static com.mapbox.maps.extension.style.expressions.generated.Expression inExpression(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder,kotlin.Unit> block);
method public static com.mapbox.maps.extension.style.expressions.generated.Expression inExpression(String needle, com.mapbox.maps.extension.style.expressions.generated.Expression haystack);
method public static com.mapbox.maps.extension.style.expressions.generated.Expression inExpression(double needle, com.mapbox.maps.extension.style.expressions.generated.Expression haystack);
Expand Down Expand Up @@ -399,6 +399,8 @@ package com.mapbox.maps.extension.style.expressions.generated {
method public static com.mapbox.maps.extension.style.expressions.generated.Expression hsla(com.mapbox.maps.extension.style.expressions.generated.Expression... expressions);
method public static com.mapbox.maps.extension.style.expressions.generated.Expression id();
method public static com.mapbox.maps.extension.style.expressions.generated.Expression image(com.mapbox.maps.extension.style.expressions.generated.Expression... expressions);
method @com.mapbox.maps.MapboxExperimental public static com.mapbox.maps.extension.style.expressions.generated.Expression image(com.mapbox.maps.extension.style.expressions.generated.Expression image, java.util.Map<java.lang.String,com.mapbox.maps.extension.style.expressions.generated.Expression> options);
method @com.mapbox.maps.MapboxExperimental public static com.mapbox.maps.extension.style.expressions.generated.Expression image(com.mapbox.maps.extension.style.expressions.generated.Expression image, java.util.Map<java.lang.String,com.mapbox.maps.extension.style.expressions.generated.Expression> options, com.mapbox.maps.extension.style.expressions.generated.Expression image2, java.util.Map<java.lang.String,com.mapbox.maps.extension.style.expressions.generated.Expression> options2);
method public static com.mapbox.maps.extension.style.expressions.generated.Expression inExpression(com.mapbox.maps.extension.style.expressions.generated.Expression... expressions);
method public static com.mapbox.maps.extension.style.expressions.generated.Expression inExpression(String needle, com.mapbox.maps.extension.style.expressions.generated.Expression haystack);
method public static com.mapbox.maps.extension.style.expressions.generated.Expression inExpression(double needle, com.mapbox.maps.extension.style.expressions.generated.Expression haystack);
Expand Down Expand Up @@ -605,7 +607,9 @@ package com.mapbox.maps.extension.style.expressions.generated {
method public com.mapbox.maps.extension.style.expressions.generated.Expression hsla(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder,kotlin.Unit> block);
method public com.mapbox.maps.extension.style.expressions.generated.Expression id();
method public com.mapbox.maps.extension.style.expressions.generated.Expression image(com.mapbox.maps.extension.style.expressions.generated.Expression... expressions);
method public com.mapbox.maps.extension.style.expressions.generated.Expression image(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder,kotlin.Unit> block);
method @com.mapbox.maps.MapboxExperimental public com.mapbox.maps.extension.style.expressions.generated.Expression image(com.mapbox.maps.extension.style.expressions.generated.Expression image, java.util.Map<java.lang.String,com.mapbox.maps.extension.style.expressions.generated.Expression> options);
method @com.mapbox.maps.MapboxExperimental public com.mapbox.maps.extension.style.expressions.generated.Expression image(com.mapbox.maps.extension.style.expressions.generated.Expression image, java.util.Map<java.lang.String,com.mapbox.maps.extension.style.expressions.generated.Expression> options, com.mapbox.maps.extension.style.expressions.generated.Expression image2, java.util.Map<java.lang.String,com.mapbox.maps.extension.style.expressions.generated.Expression> options2);
method public com.mapbox.maps.extension.style.expressions.generated.Expression image(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.expressions.generated.Expression.ImageBuilder,kotlin.Unit> block);
method public com.mapbox.maps.extension.style.expressions.generated.Expression inExpression(com.mapbox.maps.extension.style.expressions.generated.Expression... expressions);
method public com.mapbox.maps.extension.style.expressions.generated.Expression inExpression(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder,kotlin.Unit> block);
method public com.mapbox.maps.extension.style.expressions.generated.Expression inExpression(String needle, com.mapbox.maps.extension.style.expressions.generated.Expression haystack);
Expand Down Expand Up @@ -796,7 +800,7 @@ package com.mapbox.maps.extension.style.expressions.generated {
method public final com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder hsl(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder,kotlin.Unit> block);
method public final com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder hsla(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder,kotlin.Unit> block);
method public final com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder id();
method public final com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder image(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder,kotlin.Unit> block);
method public final com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder image(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.expressions.generated.Expression.ImageBuilder,kotlin.Unit> block);
method public final com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder inExpression(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder,kotlin.Unit> block);
method public final com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder inExpression(String needle, com.mapbox.maps.extension.style.expressions.generated.Expression haystack);
method public final com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder inExpression(double needle, com.mapbox.maps.extension.style.expressions.generated.Expression haystack);
Expand Down Expand Up @@ -913,6 +917,11 @@ package com.mapbox.maps.extension.style.expressions.generated {
method public com.mapbox.maps.extension.style.expressions.generated.Expression.FormatSectionBuilder textFont(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder,kotlin.Unit> block);
}

@com.mapbox.maps.extension.style.types.ExpressionDsl public static final class Expression.ImageBuilder extends com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder {
ctor public Expression.ImageBuilder();
method @com.mapbox.maps.MapboxExperimental public com.mapbox.maps.extension.style.expressions.generated.Expression.ImageBuilder imageOptions(kotlin.Pair<java.lang.String,com.mapbox.maps.extension.style.expressions.generated.Expression>... pairs);
}

@com.mapbox.maps.extension.style.types.ExpressionDsl public static final class Expression.InterpolatorBuilder extends com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder {
ctor public Expression.InterpolatorBuilder(String operator);
method public com.mapbox.maps.extension.style.expressions.generated.Expression.InterpolatorBuilder cubicBezier(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.expressions.generated.Expression.ExpressionBuilder,kotlin.Unit> block);
Expand Down
9 changes: 9 additions & 0 deletions extension-style/api/extension-style.api
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ public final class com/mapbox/maps/extension/style/expressions/generated/Express
public static final fun hsl ([Lcom/mapbox/maps/extension/style/expressions/generated/Expression;)Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
public static final fun hsla ([Lcom/mapbox/maps/extension/style/expressions/generated/Expression;)Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
public static final fun id ()Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
public static final fun image (Lcom/mapbox/maps/extension/style/expressions/generated/Expression;Ljava/util/Map;)Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
public static final fun image (Lcom/mapbox/maps/extension/style/expressions/generated/Expression;Ljava/util/Map;Lcom/mapbox/maps/extension/style/expressions/generated/Expression;Ljava/util/Map;)Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
public static final fun image ([Lcom/mapbox/maps/extension/style/expressions/generated/Expression;)Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
public static final fun inExpression (DLcom/mapbox/maps/extension/style/expressions/generated/Expression;)Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
public static final fun inExpression (Ljava/lang/String;Lcom/mapbox/maps/extension/style/expressions/generated/Expression;)Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
Expand Down Expand Up @@ -579,6 +581,8 @@ public final class com/mapbox/maps/extension/style/expressions/generated/Express
public final fun hsla (Lkotlin/jvm/functions/Function1;)Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
public final fun hsla ([Lcom/mapbox/maps/extension/style/expressions/generated/Expression;)Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
public final fun id ()Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
public final fun image (Lcom/mapbox/maps/extension/style/expressions/generated/Expression;Ljava/util/Map;)Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
public final fun image (Lcom/mapbox/maps/extension/style/expressions/generated/Expression;Ljava/util/Map;Lcom/mapbox/maps/extension/style/expressions/generated/Expression;Ljava/util/Map;)Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
public final fun image (Lkotlin/jvm/functions/Function1;)Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
public final fun image ([Lcom/mapbox/maps/extension/style/expressions/generated/Expression;)Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
public final fun inExpression (DLcom/mapbox/maps/extension/style/expressions/generated/Expression;)Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
Expand Down Expand Up @@ -890,6 +894,11 @@ public final class com/mapbox/maps/extension/style/expressions/generated/Express
public final fun textFont (Lkotlin/jvm/functions/Function1;)Lcom/mapbox/maps/extension/style/expressions/generated/Expression$FormatSectionBuilder;
}

public final class com/mapbox/maps/extension/style/expressions/generated/Expression$ImageBuilder : com/mapbox/maps/extension/style/expressions/generated/Expression$ExpressionBuilder {
public fun <init> ()V
public final fun imageOptions ([Lkotlin/Pair;)Lcom/mapbox/maps/extension/style/expressions/generated/Expression$ImageBuilder;
}

public final class com/mapbox/maps/extension/style/expressions/generated/Expression$InterpolatorBuilder : com/mapbox/maps/extension/style/expressions/generated/Expression$ExpressionBuilder {
public fun <init> (Ljava/lang/String;)V
public final fun cubicBezier (DDDD)Lcom/mapbox/maps/extension/style/expressions/generated/Expression$InterpolatorBuilder;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a975c25

Please sign in to comment.