-
-
Notifications
You must be signed in to change notification settings - Fork 870
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
[android] [ios] Split the deactivate PP and switch fullscreen mode logic #8443
[android] [ios] Split the deactivate PP and switch fullscreen mode logic #8443
Conversation
Signed-off-by: Kiryl Kaveryn <[email protected]>
Signed-off-by: Kiryl Kaveryn <[email protected]>
Opened PP is always closed on long tap in any mode (search, route planning,...), correct? |
Yes. |
@kirylkaveryn made changes to Android. Introduced |
0b5bae3
to
3c678fa
Compare
Thank you very much! |
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.
Thanks! LGTM
@Jean-BaptisteC can you please help with testing opening/closing PP and switching full-screen mode in different scenarios on Android?
3c678fa
to
ab4b141
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.
Thanks! It works for Android too, right?
@@ -1239,7 +1239,7 @@ public void onPlacePageDeactivated() | |||
@SuppressWarnings("unused") | |||
public void onSwitchFullScreenMode() | |||
{ | |||
if ((mPanelAnimator && mPanelAnimator.isVisible()) ||UiUtils.isVisible(mSearchController.getToolbar())) | |||
if ((mPanelAnimator && mPanelAnimator.isVisible()) || UiUtils.isVisible(mSearchController.getToolbar())) |
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.
🤦 Sorry, it's Java, not C++. Let's return the comparison back, polish commits, and merge.
/home/runner/work/organicmaps/organicmaps/android/app/src/main/java/app/organicmaps/MwmActivity.java:1242: error: bad operand types for binary operator '&&'
if ((mPanelAnimator && mPanelAnimator.isVisible()) || UiUtils.isVisible(mSearchController.getToolbar()))
^
first type: PanelAnimator
second type: boolean
Added onSwitchFullScreenMode listener call from JNI Signed-off-by: S. Kozyr <[email protected]>
ed5b932
to
dd05917
Compare
@biodranik Fixed compilation errors. Squashed Android commits. Should fix actions |
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.
@strump @kirylkaveryn Д[з]якую!
Looks like on Android it doesn't work like it should:
If PP was open before a long tap then button disappear but PP stays - good. |
@pastk thanks for testing! Can you please revert this change and confirm the correct behavior without it? |
Before this PR it was almost the same, except that a long tap made PP disappear as well. |
On iOS it works fine. |
@strump could you please take a look? 🙏 |
TBH from a user point of view I don't understand what's the value of making PP behave independently from UI buttons? Maybe it'll be useful to a few pro users who don't want any buttons (but they will lose ability to search, switch layers, etc). IMHO a major downside is that if a user forgot how to leave the fullscreen mode then it'll be hard to find a way back (I anticipate extra support requests). While with the previous behavior any tap would have brought the UI back - easy. |
How would you see PP "behave dependent on UI buttons"? Now we display a one-time toast on how to return to full-screen mode. The value is:
|
Just like it worked before this PR. What was the issue with that way? For me PP is a part of UI also (it has actionable buttons), so this distinction may confuse users (why some controls are visible and others are not?).
Its easy to miss and/or forget especially if one doesn't use this feature often or long tapped by mistake..
Yes, but for me seems like a very niche use case considering potential "where did the buttons go? help!" support requests.. |
The problem with the previous implementation is that there was no actually fullscreen mode toggling but some hacks in the framework with this Maybe we should disable the fullscreen mode with the every tap (long or not, selecting a poi etc) on the screen? |
Yeap, fine, its good to improve the internals. I'm focusing on user-visible / behavior consequences.
Yeap, essentially it'll bring back the old behavior which I think is the optimal one. |
Ios worked in another way and only the long tap brought the controls back. @biodranik WDYT to show the controls on every action? I can fix it. |
Thanks, now I understand the problem. The old behavior on a long tap, with an open PP was:
The new behavior now (inconsistent and not familiar to our users) is:
The question is: which of the following options is better? Option 1: When full-screen mode is toggled with open PP (long tap), everything hides (PP + buttons) Option 2 (closer to the old behavior):
Which option do you think is better? Do you have other ideas? |
I prefer this one.
I don't think long tap will be popular for closing PP - it feels too tedious to do it this way, its better to learn to use the x button or swipe or back button (and its enough of options to do the same thing already :) |
Closes #8442
The old logic when the dismissing method should control not only the PP dismissing but also the fullscreen mode toggling contains too many responsibilities, and produces unexpected behavior (if the PP is opened and the user long taps on the map the PP will be dismissed but the side buttons not - ios, or deeplink handling hides the side buttons - ios), and hard to read and debug.
This PR continues #7876 and splits the
DeactivateMapSelection(bool notifyUI)
into theDeactivateMapSelection()
andSwitchFullScreen()
.The additional callback
m_onSwitchFullScreen = std::move(onSwitchFullScreen);
was added.Fullscreen mode switching is blocked when:
Todo:
Results:
![Simulator Screen Recording - iPhone 15 - 2024-06-11 at 16 37 12](https://private-user-images.githubusercontent.com/79797627/338584775-355eafc2-28a7-4216-8e10-bf0fffe55605.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk0MDAwODIsIm5iZiI6MTcxOTM5OTc4MiwicGF0aCI6Ii83OTc5NzYyNy8zMzg1ODQ3NzUtMzU1ZWFmYzItMjhhNy00MjE2LThlMTAtYmYwZmZmZTU1NjA1LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI2VDExMDMwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNhYmZmZWY5ZGRmMDcwMzhjNWQyNTdjMzY2YTA4MTM0YjcyNTAyNjg3YjQ3NGQ4ZDU2YjdmZDM3NDk4MTQzNjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.erkZFRWcZwRR75tByPR0hNl75RcpCIRJunf_1DjJ604)
enter/exit the fullscreen mode independently from the PP
entering the fullscreen mode is inactive during the navigation or searching
![Simulator Screen Recording - iPhone 15 - 2024-06-11 at 15 17 39](https://private-user-images.githubusercontent.com/79797627/338584576-4361ae19-1228-4142-a517-863edf7e18b8.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk0MDAwODIsIm5iZiI6MTcxOTM5OTc4MiwicGF0aCI6Ii83OTc5NzYyNy8zMzg1ODQ1NzYtNDM2MWFlMTktMTIyOC00MTQyLWE1MTctODYzZWRmN2UxOGI4LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI2VDExMDMwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUwYjgwYzg1YzNlNjVjNzA3NDI4ZGNhNWFmZDM5Y2M5ZDUzNWFjYTE2ZWI3MTA1OGY4MjA0ZTI0ZDc4YzNiODYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.vNJY1J7JkwmH11CGxNVYtSZUtwEuwj7vqJ-ffDEFVX0)