Skip to content

Updated way to calculate the bottom content inset#762

Closed
davidvpe wants to merge 3 commits intoMessageKit:masterfrom
davidvpe:master
Closed

Updated way to calculate the bottom content inset#762
davidvpe wants to merge 3 commits intoMessageKit:masterfrom
davidvpe:master

Conversation

@davidvpe
Copy link

What does this implement/fix? Explain your changes.

Modified the way MessagesViewController calculate the Collection View bottom content inset when showing the keyboard

Does this close any currently open issues?

#761

Any relevant logs, error output, etc?

No

Any other comments?

No

Where has this been tested?

Devices/Simulators: All simulators + Real iPhone 7

iOS Version: 11.3

Swift Version: 4.0

MessageKit Version: 1.0.0

@davidvpe davidvpe changed the base branch from development to master July 14, 2018 13:44
@nathantannar4
Copy link
Member

Thanks for submitting this! We will try to get it in the next release

Sent with GitHawk

@SD10 SD10 requested a review from zhongwuzw July 14, 2018 20:31
Copy link
Member

@zhongwuzw zhongwuzw left a comment

Choose a reason for hiding this comment

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

It's ok.

@zhongwuzw
Copy link
Member

@davidvpe Thanks for your fix, can you add a CHANGELOG entry in the CHANGELOG.md?

@davidvpe
Copy link
Author

@zhongwuzw Changelog added!

### Fixed

- Fixed the way `MessagesViewController` calculates the bottom content inset when the keyboard is shown.
[#761](https://github.com/MessageKit/MessageKit/issues/761) by [@davidvpe](https://github.com/davidvpe).
Copy link
Member

Choose a reason for hiding this comment

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

How about: Fixed the calculation the bottom content inset for `MessagesCollectionView"?

Copy link
Member

Choose a reason for hiding this comment

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

This is also in the wrong section, it should be under Upcoming Release

@SD10
Copy link
Member

SD10 commented Jul 16, 2018

I need to test this before merging to make sure it doesn't mess up my company's app

@nathantannar4
Copy link
Member

@davidvpe I took a moment to test this out with the new example app I'm making an it looks like its still not sizing the bottom correctly

Its added more spacing than needed, see below

simulator screen shot - iphone x - 2018-07-16 at 18 38 11

@nathantannar4
Copy link
Member

It works on iPhone/iPhone+ models so I believe the issue is that you are not deducting the iPhoneXBottomInset

@zhongwuzw
Copy link
Member

I think it's the iPhoneX.

@davidvpe
Copy link
Author

I tried this on an iPhone X and is working just fine,

ezgif-5-865bb17f3b-2

@nathantannar4
Copy link
Member

@davidvpe How are you setting up the container controller?

@nathantannar4
Copy link
Member

@davidvpe as a safety measure, can you add an additionalBottomContentInset: CGFloat = 0 in MessagesViewController and when you calculate the new bottom inset add it.

Sent with GitHawk

@SD10
Copy link
Member

SD10 commented Jul 24, 2018

@nathantannar4 maybe we should add additionalTopInset as well? we had these in an earlier version of MessageKit, I forgot the reason why I removed them 🤔

@davidvpe
Copy link
Author

@nathantannar4 I am a bit caught up at work but as soon as I get some free time I'll add it.

@nathantannar4
Copy link
Member

@SD10 agreed we should have the additional top inset as well,

Thanks @davidvpe !

@davidvpe
Copy link
Author

davidvpe commented Jul 25, 2018

@nathantannar4 I see there is a messageCollectionViewBottomInset in MessagesViewController maybe I should just add it to the equation and that's it.

Edit: Turns out it is being subtracted already from the equation. Huh

@SD10
Copy link
Member

SD10 commented Jul 26, 2018

Yeah we really need to do a thorough analysis of what's going on here. It's such a struggle to get the inset working for everyone. We make changes for one app / device and break things in another

We should definitely expose some additionalBottomContentInset and additionalTopContentInset properties for people to fix things if they need to.

@nathantannar4
Copy link
Member

@davidvpe messageCollectionViewBottomInset is a convenience property that sets the bottom inset of the view and scroll indicator. It does not allow users to add additional inset.

@SD10 I think this is better than what we currently have. I can do a separate PR for adding additional top/bottom inset so devs can adjust those as needed and we shouldn't have to handle more of these issues.

Sent with GitHawk

@SD10
Copy link
Member

SD10 commented Jul 26, 2018

Yeah @nathantannar4 it's just pending me testing this change in our application. I have a tight deadline at work right now so I won't get to it till this weekend. We use Carthage as a dependency manager -- so testing MessageKit changes is a little inconvenient for me with this setup

@SD10
Copy link
Member

SD10 commented Aug 7, 2018

Hey @davidvpe, we really appreciate you getting the ball rolling on this PR 👍. However, it looks like #787 is becoming a better fit for MessageKit. I've just sent you an invite to the MessageKit organization. Thanks again 💯

@SD10 SD10 closed this Aug 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants