| 1 |
efrain |
1 |
import SwiftUI
|
|
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
struct TimeLineView: View {
|
|
|
6 |
@Environment(\.presentationMode)
|
|
|
7 |
var presentationMode: Binding
|
|
|
8 |
|
|
|
9 |
private let colorBackgroundTopic = UIColor(hex: Config.COLOR_BACKGROUND_TOPIC)
|
|
|
10 |
|
|
|
11 |
private let colorAppTextView = UIColor(hex: Config.COLOR_APP_TEXT_VIEW_TITLE)
|
|
|
12 |
|
|
|
13 |
private let colorAppBackground = UIColor(hex: Config.COLOR_APP_BAR)
|
|
|
14 |
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
private var viewModel : TimeLineViewModel = TimeLineViewModel()
|
|
|
18 |
|
|
|
19 |
let preference = Preference.sharedInstance
|
|
|
20 |
|
|
|
21 |
let config = [
|
|
|
22 |
GridItem(.flexible())
|
|
|
23 |
]
|
|
|
24 |
|
|
|
25 |
|
|
|
26 |
|
|
|
27 |
var body: some View {
|
|
|
28 |
GeometryReader { geometry in
|
|
|
29 |
VStack {
|
|
|
30 |
/**/
|
|
|
31 |
|
|
|
32 |
ScrollView {
|
|
|
33 |
ForEach(0..<self.viewModel.userlogs.count) { i in
|
|
|
34 |
|
|
|
35 |
TimeLinePointView(userLogModel: self.viewModel.userlogs[i])
|
|
|
36 |
.listRowInsets(.init()).frame(width: geometry.size.width, height: 70, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
|
|
|
37 |
.background(i == 0 || i == self.viewModel.userlogs.count - 1 ?
|
|
|
38 |
|
|
|
39 |
Color(colorAppBackground ?? .white)
|
|
|
40 |
:
|
|
|
41 |
|
|
|
42 |
Color(colorBackgroundTopic ?? .white))
|
|
|
43 |
}
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
//.listStyle(InsetListStyle())
|
|
|
47 |
|
|
|
48 |
.background(Color(colorBackgroundTopic ?? .white))
|
|
|
49 |
|
|
|
50 |
}
|
|
|
51 |
.background(Color(colorBackgroundTopic ?? .white))
|
|
|
52 |
.navigationTitle("Linea de Tiempo")
|
|
|
53 |
.navigationBarTitleDisplayMode(.inline)
|
|
|
54 |
.navigationBarBackButtonHidden(true)
|
|
|
55 |
}
|
|
|
56 |
}
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
|
|
|
60 |
struct TimeLineView_Previews: PreviewProvider {
|
|
|
61 |
static var previews: some View {
|
|
|
62 |
TimeLineView()
|
|
|
63 |
}
|
|
|
64 |
}
|
|
|
65 |
|
|
|
66 |
|
|
|
67 |
|
|
|
68 |
|
|
|
69 |
|
|
|
70 |
|