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

feat: Adding KTX to Maps SDK #21

Merged
merged 17 commits into from
Mar 30, 2020
Merged

feat: Adding KTX to Maps SDK #21

merged 17 commits into from
Mar 30, 2020

Conversation

arriolac
Copy link
Contributor

@arriolac arriolac commented Mar 26, 2020

Adding Kotlin extensions to the Maps SDK for Android. This is the 1st pass after going through these reference docs: https://developers.google.com/maps/documentation/android-sdk/reference

@barbeau this is ready for review. Once merged, we can push this out on maven as a preview.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 26, 2020
@codecov
Copy link

codecov bot commented Mar 26, 2020

Codecov Report

Merging #21 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@         Coverage Diff          @@
##           master   #21   +/-   ##
====================================
  Coverage       0%    0%           
====================================
  Files           7     7           
  Lines          93    93           
  Branches       17    17           
====================================
  Misses         93    93

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8373cec...84920b8. Read the comment docs.

@arriolac arriolac changed the title feat: Adding extensions to GoogleMap class feat: Adding KTX to Maps SDK Mar 26, 2020
@arriolac arriolac marked this pull request as ready for review March 30, 2020 18:15
@arriolac arriolac requested a review from barbeau March 30, 2020 18:15
Copy link
Contributor

@barbeau barbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM! A few comments in-line.

README.md Outdated Show resolved Hide resolved
*/
inline fun GoogleMap.addGroundOverlay(
optionsActions: GroundOverlayOptions.() -> Unit
): GroundOverlay =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line break?

README.md Outdated Show resolved Hide resolved
*
* @return the [GoogleMap] instance
*/
suspend inline fun MapFragment.awaitMap(): GoogleMap =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Can't wait to use this 🚀

Copy link
Contributor Author

@arriolac arriolac Mar 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a new annotation, MapsExperimentalFeature, which requires explicit opt-in to use this feature along with all suspend functions until we have stronger recommendations for how it can be used f8238d0.

@@ -0,0 +1,38 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen some projects put Kotlin class files under src/main/java/, and others under src/main/kotlin/. Just curious - is there a difference/preference for projects with only Kotlin source files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's primarily an organizational preference. The src/main/java path is what Android Studio creates for you by default when you create a new project. You can still add .kt files in a java dir and vice versa.

In most cases I prefer to intermix .kt and .java files in the same directory without having to create a kotlin path so that you don't have to keep track of consistent package names. However, having separate language-specific directories I think is good practice in the case of samples.

@@ -26,12 +26,12 @@ class PolygonOptionsTest {
@Test
fun testBuilder() {
val polygonOptions =
com.google.maps.android.ktx.buildPolygonOptions {
polygonOptions {
strokeWidth(1.0f)
strokeColor(Color.BLACK)
add(LatLng(0.0, 0.0))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If would be safer if these values weren't 0.0, given that it's the default value for double

arriolac and others added 4 commits March 30, 2020 14:00
Co-Authored-By: Sean Barbeau <sjbarbeau@gmail.com>
Co-Authored-By: Sean Barbeau <sjbarbeau@gmail.com>
@arriolac arriolac merged commit 3313167 into master Mar 30, 2020
@arriolac arriolac deleted the chris/maps_ktx_additions branch March 30, 2020 22:55
googlemaps-bot pushed a commit that referenced this pull request Apr 2, 2020
# 1.0.0 (2020-04-02)

### Bug Fixes

* Add dependencies of maps-utils-ktx in pom. ([#14](#14)) ([d2f14e4](d2f14e4))
* next repositories inside publishing ([38e8dbc](38e8dbc))
* Use api instead of implementation. ([#10](#10)) ([ac40f46](ac40f46))

### Features

* Adding ability to publish to maven central ([#5](#5)) ([5cfa6b1](5cfa6b1))
* Adding KTX to Maps SDK ([#21](#21)) ([3313167](3313167))
* Adding PolyUtil extensions to List<LatLng> ([#16](#16)) ([d4cd6f5](d4cd6f5))
* Create maps-ktx module ([#20](#20)) ([597a70c](597a70c))

### BREAKING CHANGES

* Moved KTX for utils from com.google.maps.android.ktx to
com.google.maps.android.ktx.utils to avoid package name conflicts with
the new maps-ktx module.

* refactor: move core extensions to separate package.

* Using shared version.

* Adjusting settings.gradle.
@googlemaps-bot
Copy link
Contributor

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement. released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants