-
Notifications
You must be signed in to change notification settings - Fork 21
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
Update target sdk and error screen #1010
Conversation
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.
Looks good to me, but an Android dev should probably give final approval 👍
@@ -292,7 +292,7 @@ class LocationFragment : Fragment(), LocationListener { | |||
val address: Address? | |||
|
|||
try { | |||
address = geocoder.getFromLocation(location.latitude, location.longitude, maxResults)[0] | |||
address = geocoder.getFromLocation(location.latitude, location.longitude, maxResults)!![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.
both these force unwraps are contained in generic try {} catch (e: Exception) {}
blocks so it's 'safe' to do. (as safe as if we had a null address here, the exception is caught either way)
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.
No biggie, just aiming for readability. Good to merge 👏
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.
Very minor non-blocking comments. This code probably won't be supported long term so take my suggestions here with a grain of salt.
@@ -230,7 +230,7 @@ class LocationFragment : Fragment(), LocationListener { | |||
|
|||
try { | |||
if (location != null) { | |||
address = geocoder.getFromLocation(location.latitude, location.longitude, maxResults)[0] | |||
address = geocoder.getFromLocation(location.latitude, location.longitude, maxResults)!![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.
Might be more readable like address = geocoder.getFromLocation(location.latitude, location.longitude, maxResults).first()
@@ -292,7 +292,7 @@ class LocationFragment : Fragment(), LocationListener { | |||
val address: Address? | |||
|
|||
try { | |||
address = geocoder.getFromLocation(location.latitude, location.longitude, maxResults)[0] | |||
address = geocoder.getFromLocation(location.latitude, location.longitude, maxResults)!![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.
Same as above, might be more readable like address = geocoder.getFromLocation(location.latitude, location.longitude, maxResults).first()
@@ -107,7 +107,7 @@ class LocationFragment : Fragment(), LocationListener { | |||
if (isNewYork || locationMock != null) { | |||
locationMock?.let { location -> | |||
activityModel.userLocationAddress = | |||
geocoder.getFromLocation(location.latitude, location.longitude, 1)[0] | |||
geocoder.getFromLocation(location.latitude, location.longitude, 1)?.get(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.
Might be more readable like: geocoder.getFromLocation(location.latitude, location.longitude, 1).first()
What's this do?
Update target and compile sdk to prep for Google policy changes. In addition, this also updates the error reporting screen since the current "Report Issue" button sends the report to a generic, untracked email, we're replacing that button with some text to direct the user to their local library help email.