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

Extended logic for keyboard tracking, extending contentOffset and contentInsets overriding #454

Merged
merged 2 commits into from
Feb 21, 2018

Conversation

azimin
Copy link
Contributor

@azimin azimin commented Feb 21, 2018

No description provided.

@codecov-io
Copy link

codecov-io commented Feb 21, 2018

Codecov Report

Merging #454 into master will decrease coverage by 0.06%.
The diff coverage is 89.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #454      +/-   ##
==========================================
- Coverage   63.91%   63.84%   -0.07%     
==========================================
  Files          76       77       +1     
  Lines        3907     3925      +18     
==========================================
+ Hits         2497     2506       +9     
- Misses       1410     1419       +9
Impacted Files Coverage Δ
...ource/ChatController/ChatLayoutConfiguration.swift 100% <100%> (ø)
...ChatController/Collaborators/KeyboardTracker.swift 56.03% <71.42%> (-1.63%) ⬇️
...Source/ChatController/BaseChatViewController.swift 83% <91.3%> (-0.58%) ⬇️
...Chat Items/TextMessages/Views/TextBubbleView.swift 73.74% <0%> (-1.68%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0628fff...9842619. Read the comment docs.

}
}

open func updateContentViewOffset(_ newValue: CGPoint) {
Copy link
Contributor

@AntonPalich AntonPalich Feb 21, 2018

Choose a reason for hiding this comment

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

Why do you need this function? Is it the only function that should be called when you modify content offset? It's not used everywhere now, so, it's quite confusing. If you want to use it only when you adjust content insets then it's better to extract related code from adjustCollectionViewInsets into adjustCollectionViewOffset function and call it directly when needed. In this case, you won't need to pass any additional parameter to adjustCollectionViewInsets function

private func adjustCollectionViewInsets() {
public var allContentFits: Bool {
let inputHeightWithKeyboard = self.view.bounds.height - self.inputContainer.frame.minY
let newInsetTop = self.topLayoutGuide.length + self.layoutConfiguration.contentInsets.top
Copy link
Contributor

Choose a reason for hiding this comment

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

What does that mean "new"? Do you change insets here? Can you change names toinsetTop and insetBottom?


let inputIsAtBottom = self.view.bounds.maxY - self.inputContainer.frame.maxY <= 0
if allContentFits {
Copy link
Contributor

Choose a reason for hiding this comment

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

self.

@azimin azimin merged commit 06bed71 into master Feb 21, 2018
@AntonPalich AntonPalich deleted the task/extend-collection-behavour-logic branch March 10, 2018 20:32
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.

3 participants