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

Add Kotlin Flow extensions to maps-ktx and maps-v3-ktx #111

Closed
2 tasks done
arriolac opened this issue Feb 16, 2021 · 1 comment · Fixed by #144
Closed
2 tasks done

Add Kotlin Flow extensions to maps-ktx and maps-v3-ktx #111

arriolac opened this issue Feb 16, 2021 · 1 comment · Fixed by #144
Labels
help wanted We'd love to have community involvement on this issue. released type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@arriolac
Copy link
Contributor

arriolac commented Feb 16, 2021

Overview

This is a tracking bug for adding Kotlin Flow support to methods within the maps-ktx and maps-v3-ktx packages where applicable.

Background

Version 2.1.0 of the KTX library added support for Kotlin flow through the introduction of the method cameraEvents(). As a continuation to this work, this issue is for adding extension methods returning Kotlin flows for methods that can be modeled as such. For example, set listener methods (e.g. setOnCameraIdleListener(), setOnMapClickListener(), and so on) are good candidates.

Design

While cameraEvents() added support for Kotlin flow, this method wrapped several set listener methods and should be improved upon to aid in predictability for the Kotlin flow extension APIs. Specifically, wrapped methods should have a unique Kotlin flow API. In other words, the relationship between the extended method and the extension methods should be one-to-one, and not one-to-many. Since cameraEvents() does not comply to this design, it should be removed or marked as deprecated in favor of the API convention described here.

Method Naming

  • The setOn prefix should be dropped as well as the Listener suffix. Additionally, Events should be added as a suffix
    • Examples:
      • setOnCameraIdleListener()cameraIdleEvents()
      • setOnMapClickListener()mapClickEvents()

Developing

Classes to Extend

  • GoogleMap
  • StreetViewPanorama

Contributing

Thinking of contributing? Awesome! Leave a comment below on what you'd like to add/work on so it's accounted for or any feedback on the design if you have any.

@arriolac arriolac added help wanted We'd love to have community involvement on this issue. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Feb 16, 2021
@arriolac arriolac changed the title Add Kotlin Flow extensions Add Kotlin Flow extensions to maps-ktx Jun 7, 2021
@arriolac arriolac changed the title Add Kotlin Flow extensions to maps-ktx Add Kotlin Flow extensions to maps-ktx and maps-v3-ktx Jun 7, 2021
@googlemaps-bot
Copy link
Contributor

🎉 This issue has been resolved in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We'd love to have community involvement on this issue. released type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants