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

Return localVideoView to original position after being pushed by right side bar #1799

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion NextcloudTalk/CallViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1615,10 +1615,19 @@ - (void)setSideBarVisible:(BOOL)visible animated:(BOOL)animated withCompletion:(
[self.collectionViewRightConstraint setConstant:rightConstraintConstant];
[self adjustTopBar];

CGPoint localVideoViewOrigin = self.localVideoView.frame.origin;
// Check if localVideoView needs to be moved to the right when sidebar is being closed
if (!visible) {
CGFloat sideBarWidthGap = self.collectionView.frame.size.width - kSidebarWidth;
if (localVideoViewOrigin.x > sideBarWidthGap) {
localVideoViewOrigin.x = self.localVideoView.superview.frame.size.width;
}
}

void (^animations)(void) = ^void() {
[self.titleView layoutIfNeeded];
[self.view layoutIfNeeded];
[self adjustLocalVideoPositionFromOriginPosition:self.localVideoView.frame.origin];
[self adjustLocalVideoPositionFromOriginPosition:localVideoViewOrigin];
};

void (^afterAnimations)(void) = ^void() {
Expand Down
Loading