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

Rework strategy to select/deselect items #1237

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

wutschel
Copy link
Collaborator

@wutschel wutschel commented Jan 19, 2025

Description

PR is motivated by a discussion in this forum post.

This PR unifies the selection/deselection behaviour for iPad and iPhone by not setting

panRecognizer.delaysTouchesBegan = YES;
panRecognizer.delaysTouchesEnded = YES;

in iPad's StackViewController. This is not required as sliding the views is not impacted, but an unwanted side effect of non-visible selections is gone.

Generally this PR reworks the strategy to show the selection of items. The selection is removed when showing an action sheet. The details for the selected item are anyway shown on top of the action sheet, on iPad there is a pointer to the touched origin and on iPhone the selection is most cases hidden behind the action sheet. Now, a selection is shown on tap and kept when entering a next level view, e.g. selecting a movie and entering the movie details. This visually emphasizes the selected item when showing two views side-by-side as it is done on iPad.

Summary for release notes

Improvement: Unify selection/deselection for iPad/iPhone

@wutschel wutschel marked this pull request as draft January 19, 2025 19:15
@wutschel wutschel force-pushed the improve_actionsheet branch 2 times, most recently from ae9a40e to d0044d0 Compare January 25, 2025 09:20
@wutschel wutschel changed the title Improvement: Deselect items when action sheet is closed Rework strategy to select/deselect items Jan 25, 2025
@wutschel wutschel marked this pull request as ready for review January 25, 2025 09:31
@wutschel wutschel force-pushed the improve_actionsheet branch 2 times, most recently from 4e7fdbb to b8b6069 Compare January 25, 2025 11:50
@wutschel
Copy link
Collaborator Author

@kambala-decapitator, based on your last message I switched the selection logic with commit "all reworked" to

  • not select at all when showing an action sheet, the origin of the action sheet is now less visible on iPad
  • select only when loading a next screen (to show the selected item when having two screen next to each other like on iPad)
  • deselect in viewWillAppear

@kambala-decapitator
Copy link
Collaborator

from the diff I don't see any obvious issues. The main point is whether UX on iPad improved or not :)

@wutschel
Copy link
Collaborator Author

I am fine going with the way you proposed. It is better and more consistent to what we had before. In case we get different feedback we can anyway revise this again. So, I will update this now and rebase it. Will be done in 10 mins.

This unifies behaviour between iPad and iPhone.
Remove selection when showing an action sheet. The details for the selected item are anyway shown on top of the action sheet, and on iPad there is a pointer to the touched origin.
At the same time select an item on tap and keep it selected when entering a next level view. This visually emphasizes the selected item when showing two view side-by-side as it is done on iPad.
The 2nd animated call of deselectRowAtIndexPath is obsolete. Indentation is corrected as well.
@wutschel wutschel force-pushed the improve_actionsheet branch from c85eb9d to ff6ac96 Compare January 28, 2025 17:29
@wutschel
Copy link
Collaborator Author

Updated code, PR description and rebased to master.

@wutschel wutschel removed the bugfix label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants