-
Notifications
You must be signed in to change notification settings - Fork 46
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
Conversation
Codecov Report
@@ 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.
|
6b855ba
to
e9e9bd3
Compare
There was a problem hiding this 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.
*/ | ||
inline fun GoogleMap.addGroundOverlay( | ||
optionsActions: GroundOverlayOptions.() -> Unit | ||
): GroundOverlay = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra line break?
* | ||
* @return the [GoogleMap] instance | ||
*/ | ||
suspend inline fun MapFragment.awaitMap(): GoogleMap = |
There was a problem hiding this comment.
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 🚀
There was a problem hiding this comment.
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 @@ | |||
/* |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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
Co-Authored-By: Sean Barbeau <sjbarbeau@gmail.com>
Co-Authored-By: Sean Barbeau <sjbarbeau@gmail.com>
# 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.
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.