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

Avoid keyboard obscuring last goals in gallery view #536

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

theospears
Copy link
Collaborator

Summary

Previously when using the goal filter, the keyboard would obscure the last goals in the list. Here we make the scrollview resize itself to only take up the section of screen above the keyboard so you can always scroll to the bottom.

This is an alternative approach to #503

Validation

Loaded the gallery view on device

  • Verified when keyboard is hidden the scroll view expands to take up the entire screen
  • Verified when the filter box is focused and the keyboard appears it is still possible to scroll down to last goal

@@ -147,7 +147,7 @@ class GalleryViewController: UIViewController, UICollectionViewDelegateFlowLayou
make.top.equalTo(self.searchBar.snp.bottom)
make.left.equalTo(self.view.safeAreaLayoutGuide.snp.leftMargin)
make.right.equalTo(self.view.safeAreaLayoutGuide.snp.rightMargin)
make.bottom.equalTo(0)
make.bottom.equalTo(self.collectionView!.keyboardLayoutGuide.snp.top)
Copy link
Contributor

Choose a reason for hiding this comment

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

👀 keyboardLayoutGuide

looks great! 👏
This one line using this iOS 15 feature sure beats out the manual 27 line approach in #503.

(bothers me that we have another use of collectionView! - we could just mark it as such at Line 23 and not have to do it anywhere else instead of doing it everywhere else, though obviously this is not directly related to adjusting the view's bottom to handle the keyboard)

@krugerk
Copy link
Contributor

krugerk commented Dec 2, 2024

This one then fixes #200

@theospears theospears merged commit dcae107 into master Dec 2, 2024
2 checks passed
@theospears theospears deleted the galleryview-keyboard-layout-guide branch December 2, 2024 06:34
theospears pushed a commit that referenced this pull request Dec 10, 2024
## Summary
space could have been allocated for a keyboard that was not shown when
returning to the gallery from a goal with the keyboard shown

follow-up to #536
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.

2 participants