Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #4463 / #4464: Fixes the interaction of Favourites reordering wit…
Browse files Browse the repository at this point in the history
…h default browser modal (#4469)
  • Loading branch information
soner-yuksel authored Nov 5, 2021
1 parent 1cce427 commit f1c5010
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class NewTabCenteredCollectionViewCell<View: UIView>: UICollectionViewCell, Coll
view.snp.remakeConstraints {
$0.top.bottom.equalToSuperview()
$0.centerX.equalToSuperview()
$0.leading.greaterThanOrEqualToSuperview()
$0.trailing.lessThanOrEqualToSuperview()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import BraveShared

class NTPDefaultBrowserCalloutProvider: NSObject, NTPObservableSectionProvider {
var sectionDidChange: (() -> Void)?
private var defaultCalloutView = DefaultBrowserCalloutView()

private typealias DefaultBrowserCalloutCell = NewTabCenteredCollectionViewCell<DefaultBrowserCalloutView>

Expand Down Expand Up @@ -43,7 +44,10 @@ class NTPDefaultBrowserCalloutProvider: NSObject, NTPObservableSectionProvider {
layout collectionViewLayout: UICollectionViewLayout,
sizeForItemAt indexPath: IndexPath) -> CGSize {

return fittingSizeForCollectionView(collectionView, section: indexPath.section)
var size = fittingSizeForCollectionView(collectionView, section: indexPath.section)
size.height = defaultCalloutView.systemLayoutSizeFitting(size).height

return size
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
Expand Down

0 comments on commit f1c5010

Please sign in to comment.