Manos Chorianopoulos

redesign SharingHistoryViewController

...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key> 7 <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 <dict> 8 <dict>
9 <key>orderHint</key> 9 <key>orderHint</key>
10 - <integer>0</integer> 10 + <integer>1</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key> 7 <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 <dict> 8 <dict>
9 <key>orderHint</key> 9 <key>orderHint</key>
10 - <integer>1</integer> 10 + <integer>0</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
...@@ -13,6 +13,9 @@ class AnalysisHeaderViewCell: UITableViewCell { ...@@ -13,6 +13,9 @@ class AnalysisHeaderViewCell: UITableViewCell {
13 @IBOutlet weak var itemImage: UIImageView! 13 @IBOutlet weak var itemImage: UIImageView!
14 @IBOutlet weak var titleLabel: UILabel! 14 @IBOutlet weak var titleLabel: UILabel!
15 @IBOutlet weak var emptyLabel: UILabel! 15 @IBOutlet weak var emptyLabel: UILabel!
16 + @IBOutlet weak var emptyLabelHeight: NSLayoutConstraint!
17 + @IBOutlet weak var emptyLabelTopSpace: NSLayoutConstraint!
18 + @IBOutlet weak var emptyLabelBottomSpace: NSLayoutConstraint!
16 19
17 // lifecycle 20 // lifecycle
18 override func awakeFromNib() { 21 override func awakeFromNib() {
...@@ -22,8 +25,8 @@ class AnalysisHeaderViewCell: UITableViewCell { ...@@ -22,8 +25,8 @@ class AnalysisHeaderViewCell: UITableViewCell {
22 // itemImage.image = UIImage(named: "ic_gift_circle_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) 25 // itemImage.image = UIImage(named: "ic_gift_circle_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
23 26
24 // title 27 // title
25 - titleLabel.textColor = UIColor(rgb: 0x435563) 28 +// titleLabel.textColor = UIColor(rgb: 0x435563)
26 - titleLabel.text = "Αναλυτικά:" 29 +// titleLabel.text = "Αναλυτικά:"
27 } 30 }
28 } 31 }
29 32
...@@ -32,8 +35,14 @@ extension AnalysisHeaderViewCell { ...@@ -32,8 +35,14 @@ extension AnalysisHeaderViewCell {
32 35
33 if (isEmpty == true) { 36 if (isEmpty == true) {
34 emptyLabel.isHidden = false 37 emptyLabel.isHidden = false
38 + emptyLabelHeight.constant = 18.5
39 +// emptyLabelTopSpace.constant = 30.0
40 + emptyLabelBottomSpace.constant = 10.0
35 } else { 41 } else {
36 emptyLabel.isHidden = true 42 emptyLabel.isHidden = true
43 + emptyLabelHeight.constant = 0.0
44 +// emptyLabelTopSpace.constant = 0.0
45 + emptyLabelBottomSpace.constant = 0.0
37 } 46 }
38 47
39 if (isMarket == true) { 48 if (isMarket == true) {
......
...@@ -9,14 +9,17 @@ import UIKit ...@@ -9,14 +9,17 @@ import UIKit
9 9
10 @objc public class AnalysisMoreViewCell: UITableViewCell { 10 @objc public class AnalysisMoreViewCell: UITableViewCell {
11 @IBOutlet weak var titleLabel: UILabel! 11 @IBOutlet weak var titleLabel: UILabel!
12 + @IBOutlet weak var arrowImage: UIImageView!
12 13
13 // lifecycle 14 // lifecycle
14 public override func awakeFromNib() { 15 public override func awakeFromNib() {
15 super.awakeFromNib() 16 super.awakeFromNib()
16 17
17 // title 18 // title
18 - titleLabel.font = UIFont(name: "PFSquareSansPro-Medium", size: 16) 19 + titleLabel.font = UIFont(name: "PeridotPE-Bold", size: 15)
19 - titleLabel.textColor = UIColor(rgb: 0x415564) 20 + titleLabel.textColor = UIColor(rgb: 0x212121)
20 titleLabel.text = "Δες Περισσότερα" 21 titleLabel.text = "Δες Περισσότερα"
22 +
23 + arrowImage.image = UIImage(named: "ic_down_dark_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
21 } 24 }
22 } 25 }
......
...@@ -100,11 +100,12 @@ class SharingHistoryViewController: AnalysisChildViewController { ...@@ -100,11 +100,12 @@ class SharingHistoryViewController: AnalysisChildViewController {
100 } 100 }
101 101
102 override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 102 override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
103 - if (indexPath.section == 0) { 103 +// if (indexPath.section == 0) {
104 - return hasMessage ? 380.0 : (items.count > 0 ? 280 : 380) 104 +// return hasMessage ? 380.0 : (items.count > 0 ? 280 : 380)
105 - } 105 +// }
106 - 106 +//
107 - return 140.0 107 +// return 140.0
108 + return UITableView.automaticDimension
108 } 109 }
109 110
110 override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 111 override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
...@@ -142,4 +143,97 @@ class SharingHistoryViewController: AnalysisChildViewController { ...@@ -142,4 +143,97 @@ class SharingHistoryViewController: AnalysisChildViewController {
142 self.tableView.reloadData() 143 self.tableView.reloadData()
143 } 144 }
144 } 145 }
146 +
147 + override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
148 + if (section == 0){
149 + return nil
150 +
151 + } else if (section == 1) {
152 + if (self.items.count > 0) {
153 + let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 50))
154 +
155 + let viewBorder = UIView(frame: CGRect(x: 10, y: 0, width: view.frame.width-20, height: view.frame.height))
156 + viewBorder.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
157 +
158 + viewBorder.layer.cornerRadius = 16.5
159 + viewBorder.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, bottom right corner radius
160 +
161 + let viewInner = UIView(frame: CGRect(x: 1, y: 1, width: viewBorder.frame.width-2, height: viewBorder.frame.height-1))
162 + viewInner.backgroundColor = .white
163 +
164 + viewInner.layer.cornerRadius = 16.5
165 + viewInner.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, bottom right corner radius
166 +
167 + let titleLabel = UILabel(frame: CGRect(x: 20, y: 20, width: viewInner.frame.width - 40, height: 20))
168 + titleLabel.font = UIFont(name: "BTCosmo-Bold", size: 20)
169 + titleLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
170 + titleLabel.text = "Αναλυτικά"
171 +
172 + view.addSubview(viewBorder)
173 + viewBorder.addSubview(viewInner)
174 + viewInner.addSubview(titleLabel)
175 + return view
176 + } else {
177 + return nil
178 + }
179 +
180 +
181 + } else {
182 + return nil
183 + }
184 + }
185 +
186 + override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
187 + if (section == 0) {
188 + return 0.0
189 +
190 + } else if (section == 1) {
191 + if (self.items.count > 0) {
192 + return 50.0
193 + } else {
194 + return 0.0
195 + }
196 +
197 + } else {
198 + return 0.0
199 + }
200 + }
201 +
202 + override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
203 +// return CGFloat.leastNormalMagnitude
204 + if (section == 1 && self.items.count > 0) {
205 + return 20.0
206 + } else {
207 + return 0.0
208 + }
209 + }
210 +
211 + override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
212 + if (section == 1) {
213 + if (self.items.count > 0) {
214 + let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 30))
215 +
216 + let viewBorder = UIView(frame: CGRect(x: 10, y: 0, width: view.frame.width-20, height: view.frame.height))
217 + viewBorder.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
218 +
219 + viewBorder.layer.cornerRadius = 16.5
220 + viewBorder.layer.maskedCorners = [ .layerMinXMaxYCorner, .layerMaxXMaxYCorner] // bottom left, bottom right corner radius
221 +
222 + let viewInner = UIView(frame: CGRect(x: 1, y: 0, width: viewBorder.frame.width-2, height: viewBorder.frame.height-1))
223 + viewInner.backgroundColor = .white
224 +
225 + viewInner.layer.cornerRadius = 16.5
226 + viewInner.layer.maskedCorners = [ .layerMinXMaxYCorner, .layerMaxXMaxYCorner] // bottom left, bottom right corner radius
227 +
228 + view.addSubview(viewBorder)
229 + viewBorder.addSubview(viewInner)
230 + return view
231 + } else {
232 + return nil
233 + }
234 +
235 + } else {
236 + return nil
237 + }
238 + }
145 } 239 }
......