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

chore: switched from set() to update() #564

Merged
merged 8 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -84,16 +84,16 @@ public fun Circle(
update = {
update(onClick) { this.onCircleClick = it }

set(center) { this.circle.center = it }
set(clickable) { this.circle.isClickable = it }
set(fillColor) { this.circle.fillColor = it.toArgb() }
set(radius) { this.circle.radius = it }
set(strokeColor) { this.circle.strokeColor = it.toArgb() }
set(strokePattern) { this.circle.strokePattern = it }
set(strokeWidth) { this.circle.strokeWidth = it }
set(tag) { this.circle.tag = it }
set(visible) { this.circle.isVisible = it }
set(zIndex) { this.circle.zIndex = it }
update(center) { this.circle.center = it }
update(clickable) { this.circle.isClickable = it }
update(fillColor) { this.circle.fillColor = it.toArgb() }
update(radius) { this.circle.radius = it }
update(strokeColor) { this.circle.strokeColor = it.toArgb() }
update(strokePattern) { this.circle.strokePattern = it }
update(strokeWidth) { this.circle.strokeWidth = it }
update(tag) { this.circle.tag = it }
update(visible) { this.circle.isVisible = it }
update(zIndex) { this.circle.zIndex = it }
}
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ public fun GroundOverlay(
update = {
update(onClick) { this.onGroundOverlayClick = it }

set(bearing) { this.groundOverlay.bearing = it }
set(clickable) { this.groundOverlay.isClickable = it }
set(image) { this.groundOverlay.setImage(it) }
set(position) { this.groundOverlay.position(it) }
set(tag) { this.groundOverlay.tag = it }
set(transparency) { this.groundOverlay.transparency = it }
set(visible) { this.groundOverlay.isVisible = it }
set(zIndex) { this.groundOverlay.zIndex = it }
update(bearing) { this.groundOverlay.bearing = it }
update(clickable) { this.groundOverlay.isClickable = it }
update(image) { this.groundOverlay.setImage(it) }
update(position) { this.groundOverlay.position(it) }
update(tag) { this.groundOverlay.tag = it }
update(transparency) { this.groundOverlay.transparency = it }
update(visible) { this.groundOverlay.isVisible = it }
update(zIndex) { this.groundOverlay.zIndex = it }
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,29 +497,29 @@ private fun MarkerImpl(
update(infoContent) { this.infoContent = it }
update(infoWindow) { this.infoWindow = it }

set(alpha) { this.marker.alpha = it }
set(anchor) { this.marker.setAnchor(it.x, it.y) }
set(draggable) { this.marker.isDraggable = it }
set(flat) { this.marker.isFlat = it }
set(icon) { this.marker.setIcon(it) }
set(infoWindowAnchor) { this.marker.setInfoWindowAnchor(it.x, it.y) }
set(state.position) { this.marker.position = it }
set(rotation) { this.marker.rotation = it }
set(snippet) {
update(alpha) { this.marker.alpha = it }
update(anchor) { this.marker.setAnchor(it.x, it.y) }
update(draggable) { this.marker.isDraggable = it }
update(flat) { this.marker.isFlat = it }
update(icon) { this.marker.setIcon(it) }
update(infoWindowAnchor) { this.marker.setInfoWindowAnchor(it.x, it.y) }
update(state.position) { this.marker.position = it }
update(rotation) { this.marker.rotation = it }
update(snippet) {
this.marker.snippet = it
if (this.marker.isInfoWindowShown) {
this.marker.showInfoWindow()
}
}
set(tag) { this.marker.tag = it }
set(title) {
update(tag) { this.marker.tag = it }
update(title) {
this.marker.title = it
if (this.marker.isInfoWindowShown) {
this.marker.showInfoWindow()
}
}
set(visible) { this.marker.isVisible = it }
set(zIndex) { this.marker.zIndex = it }
update(visible) { this.marker.isVisible = it }
update(zIndex) { this.marker.zIndex = it }
}
)
}
Expand Down Expand Up @@ -689,27 +689,27 @@ private fun AdvancedMarkerImpl(
update(infoContent) { this.infoContent = it }
update(infoWindow) { this.infoWindow = it }

set(alpha) { this.marker.alpha = it }
set(anchor) { this.marker.setAnchor(it.x, it.y) }
set(draggable) { this.marker.isDraggable = it }
set(flat) { this.marker.isFlat = it }
set(infoWindowAnchor) { this.marker.setInfoWindowAnchor(it.x, it.y) }
set(state.position) { this.marker.position = it }
set(rotation) { this.marker.rotation = it }
set(snippet) {
update(alpha) { this.marker.alpha = it }
update(anchor) { this.marker.setAnchor(it.x, it.y) }
update(draggable) { this.marker.isDraggable = it }
update(flat) { this.marker.isFlat = it }
update(infoWindowAnchor) { this.marker.setInfoWindowAnchor(it.x, it.y) }
update(state.position) { this.marker.position = it }
update(rotation) { this.marker.rotation = it }
update(snippet) {
this.marker.snippet = it
if (this.marker.isInfoWindowShown) {
this.marker.showInfoWindow()
}
}
set(tag) { this.marker.tag = it }
set(title) {
update(tag) { this.marker.tag = it }
update(title) {
this.marker.title = it
if (this.marker.isInfoWindowShown) {
this.marker.showInfoWindow()
}
}
set(pinConfig) {
update(pinConfig) {
if (iconView == null) {
this.marker.setIcon(pinConfig?.let { it1 ->
BitmapDescriptorFactory.fromPinConfig(
Expand All @@ -719,8 +719,8 @@ private fun AdvancedMarkerImpl(
}
}

set(visible) { this.marker.isVisible = it }
set(zIndex) { this.marker.zIndex = it }
update(visible) { this.marker.isVisible = it }
update(zIndex) { this.marker.zIndex = it }
kikoso marked this conversation as resolved.
Show resolved Hide resolved
}
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,18 @@ public fun Polygon(
},
update = {
update(onClick) { this.onPolygonClick = it }

set(points) { this.polygon.points = it }
set(clickable) { this.polygon.isClickable = it }
set(fillColor) { this.polygon.fillColor = it.toArgb() }
set(geodesic) { this.polygon.isGeodesic = it }
set(holes) { this.polygon.holes = it }
set(strokeColor) { this.polygon.strokeColor = it.toArgb() }
set(strokeJointType) { this.polygon.strokeJointType = it }
set(strokePattern) { this.polygon.strokePattern = it }
set(strokeWidth) { this.polygon.strokeWidth = it }
set(tag) { this.polygon.tag = it }
set(visible) { this.polygon.isVisible = it }
set(zIndex) { this.polygon.zIndex = it }
update(points) { this.polygon.points = it }
update(clickable) { this.polygon.isClickable = it }
update(fillColor) { this.polygon.fillColor = it.toArgb() }
update(geodesic) { this.polygon.isGeodesic = it }
update(holes) { this.polygon.holes = it }
update(strokeColor) { this.polygon.strokeColor = it.toArgb() }
update(strokeJointType) { this.polygon.strokeJointType = it }
update(strokePattern) { this.polygon.strokePattern = it }
update(strokeWidth) { this.polygon.strokeWidth = it }
update(tag) { this.polygon.tag = it }
update(visible) { this.polygon.isVisible = it }
update(zIndex) { this.polygon.zIndex = it }
}
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,19 +198,19 @@ private fun PolylineImpl(
update = {
update(onClick) { this.onPolylineClick = it }

set(points) { this.polyline.points = it }
set(spans) { this.polyline.spans = it }
set(clickable) { this.polyline.isClickable = it }
set(color) { this.polyline.color = it.toArgb() }
set(endCap) { this.polyline.endCap = it }
set(geodesic) { this.polyline.isGeodesic = it }
set(jointType) { this.polyline.jointType = it }
set(pattern) { this.polyline.pattern = it }
set(startCap) { this.polyline.startCap = it }
set(tag) { this.polyline.tag = it }
set(visible) { this.polyline.isVisible = it }
set(width) { this.polyline.width = it }
set(zIndex) { this.polyline.zIndex = it }
update(points) { this.polyline.points = it }
update(spans) { this.polyline.spans = it }
update(clickable) { this.polyline.isClickable = it }
update(color) { this.polyline.color = it.toArgb() }
update(endCap) { this.polyline.endCap = it }
update(geodesic) { this.polyline.isGeodesic = it }
update(jointType) { this.polyline.jointType = it }
update(pattern) { this.polyline.pattern = it }
update(startCap) { this.polyline.startCap = it }
update(tag) { this.polyline.tag = it }
update(visible) { this.polyline.isVisible = it }
update(width) { this.polyline.width = it }
update(zIndex) { this.polyline.zIndex = it }
}
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public fun TileOverlay(
update = {
update(onClick) { this.onTileOverlayClick = it }

set(tileProvider) {
update(tileProvider) {
this.tileOverlay.remove()
this.tileOverlay = mapApplier?.map?.addTileOverlay {
tileProvider(tileProvider)
Expand All @@ -108,10 +108,10 @@ public fun TileOverlay(
zIndex(zIndex)
} ?: error("Error adding tile overlay")
}
set(fadeIn) { this.tileOverlay.fadeIn = it }
set(transparency) { this.tileOverlay.transparency = it }
set(visible) { this.tileOverlay.isVisible = it }
set(zIndex) { this.tileOverlay.zIndex = it }
update(fadeIn) { this.tileOverlay.fadeIn = it }
update(transparency) { this.tileOverlay.transparency = it }
update(visible) { this.tileOverlay.isVisible = it }
update(zIndex) { this.tileOverlay.zIndex = it }
}
)
}
Expand Down