Skip to content

Commit

Permalink
[Bugfix] message banner hierarchy and rewards card size on smaller sc…
Browse files Browse the repository at this point in the history
…reens (#803)

* Fix message banner heirarchy bug and rewards card size on smaller screens

* Reading the width from the collection view's bounds
  • Loading branch information
Isabel Barrera committed Aug 16, 2019
1 parent cc7ff5e commit 2eb896e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ final class MessageBannerViewController: UIViewController, NibLoading {
let hiddenConstant = self.view.frame.height + (self.view.superview?.safeAreaInsets.bottom ?? 0)

if !isHidden {
self.view.superview?.bringSubviewToFront(self.view)

self.view.isHidden = isHidden

self.bottomConstraint?.constant = hiddenConstant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,12 @@ final class RewardsCollectionViewController: UICollectionViewController {
let adjustedContentInset = collectionView.adjustedContentInset

let topBottomSectionInsets = sectionInsets.top + sectionInsets.bottom
let leftRightSectionInsets = sectionInsets.left + sectionInsets.right
let topBottomContentInsets = adjustedContentInset.top + adjustedContentInset.bottom

let itemHeight = collectionView.frame.height - topBottomSectionInsets - topBottomContentInsets
let itemWidth = CheckoutConstants.RewardCard.Layout.width
let widthByBounds = collectionView.bounds.width - leftRightSectionInsets
let itemWidth = min(CheckoutConstants.RewardCard.Layout.width, widthByBounds)

return CGSize(width: itemWidth, height: itemHeight)
}
Expand Down

0 comments on commit 2eb896e

Please sign in to comment.