Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Annotation plugin] Add colorInt API for annotation options #76

Merged
merged 1 commit into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.mapbox.geojson.FeatureCollection
import com.mapbox.geojson.Point
import com.mapbox.maps.extension.style.utils.ColorUtils
import com.mapbox.maps.plugin.annotation.generated.*
import com.mapbox.maps.plugin.annotation.getAnnotationPlugin
import com.mapbox.maps.testapp.R
Expand Down Expand Up @@ -42,7 +41,7 @@ class CircleActivity : AppCompatActivity() {

val circleOptions: CircleOptions = CircleOptions()
.withPoint(Point.fromLngLat(CIRCLE_LONGITUDE, CIRCLE_LATITUDE))
.withCircleColor(ColorUtils.colorToRgbaString(Color.YELLOW))
.withCircleColor(Color.YELLOW)
.withCircleRadius(12.0)
.withDraggable(true)
create(circleOptions)
Expand All @@ -54,7 +53,7 @@ class CircleActivity : AppCompatActivity() {
circleOptionsList.add(
CircleOptions()
.withPoint(AnnotationUtils.createRandomPoint())
.withCircleColor(ColorUtils.colorToRgbaString(color))
.withCircleColor(color)
.withCircleRadius(8.0)
.withDraggable(true)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.appcompat.app.AppCompatActivity
import com.google.gson.JsonPrimitive
import com.mapbox.geojson.FeatureCollection
import com.mapbox.geojson.Point
import com.mapbox.maps.extension.style.utils.ColorUtils
import com.mapbox.maps.plugin.annotation.generated.*
import com.mapbox.maps.plugin.annotation.getAnnotationPlugin
import com.mapbox.maps.testapp.R
Expand Down Expand Up @@ -52,7 +51,7 @@ class FillActivity : AppCompatActivity() {
val fillOptions: FillOptions = FillOptions()
.withPoints(points)
.withData(JsonPrimitive("Foobar"))
.withFillColor(ColorUtils.colorToRgbaString(Color.RED))
.withFillColor(Color.RED)
create(fillOptions)

// random add fills across the globe
Expand All @@ -62,7 +61,7 @@ class FillActivity : AppCompatActivity() {
fillOptionsList.add(
FillOptions()
.withPoints(AnnotationUtils.createRandomPointsList())
.withFillColor(ColorUtils.colorToRgbaString(color))
.withFillColor(color)
)
}
create(fillOptionsList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.appcompat.app.AppCompatActivity
import com.mapbox.geojson.FeatureCollection
import com.mapbox.geojson.Point
import com.mapbox.maps.extension.style.layers.getLayer
import com.mapbox.maps.extension.style.utils.ColorUtils
import com.mapbox.maps.plugin.annotation.AnnotationConfig
import com.mapbox.maps.plugin.annotation.generated.*
import com.mapbox.maps.plugin.annotation.getAnnotationPlugin
Expand Down Expand Up @@ -60,7 +59,7 @@ class LineActivity : AppCompatActivity() {

val lineOptions: LineOptions = LineOptions()
.withPoints(points)
.withLineColor(ColorUtils.colorToRgbaString(Color.RED))
.withLineColor(Color.RED)
.withLineWidth(5.0)
create(lineOptions)

Expand All @@ -73,7 +72,7 @@ class LineActivity : AppCompatActivity() {
val color = Color.argb(255, random.nextInt(256), random.nextInt(256), random.nextInt(256))
LineOptions()
.withPoints(it)
.withLineColor(ColorUtils.colorToRgbaString(color))
.withLineColor(color)
}

create(lineOptionsList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import com.mapbox.maps.extension.style.expressions.generated.Expression.Companio
import com.mapbox.maps.extension.style.expressions.generated.Expression.Companion.toNumber
import com.mapbox.maps.extension.style.layers.properties.generated.IconAnchor
import com.mapbox.maps.extension.style.layers.properties.generated.TextAnchor
import com.mapbox.maps.extension.style.utils.ColorUtils
import com.mapbox.maps.plugin.annotation.generated.*
import com.mapbox.maps.plugin.annotation.getAnnotationPlugin
import com.mapbox.maps.plugin.location.utils.BitmapUtils
Expand Down Expand Up @@ -79,7 +78,7 @@ class SymbolActivity : AppCompatActivity() {
.withIconImage(it)
.withTextField(ID_ICON_AIRPORT)
.withTextOffset(listOf(0.0, -1.0))
.withTextColor(ColorUtils.colorToRgbaString(Color.RED))
.withTextColor(Color.RED)
.withIconSize(1.3)
.withIconOffset(listOf(5.0, 10.0))
.withSymbolSortKey(10.0)
Expand All @@ -98,7 +97,7 @@ class SymbolActivity : AppCompatActivity() {
val nearbyOptions: SymbolOptions = SymbolOptions()
.withPoint(Point.fromLngLat(NEARBY_LONGITUDE, NEARBY_LATITUDE))
.withIconImage(it)
.withIconColor(ColorUtils.colorToRgbaString(Color.YELLOW))
.withIconColor(Color.YELLOW)
.withIconSize(2.5)
.withSymbolSortKey(5.0)
.withDraggable(true)
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.

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.

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

Loading