Coder Social home page Coder Social logo

googlemaps / android-places-ktx Goto Github PK

View Code? Open in Web Editor NEW
96.0 8.0 22.0 1.21 MB

Kotlin extensions (KTX) for the Places SDK for Android

Home Page: https://developers.google.com/places/android-sdk/ktx

License: Apache License 2.0

Kotlin 100.00%
kotlin ktx-library android places google-maps google-places language-extension

android-places-ktx's People

Contributors

0xera avatar arriolac avatar dependabot-preview[bot] avatar dependabot[bot] avatar dkhawk avatar googlemaps-bot avatar jpoehnelt avatar kikoso avatar louiscad avatar semantic-release-bot avatar wangela avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-places-ktx's Issues

awaitFetchPlace() should allow customization of FetchPlaceRequest.

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

Update demo app to use an await* function that doesn't require a function literal receiver

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)

Remove jcenter()

Remove jcenter() from the repository list and instead fetch dependencies from maven central.

Support bidirectional cancellation for suspending requests

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 CancellationTokens at all, so perhaps the existing await* and builder functions are superseded by await* functions that include the builder?

Support Places SDK for Android (New)

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.

Add DSL for AutocompletePrediction.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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.