-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump search native; Search 2.6.1 release (#295)
* Bump search native * Details Api * Fixing warnings and useless checks * Make settings optional --------- Co-authored-by: mikeringrose <mike.ringrose@gmail.com>
- Loading branch information
1 parent
fa6269b
commit 5b34ddc
Showing
23 changed files
with
914 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
MapboxSearch/base/src/main/java/com/mapbox/search/base/ExperimentalMapboxSearchAPI.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.mapbox.search.base | ||
|
||
/** | ||
* This annotation marks the experimental state of the Mapbox Search SDK API. | ||
* This API is stable in nature, but it's likely that properties might be added or removed in the | ||
* future. | ||
* Any usage of a declaration annotated with `@ExperimentalMapboxSearchAPI` must be accepted | ||
* either by annotating that usage with the [OptIn] annotation, | ||
* e.g. `@OptIn(ExperimentalMapboxSearchAPI::class)`, or by using the compiler argument | ||
* `-Xopt-in=com.mapbox.search.base.ExperimentalMapboxSearchAPI`. | ||
*/ | ||
@Retention(value = AnnotationRetention.BINARY) | ||
@RequiresOptIn(level = RequiresOptIn.Level.ERROR) | ||
@Target( | ||
AnnotationTarget.CLASS, | ||
AnnotationTarget.FUNCTION, | ||
AnnotationTarget.PROPERTY, | ||
) | ||
annotation class ExperimentalMapboxSearchAPI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...arch/sample/src/main/java/com/mapbox/search/sample/api/DetailsApiKotlinExampleActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.mapbox.search.sample.api | ||
|
||
import android.os.Bundle | ||
import com.mapbox.search.AttributeSet | ||
import com.mapbox.search.ResponseInfo | ||
import com.mapbox.search.SearchResultCallback | ||
import com.mapbox.search.base.ExperimentalMapboxSearchAPI | ||
import com.mapbox.search.common.AsyncOperationTask | ||
import com.mapbox.search.details.DetailsApi | ||
import com.mapbox.search.details.DetailsApiSettings | ||
import com.mapbox.search.details.RetrieveDetailsOptions | ||
import com.mapbox.search.result.SearchResult | ||
import com.mapbox.search.sample.R | ||
|
||
@OptIn(ExperimentalMapboxSearchAPI::class) | ||
class DetailsApiKotlinExampleActivity : BaseKotlinExampleActivity() { | ||
|
||
override val titleResId: Int = R.string.action_open_details_api_kt_example | ||
|
||
private lateinit var detailsApi: DetailsApi | ||
private var task: AsyncOperationTask? = null | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
// Set your Access Token here if it's not already set in some other way | ||
// MapboxOptions.accessToken = "<my-access-token>" | ||
detailsApi = DetailsApi.create(DetailsApiSettings()) | ||
} | ||
|
||
override fun onDestroy() { | ||
task?.cancel() | ||
super.onDestroy() | ||
} | ||
|
||
override fun startExample() { | ||
task = detailsApi.retrieveDetails( | ||
mapboxId = "dXJuOm1ieHBvaTowZGY2MzE4Yi0wNGNjLTRkOTYtYTZmMy0yNmJmM2ZiODUyODU", | ||
options = RetrieveDetailsOptions(attributeSets = AttributeSet.values().toList()), | ||
callback = object : SearchResultCallback { | ||
override fun onResult(result: SearchResult, responseInfo: ResponseInfo) { | ||
logI("SearchApiExample", "Retrieve result:", result) | ||
onFinished() | ||
} | ||
|
||
override fun onError(e: Exception) { | ||
logE("SearchApiExample", "Retrieve error", e) | ||
onFinished() | ||
} | ||
} | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.