googlemaps / android-places-ktx Goto Github PK
View Code? Open in Web Editor NEWKotlin extensions (KTX) for the Places SDK for Android
Home Page: https://developers.google.com/places/android-sdk/ktx
License: Apache License 2.0
Kotlin extensions (KTX) for the Places SDK for Android
Home Page: https://developers.google.com/places/android-sdk/ktx
License: Apache License 2.0
Is your feature request related to a problem? Please describe.
Developers should see a website for documentation for this repository.
Describe the solution you'd like
Documentation should be hosted on the gh-pages
branch of this repository.
Describe alternatives you've considered
N/A
Additional context
Similar implementation to what we have for the Maps KTX repository.
Is your feature request related to a problem? Please describe.
To help with learning how to use the library, the demo app should also add usage of another await*
extension function which does not require a function literal with receiver. Currently, the demo app only shows how to use one of the await functions (see: https://github.com/googlemaps/android-places-ktx/blob/36b727998b09c6adc76117ad321ac04d35b5c6d9/app/src/main/java/com/google/places/android/ktx/demo/PlacesSearchViewModel.kt).
Describe the solution you'd like
Use awaitFetchPhoto
both without an actions
param, and with it.
Describe alternatives you've considered
Do nothing.
Additional context
See #103 (comment)
The current version of dokka used by this library is quite old. Migrate usage to the newer dokka release.
As of Places SDK for Android v3.3.0, there are now two SDK versions: the existing Places SDK for Android and Places SDK for Android (New). New features from v3.3.0 will only be available on Places SDK for Android (New).
In v3.3.0, the New SDK only supports Java, so this ktx library will need to be updated when the New SDK supports Kotlin.
This guide for choosing which SDK version to use explains the differences and what's available through the New SDK. SDK version selection is done at client initialization.
For as long as both SDK versions support Kotlin, this ktx library should also support both.
Note that this also introduces a minimum Kotlin BOM dependency of 1.8.0.
Is your feature request related to a problem? Please describe.
awaitFetchPlace()
should allow customization of FetchPlaceRequest
. This was the case before but it was changed in #103 . FetchPlaceRequest.Builder
have additional setters method and not just setCancellationToken()
. At the moment it is not possible to set the session token anymore
Describe the solution you'd like
Revert part of #103
Remove jcenter() from the repository list and instead fetch dependencies from maven central.
PlacesClient.awaitFindCurrentPlace has an incorrect set of permissions in the @RequiresPermission annotation
The correct set are anyOf = [ permission.ACCESS_FINE_LOCATION, permission.ACCESS_COARSE_LOCATION ]
https://developers.google.com/places/android-sdk/ktx - here is the link for the article
android-places-kts
could update the places version to 3.3.0, update the typesFilter
and remove the experimental annotations now that Flow is stable.
Wrap the PlacesClient.searchByText api call in a suspending function to make it work better with Kotlin
Android volley version is not found in both google maven and maven central. Can we bump the volley version to 1.2.1? checked my internet connection and volley 1.2.1 works.
Right now, the await*
functions in PlacesClient.kt
don't support propagating cancellation to the corresponding Tasks
.
The builders for FetchPhotoRequest
, FetchPlaceRequest
, FindAutocompletePredictionsRequest
and feedbackFindCurrentPlaceRequest
each take a CancellationToken
, which can be used to cancel the underlying Tasks
if/when the suspending functions are cancelled.
Version 1.5.1
of kotlinx-coroutines-play-services
added some overloads of Task.await
to support bidirectional cancellation, which should provide some of the necessary plumbing.
I'm not entirely sure what the API should look like to support this, since the await*
functions currently take fully-built Requests
as opposed to the builders, so there isn't a direct opportunity for the library to set the CancellationToken
. Ideally the consumer of the library needs to know nothing about CancellationToken
s at all, so perhaps the existing await*
and builder functions are superseded by await*
functions that include the builder?
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
AutocompletePrediction.Builder
should have a DSL KTX alternative such as:
val prediction = autocompletePrediction("placeId") {
setFullText("Full text")
}
Describe alternatives you've considered
Do nothing
Additional context
This is missing whereas other models have DSL alternatives.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.