Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

Rev 35 | Rev 37 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 35 Rev 36
Línea 54... Línea 54...
54
                        print("slideActiveIndex: \(self.viewModel.slideActiveIndex)")
54
                        print("slideActiveIndex: \(self.viewModel.slideActiveIndex)")
55
                        self.completeSlide(position: self.viewModel.slideActiveIndex)
55
                        self.completeSlide(position: self.viewModel.slideActiveIndex)
Línea 56... Línea 56...
56
                        
56
                        
57
                        appData.slideUuidActive = self.viewModel.slides[self.viewModel.slideActiveIndex].uuid
57
                        appData.slideUuidActive = self.viewModel.slides[self.viewModel.slideActiveIndex].uuid
-
 
58
                        appData.save()
-
 
59
                        
58
                        appData.save()
60
                        self.positionVisible = self.viewModel.slideActiveIndex
59
                    }, label: {
61
                    }, label: {
-
 
62
                        Image(systemName: "arrow.left")
60
                        Image(systemName: "arrow.left")
63
                            .frame(width: 40.0, height: 40.0, alignment: .center)
Línea 61... Línea -...
61
                    })
-
 
-
 
64
                    })
62
                    
65
                    
63
                    .frame(width: 40.0, height: 40.0, alignment: .center)
66
 
64
                         .cornerRadius(/*@START_MENU_TOKEN@*/3.0/*@END_MENU_TOKEN@*/)
67
                         .cornerRadius(/*@START_MENU_TOKEN@*/3.0/*@END_MENU_TOKEN@*/)
65
                    .background(Color("color_button_gallery_background"))
68
                    .background(Color("color_button_gallery_background"))
66
                    .foregroundColor(Color("color_button_gallery_foreground"))
69
                    .foregroundColor(Color("color_button_gallery_foreground"))
Línea 75... Línea 78...
75
                        self.completeSlide(position: self.viewModel.slideActiveIndex)
78
                        self.completeSlide(position: self.viewModel.slideActiveIndex)
Línea 76... Línea 79...
76
                        
79
                        
77
                        appData.slideUuidActive = self.viewModel.slides[self.viewModel.slideActiveIndex].uuid
80
                        appData.slideUuidActive = self.viewModel.slides[self.viewModel.slideActiveIndex].uuid
Línea -... Línea 81...
-
 
81
                        appData.save()
-
 
82
                        
Línea 78... Línea 83...
78
                        appData.save()
83
                        self.positionVisible  = self.viewModel.slideActiveIndex
79
                        
84
                        
-
 
85
                        
80
                        
86
                    }, label: {
81
                    }, label: {
-
 
-
 
87
                        Image(systemName: "arrow.right")
82
                        Image(systemName: "arrow.right")
88
                            .frame(width: 40.0, height: 40.0, alignment: .center)
83
                    })
89
                    })
84
                    .frame(width: 40.0, height: 40.0, alignment: .center)
90
                    
85
                    .background(Color("color_button_gallery_background"))
91
                    .background(Color("color_button_gallery_background"))
Línea 117... Línea 123...
117
                    .background(networkMonitor.status == .disconnected ? Color("color_network_disconnected_background") : Color("color_app_bar_background"))
123
                    .background(networkMonitor.status == .disconnected ? Color("color_network_disconnected_background") : Color("color_app_bar_background"))
Línea 118... Línea 124...
118
            
124
            
Línea 119... Línea -...
119
            
-
 
-
 
125
            
-
 
126
                    Divider().background(networkMonitor.status == .disconnected ? Color("color_network_disconnected_background") : Color("color_app_bar_background"))
120
                    Divider().background(networkMonitor.status == .disconnected ? Color("color_network_disconnected_background") : Color("color_app_bar_background"))
127
                    
121
                    
128
                    VStack(spacing: 0)  {
122
                        
129
                        GeometryReader { geometry2 in
123
                    ScrollViewReader { scrollProxy in
130
                    ScrollViewReader { scrollProxy in
124
                        ScrollView(.horizontal) {
131
                        ScrollView(.horizontal) {
125
                            LazyHGrid(rows: rows, alignment: .center) {
132
                            LazyHGrid(rows: rows, alignment: .center) {
126
                                ForEach(0..<self.viewModel.slides.count) { index in
133
                                ForEach(0..<self.viewModel.slides.count) { index in
127
                                    CardGalleryView(
134
                                    CardGalleryView(
128
                                        slideUuid:  self.viewModel.slides[self.viewModel.slideActiveIndex].uuid
135
                                        slideUuid:  self.viewModel.slides[self.viewModel.slideActiveIndex].uuid
129
                                    )
136
                                    )
-
 
137
                                    .environmentObject(appNavigation)
-
 
138
                                    .frame(width: geometry2.size.width, height: geometry2.size.height)
-
 
139
                                    .id(index)
-
 
140
                                    //.border(Color.green, width: 1)
-
 
141
                                    .onAppear {
130
                                    .environmentObject(appNavigation)
142
                                        completeSlide(position: index)
131
                                    .frame(width: geometry.size.width, height: geometry.size.height)
143
                                        self.viewModel.slideActiveIndex = index
132
                                    .id(index)
-
 
133
                                }
144
                                    }
134
                            }
-
 
-
 
145
                                }
135
                            
146
                            }//.border(Color.black, width: 1)
136
                        }
147
                        }//.border(Color.red, width: 1)
Línea 137... Línea 148...
137
       
148
                            .frame(width: geometry2.size.width, height: geometry2.size.height)
138
                        .onChange(of: self.positionVisible) { id in
149
                        .onChange(of: self.positionVisible) { id in
Línea 151... Línea 162...
151
                                }
162
                                }
152
                                i += 1
163
                                i += 1
153
                            }
164
                            }
Línea 154... Línea 165...
154
                            
165
                            
-
 
166
                            self.viewModel.slideActiveIndex = position
155
                            self.viewModel.slideActiveIndex = position
167
                            completeSlide(position: position)
156
                            scrollProxy.scrollTo(position)
168
                            scrollProxy.scrollTo(position)
157
                        }
169
                        }
-
 
170
                    }
-
 
171
                        }
158
                    }
172
                    }
159
                }
173
                }
160
            }
174
            }
161
        }
175
        }