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

Update target sdk and error screen #1010

Merged
merged 3 commits into from
Sep 6, 2023
Merged

Conversation

russellcullen
Copy link
Contributor

@russellcullen russellcullen commented Aug 22, 2023

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.

Copy link

@samanthaandrews samanthaandrews left a 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 👍

@russellcullen russellcullen changed the title Update target sdk Update target sdk and error screen Sep 5, 2023
@@ -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]
Copy link
Contributor Author

@russellcullen russellcullen Sep 6, 2023

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)

Copy link
Contributor

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 👏

Copy link
Contributor

@MalcolmMcFly MalcolmMcFly left a 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]
Copy link
Contributor

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]
Copy link
Contributor

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)
Copy link
Contributor

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()

@russellcullen russellcullen merged commit 336ea92 into develop Sep 6, 2023
1 check failed
@russellcullen russellcullen deleted the update-target-sdk branch September 6, 2023 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants