Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

[CHORE] Refactor scroll to bottom #2320

Merged
merged 10 commits into from Nov 16, 2018
Merged

Conversation

filipealva
Copy link
Collaborator

@RocketChat/ios

NOTE: We still have some glitches, mainly when the keyboard is dismissed, this is due to the manual changes we are doing in order to manage the insets when the keyboard is being presented.

  • Use autolayout to guarantee the right position
  • Animate the layer using CoreAnimation since animating constraints would cause the entire collection view and its cells to layout again
  • Support keyboard

@filipealva filipealva added this to the 3.2.0 milestone Nov 16, 2018
@filipealva filipealva added this to In progress in Cycle 11: 11/05 ~ 12/05 via automation Nov 16, 2018
buttonScrollToBottom.heightAnchor.constraint(equalToConstant: buttonScrollToBottomSize),
buttonScrollToBottom.widthAnchor.constraint(equalToConstant: buttonScrollToBottomSize),
buttonScrollToBottomConstraint,
buttonScrollToBottom.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -15)

Choose a reason for hiding this comment

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

Line Length Violation: Line should be 120 characters or less: currently 123 characters (line_length)

buttonScrollToBottom.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(buttonScrollToBottom)
view.bringSubviewToFront(buttonScrollToBottom)
buttonScrollToBottomConstraint = buttonScrollToBottom.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 50)

Choose a reason for hiding this comment

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

Line Length Violation: Line should be 120 characters or less: currently 127 characters (line_length)

var keyboardHeight: CGFloat = 0
var buttonScrollToBottomConstraint: NSLayoutConstraint!
var buttonScrollToBottomLayerY: CGFloat {
return -composerView.layer.bounds.height - buttonScrollToBottomSize / 2 - collectionView.layoutMargins.top - keyboardHeight

Choose a reason for hiding this comment

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

Line Length Violation: Line should be 120 characters or less: currently 131 characters (line_length)

Copy link
Contributor

@rafaelks rafaelks left a comment

Choose a reason for hiding this comment

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

Looks really good to me! 👍

@rafaelks rafaelks merged commit db21022 into develop Nov 16, 2018
Cycle 11: 11/05 ~ 12/05 automation moved this from In progress to Done Nov 16, 2018
@rafaelks rafaelks deleted the chore/refactor-scroll-to-bottom branch November 16, 2018 18:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants