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

[ios] Basic support for CarPlay/phone mode switch #8130

Merged
merged 2 commits into from May 16, 2024

Conversation

MontakOleg
Copy link
Contributor

@MontakOleg MontakOleg commented May 9, 2024

Allow using OrganicMaps on iPhone while connected to CarPlay, see quick demo here – #763 (comment)

This is naive approach with just calling the code that usually get called on CarPlay connect/disconnect events, at first glance it works fine, but help with testing is welcome.

Resolves #763

Strings translation note:
I added new string carplay_continue_on_the_phone with translations from DeepL.

Also I copy-pasted carplay_used_on_the_phone_screen and carplay_continue_in_the_car from Android Auto as is, they don't need translation.

@rtsisyk
Copy link
Contributor

rtsisyk commented May 10, 2024

Wow, this is cool. @kirylkaveryn and I discussed that we want to start working on this feature just a few days ago. Thanks for contributing!

Copy link
Member

@biodranik biodranik left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

@kirylkaveryn @fabwu can you please review and test if it works on your devices?

data/strings/strings.txt Outdated Show resolved Hide resolved
@fabwu
Copy link
Contributor

fabwu commented May 10, 2024

This is great! Let me test this on my device and I'll give you feedback.

@fabwu

This comment was marked as resolved.

@AndrewShkrob
Copy link
Member

I've just done a quick test in my car. The switch between CarPlay and the phone works 🥳

I noticed that the zoom level is not correct if you switch back to the phone:

Hmm, we have the same DPI problem as in AA:
#5761
#5760

That's weird. I thought it should work fine with Metal

Copy link
Contributor

@kirylkaveryn kirylkaveryn left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this fix! It really works well except the resolution issue.

Would it be better to make this button more visible?

image

iphone/Maps/Classes/CarPlay/CarPlayService.swift Outdated Show resolved Hide resolved
iphone/Maps/Classes/MapViewController.mm Outdated Show resolved Hide resolved
@MontakOleg
Copy link
Contributor Author

@fabwu @AndrewShkrob thanks for pointing out about scale issue. updateAppearanceFromWindow() fixes the problem, I updated the code.

@biodranik
Copy link
Member

Thanks to everyone who participated! Is it ready for test/review/merge?

@MontakOleg
Copy link
Contributor Author

Thanks to everyone who participated! Is it ready for test/review/merge?

@biodranik I have a few questions (see threads), but in general did everything planned and waiting for review.

@fabwu

This comment was marked as resolved.

@MontakOleg
Copy link
Contributor Author

I might found one other bug. If you switch from CarPlay to the phone and disconnect CarPlay (closing the window in the Simulator), the arrow is in the upper left corner and not centered anymore.

@fabwu, thank you for one more report! Should be fixed now.

@fabwu

This comment was marked as resolved.

Copy link
Contributor

@fabwu fabwu left a comment

Choose a reason for hiding this comment

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

I tested these changes in my car and the switch works even within a navigation session. I can't help with the layout of the button so I have no more things to add here.

Signed-off-by: Oleg Montak <oleg.montak@gmail.com>
Signed-off-by: Oleg Montak <oleg.montak@gmail.com>
Copy link
Member

@biodranik biodranik left a comment

Choose a reason for hiding this comment

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

Awesome, this is a critical fix for many users, me included ) Thanks to everyone for implementing, testing and reviewing the PR. It is a great example of team work and the power of the community! I'm sooo happy to see it, and very grateful for your time spent on it ❤️ 🙏 🚀

@biodranik biodranik merged commit 93f4f40 into organicmaps:master May 16, 2024
9 checks passed
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.

[ios] Allow to use the app while CarPlay is active
6 participants