-
Notifications
You must be signed in to change notification settings - Fork 677
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
Move top and bottom bars to the sides for compact heights. #182
Conversation
When faced with a compact height size class (landscape mode in phones) the bottom bar blocks a large portion of the screen and makes it very difficult to take pictures. This commit detects the current vertical size class, and if it is compact, moves the bottom and top bars to the size, which is in line with the way the iPhone's camera app works
@vickeryj, thanks for your PR! By analyzing the annotation information on this pull request, we identified @RamonGilabert and @zenangst to be potential reviewers |
@vickeryj this is great. But how about the gallery and the gesture to drag the gallery? |
Doh! I should have mentioned that in the PR. I disabled the gallery in compact height mode because it felt like the primary use case for landscape mode was taking pictures, and the gallery in landscape mode was somewhat awkward to use. The gallery could be restored, either opening in a vertical orientation, or sliding up from the bottom. I actually prefer to have it disabled, but if you think it's important to have it for this PR to get merged I can find some time to implement it, probably with an option to disable the gallery in compact height mode. |
@vickeryj I'm OK with your approach. My only concern is if we support gallery in landscape, then the scrolling, images and check indicator should look good in landscape also |
multiplier: 1, constant: 0)) | ||
} | ||
|
||
addConstraint(NSLayoutConstraint(item: doneButton, attribute: .CenterX, |
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.
I think a better way is to define 2 sets of constraints, and toggle their active
accordingly
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.
The problem I ran into with that approach is storage of references to the constraints. Since all these constraints are added in an extension, I don't have access to stored properties. I could put them in global state, but I figured adding and removing constraints this way was better than this option.
Another option would be to re-factor this code out of an extension and into the class implementations, allowing me to store references to the constraints in properties.
What do you think of those options? Do have a suggestion for a different option?
Closing for #186. |
When faced with a compact height size class (landscape mode
in phones) the bottom bar blocks a large portion of the screen
and makes it very difficult to take pictures.
This commit detects the current vertical size class, and if it
is compact, moves the bottom and top bars to the side, which is
in line with the way the iPhone's camera app works