Proyectos de Subversion Iphone Microlearning

Rev

Autoría | Ultima modificación | Ver Log |

import SwiftUI



struct TimeLineView: View {
    @Environment(\.presentationMode)
       var presentationMode: Binding
    
    private let colorBackgroundTopic = UIColor(hex: Config.COLOR_BACKGROUND_TOPIC)
    
    private let colorAppTextView = UIColor(hex: Config.COLOR_APP_TEXT_VIEW_TITLE)

    private let colorAppBackground = UIColor(hex: Config.COLOR_APP_BAR)
    
    
    
    private var viewModel : TimeLineViewModel = TimeLineViewModel()
    
    let preference = Preference.sharedInstance
    
    let config = [
        GridItem(.flexible())
    ]
    
    
    
    var body: some View {
        GeometryReader { geometry in
             VStack {
                /**/
            
                ScrollView {
                    ForEach(0..<self.viewModel.userlogs.count) { i in

                        TimeLinePointView(userLogModel: self.viewModel.userlogs[i])
                            .listRowInsets(.init()).frame(width: geometry.size.width, height: 70, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
                            .background(i == 0 || i == self.viewModel.userlogs.count - 1 ?
                                            
                                            Color(colorAppBackground ?? .white)
                                            :
                                            
                                            Color(colorBackgroundTopic ?? .white))
                    }
                }
                
                //.listStyle(InsetListStyle())
                
                .background(Color(colorBackgroundTopic ?? .white))

            }
            .background(Color(colorBackgroundTopic ?? .white))
            .navigationTitle("Linea de Tiempo")
            .navigationBarTitleDisplayMode(.inline)
            .navigationBarBackButtonHidden(true)
        }
    }
}


struct TimeLineView_Previews: PreviewProvider {
    static var previews: some View {
        TimeLineView()
    }
}