Skip to content

Commit

Permalink
Bug 1321661 - Fix small UI issues with ASPanel. (#2286) r=bkmunar
Browse files Browse the repository at this point in the history
  • Loading branch information
farhanpatel committed Dec 21, 2016
1 parent fdbfbcb commit ab1268b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Client/Frontend/Home/ActivityStreamPanel.swift
Expand Up @@ -192,11 +192,15 @@ extension ActivityStreamPanel {
extension ActivityStreamPanel {

override func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
// If the highlights section is empty. Don't show the header
if section == Section.Highlights.rawValue && highlights.isEmpty {
return 0
// Depending on if highlights are present. Hide certain section headers.
switch Section(section) {
case .Highlights:
return highlights.isEmpty ? 0 : Section(section).headerHeight
case .HighlightIntro:
return !highlights.isEmpty ? 0 : Section(section).headerHeight
case .TopSites:
return Section(section).headerHeight
}
return Section(section).headerHeight
}

override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
Expand Down Expand Up @@ -505,7 +509,7 @@ class ASHeaderView: UIView {
addSubview(titleLabel)

titleLabel.snp_makeConstraints { make in
make.edges.equalTo(self).offset(UIEdgeInsets(top: ASHeaderViewUX.TitleTopInset, left: ASHeaderViewUX.Insets, bottom: 0, right: -ASHeaderViewUX.Insets))
make.edges.equalTo(self).offset(UIEdgeInsets(top: ASHeaderViewUX.TitleTopInset, left: ASHeaderViewUX.Insets, bottom: 0, right: -ASHeaderViewUX.Insets)).priorityMedium()
}

let seperatorLine = UIView()
Expand Down
1 change: 1 addition & 0 deletions Client/Frontend/Home/ActivityStreamTopSitesCell.swift
Expand Up @@ -249,6 +249,7 @@ class ASHorizontalScrollCell: UITableViewCell {
super.layoutSubviews()
let layout = collectionView.collectionViewLayout as! HorizontalFlowLayout

gradientBG.frame = self.contentView.bounds
if gradientBG.superlayer == nil {
self.contentView.layer.insertSublayer(gradientBG, atIndex: 0)
}
Expand Down

0 comments on commit ab1268b

Please sign in to comment.