Manos Chorianopoulos

redesign market history part 2

...@@ -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>
......
This diff could not be displayed because it is too large.
...@@ -106,12 +106,14 @@ class MarketHistoryViewController: AnalysisChildViewController { ...@@ -106,12 +106,14 @@ class MarketHistoryViewController: AnalysisChildViewController {
106 } 106 }
107 107
108 override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 108 override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
109 - if (indexPath.section == 0) { 109 +// if (indexPath.section == 0) {
110 - return hasMessage ? (items.count > 0 ? 380.0 : 480.0) : 280 110 +// return hasMessage ? (items.count > 0 ? 380.0 : 480.0) : 280
111 +// }
112 +//
113 +// return 140.0
114 + return UITableView.automaticDimension
111 } 115 }
112 116
113 - return 140.0
114 - }
115 override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 117 override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
116 118
117 // header 119 // header
...@@ -147,4 +149,97 @@ class MarketHistoryViewController: AnalysisChildViewController { ...@@ -147,4 +149,97 @@ class MarketHistoryViewController: AnalysisChildViewController {
147 self.tableView.reloadData() 149 self.tableView.reloadData()
148 } 150 }
149 } 151 }
152 +
153 + override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
154 + if (section == 0){
155 + return nil
156 +
157 + } else if (section == 1) {
158 + if (self.items.count > 0) {
159 + let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 50))
160 +
161 + let viewBorder = UIView(frame: CGRect(x: 10, y: 0, width: view.frame.width-20, height: view.frame.height))
162 + viewBorder.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
163 +
164 + viewBorder.layer.cornerRadius = 16.5
165 + viewBorder.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, bottom right corner radius
166 +
167 + let viewInner = UIView(frame: CGRect(x: 1, y: 1, width: viewBorder.frame.width-2, height: viewBorder.frame.height-1))
168 + viewInner.backgroundColor = .white
169 +
170 + viewInner.layer.cornerRadius = 16.5
171 + viewInner.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, bottom right corner radius
172 +
173 + let titleLabel = UILabel(frame: CGRect(x: 20, y: 20, width: viewInner.frame.width - 40, height: 20))
174 + titleLabel.font = UIFont(name: "BTCosmo-Bold", size: 20)
175 + titleLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
176 + titleLabel.text = "Αναλυτικά"
177 +
178 + view.addSubview(viewBorder)
179 + viewBorder.addSubview(viewInner)
180 + viewInner.addSubview(titleLabel)
181 + return view
182 + } else {
183 + return nil
184 + }
185 +
186 +
187 + } else {
188 + return nil
189 + }
190 + }
191 +
192 + override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
193 + if (section == 0) {
194 + return 0.0
195 +
196 + } else if (section == 1) {
197 + if (self.items.count > 0) {
198 + return 50.0
199 + } else {
200 + return 0.0
201 + }
202 +
203 + } else {
204 + return 0.0
205 + }
206 + }
207 +
208 + override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
209 +// return CGFloat.leastNormalMagnitude
210 + if (section == 1 && self.items.count > 0) {
211 + return 20.0
212 + } else {
213 + return 0.0
214 + }
215 + }
216 +
217 + override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
218 + if (section == 1) {
219 + if (self.items.count > 0) {
220 + let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 30))
221 +
222 + let viewBorder = UIView(frame: CGRect(x: 10, y: 0, width: view.frame.width-20, height: view.frame.height))
223 + viewBorder.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
224 +
225 + viewBorder.layer.cornerRadius = 16.5
226 + viewBorder.layer.maskedCorners = [ .layerMinXMaxYCorner, .layerMaxXMaxYCorner] // bottom left, bottom right corner radius
227 +
228 + let viewInner = UIView(frame: CGRect(x: 1, y: 0, width: viewBorder.frame.width-2, height: viewBorder.frame.height-1))
229 + viewInner.backgroundColor = .white
230 +
231 + viewInner.layer.cornerRadius = 16.5
232 + viewInner.layer.maskedCorners = [ .layerMinXMaxYCorner, .layerMaxXMaxYCorner] // bottom left, bottom right corner radius
233 +
234 + view.addSubview(viewBorder)
235 + viewBorder.addSubview(viewInner)
236 + return view
237 + } else {
238 + return nil
239 + }
240 +
241 + } else {
242 + return nil
243 + }
244 + }
150 } 245 }
......
...@@ -100,11 +100,12 @@ class MarketSharingHistoryViewController: AnalysisChildViewController { ...@@ -100,11 +100,12 @@ class MarketSharingHistoryViewController: 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 MarketSharingHistoryViewController: AnalysisChildViewController { ...@@ -142,4 +143,97 @@ class MarketSharingHistoryViewController: 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 }
......