Skip to content

Commit 9340bb4

Browse files
Search SDK 2.12.0 (#331)
* Versions bump * Support multiple retrieve for the Detail API * Support category IDs and bounding box for PlaceAutocomplete * Update changelog and version bump * Remove old tests suppresions * Update Firebase device model
1 parent 51ea284 commit 9340bb4

File tree

20 files changed

+556
-23
lines changed

20 files changed

+556
-23
lines changed

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ commands:
170170
gcloud firebase test android run \
171171
--type robo --app MapboxSearch/sample/build/outputs/apk/release/sample-release.apk \
172172
--device model=panther,version=33,locale=en,orientation=portrait \
173-
--device model=Nexus6,version=24,locale=en,orientation=portrait \
173+
--device model=MediumPhone.arm,version=26,locale=en,orientation=portrait \
174174
--timeout 900s \
175175
--project mapbox-search-android
176176
@@ -182,8 +182,8 @@ commands:
182182
command: |
183183
gcloud firebase test android run \
184184
--type instrumentation --app MapboxSearch/sample/build/outputs/apk/debug/sample-debug.apk --test MapboxSearch/sample/build/outputs/apk/androidTest/debug/sample-debug-androidTest.apk \
185-
--device model=Pixel2,version=30,locale=en,orientation=portrait \
186-
--device model=Nexus6,version=24,locale=en,orientation=portrait \
185+
--device model=Pixel2.arm,version=30,locale=en,orientation=portrait \
186+
--device model=MediumPhone.arm,version=26,locale=en,orientation=portrait \
187187
--timeout 900s \
188188
--project mapbox-search-android
189189
@@ -204,8 +204,8 @@ commands:
204204
./gradlew :<< parameters.module_name >>:assembleDebugAndroidTest -Pcoverage
205205
gcloud firebase test android run \
206206
--type instrumentation --app sample/build/outputs/apk/debug/sample-debug.apk --test << parameters.module_name >>/build/outputs/apk/androidTest/debug/<< parameters.archives_base_name >>-debug-androidTest.apk --environment-variables coverage=true,coverageFile=/sdcard/coverage.ec --directories-to-pull /sdcard --results-dir=$CIRCLE_BUILD_NUM \
207-
--device model=Pixel2,version=30,locale=en,orientation=portrait \
208-
--device model=Nexus6,version=24,locale=en,orientation=portrait \
207+
--device model=Pixel2.arm,version=30,locale=en,orientation=portrait \
208+
--device model=MediumPhone.arm,version=26,locale=en,orientation=portrait \
209209
--timeout 900s \
210210
--project mapbox-search-android
211211

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog for the Mapbox Search SDK for Android
22

3+
## 2.12.0
4+
5+
### New features
6+
- Added support for retrieving multiple search results at once in the `DetailsApi`.
7+
- Added new properties `PlaceAutocompleteSuggestion.categoryIds`, `PlaceAutocompleteResult.categoryIds`, and `PlaceAutocompleteResult.boundingBox`.
8+
9+
### Mapbox dependencies
10+
- Search Native SDK `2.12.0`
11+
- Common SDK `24.12.0`
12+
13+
14+
315
## 2.12.0-rc.1
416

517
### Mapbox dependencies

MapboxSearch/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ android.enableJetifier=false
2121
kotlin.code.style=official
2222

2323
# SDK version attributes
24-
VERSION_NAME=2.12.0-rc.1
24+
VERSION_NAME=2.12.0
2525

2626
# Artifact attributes
2727
mapboxArtifactUserOrg=mapbox

MapboxSearch/gradle/versions.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ ext {
4141

4242
pitest_version = '1.6.7'
4343

44-
mapbox_maps_version = '11.12.0-beta.1'
44+
mapbox_maps_version = '11.12.0'
4545
mapbox_turf_version = '6.15.0'
4646

47-
common_sdk_version = '24.12.0-rc.1'
47+
common_sdk_version = '24.12.0'
4848
mapbox_base_version = '0.8.0'
4949

50-
search_native_version = '2.12.0-rc.1'
50+
search_native_version = '2.12.0'
5151

5252
detekt_version = '1.19.0'
5353

MapboxSearch/place-autocomplete/api/api-metalava.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ package com.mapbox.search.autocomplete {
6363
@kotlinx.parcelize.Parcelize public final class PlaceAutocompleteResult implements android.os.Parcelable {
6464
method public com.mapbox.search.autocomplete.PlaceAutocompleteAddress? getAddress();
6565
method public Double? getAverageRating();
66+
method public com.mapbox.geojson.BoundingBox? getBoundingBox();
6667
method public java.util.List<java.lang.String>? getCategories();
68+
method public java.util.List<java.lang.String>? getCategoryIds();
6769
method public com.mapbox.geojson.Point getCoordinate();
6870
method public Double? getDistanceMeters();
6971
method public Double? getEtaMinutes();
@@ -81,7 +83,9 @@ package com.mapbox.search.autocomplete {
8183
method public String? getWebsite();
8284
property public final com.mapbox.search.autocomplete.PlaceAutocompleteAddress? address;
8385
property public final Double? averageRating;
86+
property public final com.mapbox.geojson.BoundingBox? boundingBox;
8487
property public final java.util.List<java.lang.String>? categories;
88+
property public final java.util.List<java.lang.String>? categoryIds;
8589
property public final com.mapbox.geojson.Point coordinate;
8690
property public final Double? distanceMeters;
8791
property public final Double? etaMinutes;
@@ -101,6 +105,7 @@ package com.mapbox.search.autocomplete {
101105

102106
@kotlinx.parcelize.Parcelize public final class PlaceAutocompleteSuggestion implements android.os.Parcelable {
103107
method public java.util.List<java.lang.String>? getCategories();
108+
method public java.util.List<java.lang.String>? getCategoryIds();
104109
method public com.mapbox.geojson.Point? getCoordinate();
105110
method public Double? getDistanceMeters();
106111
method public Double? getEtaMinutes();
@@ -110,6 +115,7 @@ package com.mapbox.search.autocomplete {
110115
method public java.util.List<com.mapbox.search.common.RoutablePoint>? getRoutablePoints();
111116
method public com.mapbox.search.autocomplete.PlaceAutocompleteType getType();
112117
property public final java.util.List<java.lang.String>? categories;
118+
property public final java.util.List<java.lang.String>? categoryIds;
113119
property public final com.mapbox.geojson.Point? coordinate;
114120
property public final Double? distanceMeters;
115121
property public final Double? etaMinutes;

MapboxSearch/place-autocomplete/api/place-autocomplete.api

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ public final class com/mapbox/search/autocomplete/PlaceAutocompleteResult : andr
9090
public fun equals (Ljava/lang/Object;)Z
9191
public final fun getAddress ()Lcom/mapbox/search/autocomplete/PlaceAutocompleteAddress;
9292
public final fun getAverageRating ()Ljava/lang/Double;
93+
public final fun getBoundingBox ()Lcom/mapbox/geojson/BoundingBox;
9394
public final fun getCategories ()Ljava/util/List;
95+
public final fun getCategoryIds ()Ljava/util/List;
9496
public final fun getCoordinate ()Lcom/mapbox/geojson/Point;
9597
public final fun getDistanceMeters ()Ljava/lang/Double;
9698
public final fun getEtaMinutes ()Ljava/lang/Double;
@@ -124,6 +126,7 @@ public final class com/mapbox/search/autocomplete/PlaceAutocompleteSuggestion :
124126
public fun describeContents ()I
125127
public fun equals (Ljava/lang/Object;)Z
126128
public final fun getCategories ()Ljava/util/List;
129+
public final fun getCategoryIds ()Ljava/util/List;
127130
public final fun getCoordinate ()Lcom/mapbox/geojson/Point;
128131
public final fun getDistanceMeters ()Ljava/lang/Double;
129132
public final fun getEtaMinutes ()Ljava/lang/Double;

MapboxSearch/place-autocomplete/src/androidTest/java/com/mapbox/search/autocomplete/PlaceAutocompleteIntegrationTest.kt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,22 @@ internal class PlaceAutocompleteIntegrationTest {
188188
)
189189
assertEquals("restaurant", suggestion.makiIcon)
190190
assertEquals(PlaceAutocompleteType.Poi, suggestion.type)
191-
assertEquals(listOf("food", "food and drink", "coffee shop", "coffee", "cafe", "bakery", "teahouse"), suggestion.categories)
191+
assertEquals(
192+
listOf("food", "food and drink", "coffee shop", "coffee", "cafe", "bakery", "teahouse"),
193+
suggestion.categories,
194+
)
195+
assertEquals(
196+
listOf(
197+
"food",
198+
"food_and_drink",
199+
"coffee_shop",
200+
"coffee",
201+
"cafe",
202+
"bakery",
203+
"teahouse"
204+
),
205+
suggestion.categoryIds
206+
)
192207

193208
val selectResponse = runBlocking {
194209
placeAutocomplete.select(suggestion)

MapboxSearch/place-autocomplete/src/main/java/com/mapbox/search/autocomplete/PlaceAutocompleteResult.kt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.mapbox.search.autocomplete
22

33
import android.os.Parcelable
4+
import com.mapbox.geojson.BoundingBox
45
import com.mapbox.geojson.Point
56
import com.mapbox.search.base.utils.extension.safeCompareTo
67
import com.mapbox.search.common.RoutablePoint
@@ -39,6 +40,12 @@ public class PlaceAutocompleteResult internal constructor(
3940
*/
4041
public val routablePoints: List<RoutablePoint>?,
4142

43+
/**
44+
* Optional bounding box that represents the geographical boundaries of a location,
45+
* e.g., a building.
46+
*/
47+
public val boundingBox: BoundingBox?,
48+
4249
/**
4350
* [Maki](https://github.com/mapbox/maki/) icon name for the place.
4451
*/
@@ -70,6 +77,12 @@ public class PlaceAutocompleteResult internal constructor(
7077
*/
7178
public val categories: List<String>?,
7279

80+
/**
81+
* Canonical POI category IDs. Always empty for non-POI suggestions.
82+
* @see type
83+
*/
84+
public val categoryIds: List<String>?,
85+
7386
/**
7487
* Business phone number.
7588
*/
@@ -120,12 +133,14 @@ public class PlaceAutocompleteResult internal constructor(
120133
if (name != other.name) return false
121134
if (coordinate != other.coordinate) return false
122135
if (routablePoints != other.routablePoints) return false
136+
if (boundingBox != other.boundingBox) return false
123137
if (makiIcon != other.makiIcon) return false
124138
if (!distanceMeters.safeCompareTo(other.distanceMeters)) return false
125139
if (!etaMinutes.safeCompareTo(other.etaMinutes)) return false
126140
if (address != other.address) return false
127141
if (type != other.type) return false
128142
if (categories != other.categories) return false
143+
if (categoryIds != other.categoryIds) return false
129144
if (phone != other.phone) return false
130145
if (website != other.website) return false
131146
if (reviewCount != other.reviewCount) return false
@@ -146,12 +161,14 @@ public class PlaceAutocompleteResult internal constructor(
146161
result = 31 * result + name.hashCode()
147162
result = 31 * result + coordinate.hashCode()
148163
result = 31 * result + (routablePoints?.hashCode() ?: 0)
164+
result = 31 * result + (boundingBox?.hashCode() ?: 0)
149165
result = 31 * result + (makiIcon?.hashCode() ?: 0)
150166
result = 31 * result + (distanceMeters?.hashCode() ?: 0)
151167
result = 31 * result + (etaMinutes?.hashCode() ?: 0)
152168
result = 31 * result + (address?.hashCode() ?: 0)
153169
result = 31 * result + type.hashCode()
154170
result = 31 * result + (categories?.hashCode() ?: 0)
171+
result = 31 * result + (categoryIds?.hashCode() ?: 0)
155172
result = 31 * result + (phone?.hashCode() ?: 0)
156173
result = 31 * result + (website?.hashCode() ?: 0)
157174
result = 31 * result + (reviewCount ?: 0)
@@ -172,12 +189,14 @@ public class PlaceAutocompleteResult internal constructor(
172189
"name='$name', " +
173190
"coordinate=$coordinate, " +
174191
"routablePoints=$routablePoints, " +
192+
"boundingBox=$boundingBox, " +
175193
"makiIcon=$makiIcon, " +
176194
"distanceMeters=$distanceMeters, " +
177195
"etaMinutes=$etaMinutes, " +
178196
"address=$address, " +
179197
"type=$type, " +
180198
"categories=$categories, " +
199+
"categoryIds=$categoryIds, " +
181200
"phone=$phone, " +
182201
"website=$website, " +
183202
"reviewCount=$reviewCount, " +

MapboxSearch/place-autocomplete/src/main/java/com/mapbox/search/autocomplete/PlaceAutocompleteResultFactory.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ internal class PlaceAutocompleteResultFactory {
2828
etaMinutes = etaMinutes,
2929
type = type,
3030
categories = categories,
31+
categoryIds = categoryIds,
3132
underlying = PlaceAutocompleteSuggestion.Underlying.Suggestion(suggestion)
3233
)
3334
}
@@ -48,6 +49,7 @@ internal class PlaceAutocompleteResultFactory {
4849
etaMinutes = etaMinutes,
4950
type = type,
5051
categories = categories,
52+
categoryIds = categoryIds,
5153
underlying = PlaceAutocompleteSuggestion.Underlying.Result(result)
5254
)
5355
}
@@ -81,12 +83,14 @@ internal class PlaceAutocompleteResultFactory {
8183
name = name,
8284
coordinate = coordinate,
8385
routablePoints = routablePoints?.map { it.mapToPlatform() },
86+
boundingBox = bbox,
8487
makiIcon = makiIcon,
8588
distanceMeters = distanceMeters,
8689
etaMinutes = etaMinutes,
8790
address = createPlaceAutocompleteAddress(this),
8891
type = type,
8992
categories = categories,
93+
categoryIds = categoryIds,
9094
phone = metadata?.phone,
9195
website = metadata?.website,
9296
reviewCount = metadata?.reviewCount,

MapboxSearch/place-autocomplete/src/main/java/com/mapbox/search/autocomplete/PlaceAutocompleteSuggestion.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ public class PlaceAutocompleteSuggestion internal constructor(
6060
*/
6161
public val categories: List<String>?,
6262

63+
/**
64+
* Canonical POI category IDs. Always empty for non-POI suggestions.
65+
* @see type
66+
*/
67+
public val categoryIds: List<String>?,
68+
6369
/**
6470
* Underlying data on which this [PlaceAutocompleteSuggestion] is based.
6571
*/
@@ -85,6 +91,7 @@ public class PlaceAutocompleteSuggestion internal constructor(
8591
if (!etaMinutes.safeCompareTo(other.etaMinutes)) return false
8692
if (type != other.type) return false
8793
if (categories != other.categories) return false
94+
if (categoryIds != other.categoryIds) return false
8895

8996
return true
9097
}
@@ -102,6 +109,7 @@ public class PlaceAutocompleteSuggestion internal constructor(
102109
result = 31 * result + (etaMinutes?.hashCode() ?: 0)
103110
result = 31 * result + type.hashCode()
104111
result = 31 * result + (categories?.hashCode() ?: 0)
112+
result = 31 * result + (categoryIds?.hashCode() ?: 0)
105113
return result
106114
}
107115

@@ -118,7 +126,8 @@ public class PlaceAutocompleteSuggestion internal constructor(
118126
"distanceMeters=$distanceMeters, " +
119127
"etaMinutes=$etaMinutes, " +
120128
"type=$type, " +
121-
"categories=$categories" +
129+
"categories=$categories, " +
130+
"categoryIds=$categoryIds" +
122131
")"
123132
}
124133

0 commit comments

Comments
 (0)