Manos Chorianopoulos

redesign SharingHistoryViewController

......@@ -7,7 +7,7 @@
<key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
......
......@@ -7,7 +7,7 @@
<key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
......
......@@ -13,6 +13,9 @@ class AnalysisHeaderViewCell: UITableViewCell {
@IBOutlet weak var itemImage: UIImageView!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var emptyLabel: UILabel!
@IBOutlet weak var emptyLabelHeight: NSLayoutConstraint!
@IBOutlet weak var emptyLabelTopSpace: NSLayoutConstraint!
@IBOutlet weak var emptyLabelBottomSpace: NSLayoutConstraint!
// lifecycle
override func awakeFromNib() {
......@@ -22,8 +25,8 @@ class AnalysisHeaderViewCell: UITableViewCell {
// itemImage.image = UIImage(named: "ic_gift_circle_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
// title
titleLabel.textColor = UIColor(rgb: 0x435563)
titleLabel.text = "Αναλυτικά:"
// titleLabel.textColor = UIColor(rgb: 0x435563)
// titleLabel.text = "Αναλυτικά:"
}
}
......@@ -32,8 +35,14 @@ extension AnalysisHeaderViewCell {
if (isEmpty == true) {
emptyLabel.isHidden = false
emptyLabelHeight.constant = 18.5
// emptyLabelTopSpace.constant = 30.0
emptyLabelBottomSpace.constant = 10.0
} else {
emptyLabel.isHidden = true
emptyLabelHeight.constant = 0.0
// emptyLabelTopSpace.constant = 0.0
emptyLabelBottomSpace.constant = 0.0
}
if (isMarket == true) {
......
......@@ -9,14 +9,17 @@ import UIKit
@objc public class AnalysisMoreViewCell: UITableViewCell {
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var arrowImage: UIImageView!
// lifecycle
public override func awakeFromNib() {
super.awakeFromNib()
// title
titleLabel.font = UIFont(name: "PFSquareSansPro-Medium", size: 16)
titleLabel.textColor = UIColor(rgb: 0x415564)
titleLabel.font = UIFont(name: "PeridotPE-Bold", size: 15)
titleLabel.textColor = UIColor(rgb: 0x212121)
titleLabel.text = "Δες Περισσότερα"
arrowImage.image = UIImage(named: "ic_down_dark_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
}
}
......
......@@ -100,11 +100,12 @@ class SharingHistoryViewController: AnalysisChildViewController {
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if (indexPath.section == 0) {
return hasMessage ? 380.0 : (items.count > 0 ? 280 : 380)
}
return 140.0
// if (indexPath.section == 0) {
// return hasMessage ? 380.0 : (items.count > 0 ? 280 : 380)
// }
//
// return 140.0
return UITableView.automaticDimension
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
......@@ -142,4 +143,97 @@ class SharingHistoryViewController: AnalysisChildViewController {
self.tableView.reloadData()
}
}
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if (section == 0){
return nil
} else if (section == 1) {
if (self.items.count > 0) {
let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 50))
let viewBorder = UIView(frame: CGRect(x: 10, y: 0, width: view.frame.width-20, height: view.frame.height))
viewBorder.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
viewBorder.layer.cornerRadius = 16.5
viewBorder.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, bottom right corner radius
let viewInner = UIView(frame: CGRect(x: 1, y: 1, width: viewBorder.frame.width-2, height: viewBorder.frame.height-1))
viewInner.backgroundColor = .white
viewInner.layer.cornerRadius = 16.5
viewInner.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, bottom right corner radius
let titleLabel = UILabel(frame: CGRect(x: 20, y: 20, width: viewInner.frame.width - 40, height: 20))
titleLabel.font = UIFont(name: "BTCosmo-Bold", size: 20)
titleLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
titleLabel.text = "Αναλυτικά"
view.addSubview(viewBorder)
viewBorder.addSubview(viewInner)
viewInner.addSubview(titleLabel)
return view
} else {
return nil
}
} else {
return nil
}
}
override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if (section == 0) {
return 0.0
} else if (section == 1) {
if (self.items.count > 0) {
return 50.0
} else {
return 0.0
}
} else {
return 0.0
}
}
override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
// return CGFloat.leastNormalMagnitude
if (section == 1 && self.items.count > 0) {
return 20.0
} else {
return 0.0
}
}
override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
if (section == 1) {
if (self.items.count > 0) {
let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 30))
let viewBorder = UIView(frame: CGRect(x: 10, y: 0, width: view.frame.width-20, height: view.frame.height))
viewBorder.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
viewBorder.layer.cornerRadius = 16.5
viewBorder.layer.maskedCorners = [ .layerMinXMaxYCorner, .layerMaxXMaxYCorner] // bottom left, bottom right corner radius
let viewInner = UIView(frame: CGRect(x: 1, y: 0, width: viewBorder.frame.width-2, height: viewBorder.frame.height-1))
viewInner.backgroundColor = .white
viewInner.layer.cornerRadius = 16.5
viewInner.layer.maskedCorners = [ .layerMinXMaxYCorner, .layerMaxXMaxYCorner] // bottom left, bottom right corner radius
view.addSubview(viewBorder)
viewBorder.addSubview(viewInner)
return view
} else {
return nil
}
} else {
return nil
}
}
}
......