Adds UI/viewmodel code to background kotlin sample #228
Conversation
e03dcc6
to
932c362
Compare
Hi all, Looks like you might not have started a review of this (which is totally ok). :) I'm going to add another commit that moves further into data binding (removes more code from Fragment), so you can wait on a starting the review. Feel free to submit comments if you already had them. Otherwise, I will remove you as reviewers and add you back when I have that commit submitted. Thanks! -Jeremy |
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.
small changes. once they're done feel free to merge it
if (intent.action == ACTION_PROCESS_UPDATES) { | ||
val result = LocationResult.extractResult(intent) | ||
if (result != null) { | ||
for (location in result.locations) { |
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.
result.locations.foreach...
also consider using LocationResult.extractResult(intent).apply{ ... }
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.
Switched!
I used let
instead for the null check, which I think is what you meant? I only ever use apply
for object configuration... but you probably have a jedi way for using it, so I will followup and fix in next PR if that is the case. :)
...roid/gms/location/sample/locationupdatesbackgroundkotlin/LocationUpdatesBroadcastReceiver.kt
Outdated
Show resolved
Hide resolved
...gle/android/gms/location/sample/locationupdatesbackgroundkotlin/ui/LocationUpdateFragment.kt
Outdated
Show resolved
Hide resolved
...va/com/google/android/gms/location/sample/locationupdatesbackgroundkotlin/ui/MainActivity.kt
Outdated
Show resolved
Hide resolved
...va/com/google/android/gms/location/sample/locationupdatesbackgroundkotlin/ui/MainActivity.kt
Outdated
Show resolved
Hide resolved
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.
Addressed all Florina's comments.
if (intent.action == ACTION_PROCESS_UPDATES) { | ||
val result = LocationResult.extractResult(intent) | ||
if (result != null) { | ||
for (location in result.locations) { |
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.
Switched!
I used let
instead for the null check, which I think is what you meant? I only ever use apply
for object configuration... but you probably have a jedi way for using it, so I will followup and fix in next PR if that is the case. :)
No description provided.