Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

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

Rev 32 Rev 33
Línea 38... Línea 38...
38
            capsuleTitle = capsule.name
38
            capsuleTitle = capsule.name
39
        }
39
        }
40
    }
40
    }
Línea 41... Línea -...
41
 
-
 
-
 
41
 
42
    
42
    
43
 
43
    @ViewBuilder
44
    var body: some View {
44
    var body: some View {
Línea 45... Línea 45...
45
        GeometryReader { geometry in
45
        GeometryReader { geometry in
46
        ZStack {
46
        ZStack {
-
 
47
            
47
            
48
            if self.viewModel.hasPrevious()  {
-
 
49
                Button(action: {
48
            if self.viewModel.hasPrevious()  {
50
                    print("Button previouse")
Línea 49... Línea 51...
49
                Button(action: {
51
                    self.viewModel.previous()
50
                    self.viewModel.previous()
52
                    print("slideActiveIndex: \(self.viewModel.slideActiveIndex)")
51
                    self.completeSlide(position: self.viewModel.slideActiveIndex)
53
                    self.completeSlide(position: self.viewModel.slideActiveIndex)
Línea 63... Línea 65...
63
                    .offset(x: -1 * ((geometry.size.width / 2) - 30), y :  25).zIndex(10000)
65
                    .offset(x: -1 * ((geometry.size.width / 2) - 30), y :  25).zIndex(10000)
64
            }
66
            }
Línea 65... Línea 67...
65
            
67
            
66
            if self.viewModel.hasNext() {
68
            if self.viewModel.hasNext() {
67
                Button(action: {
-
 
-
 
69
                Button(action: {
68
        
70
                    print("Button next")
-
 
71
                    self.viewModel.next()
69
                    self.viewModel.next()
72
                    print("slideActiveIndex: \(self.viewModel.slideActiveIndex)")
Línea 70... Línea 73...
70
                    self.completeSlide(position: self.viewModel.slideActiveIndex)
73
                    self.completeSlide(position: self.viewModel.slideActiveIndex)
71
                    
74
                    
Línea 113... Línea 116...
113
        
116
        
Línea 114... Línea 117...
114
        
117
        
115
                Divider().background(networkMonitor.status == .disconnected ? Color("color_network_disconnected_background") : Color("color_app_bar_background"))
118
                Divider().background(networkMonitor.status == .disconnected ? Color("color_network_disconnected_background") : Color("color_app_bar_background"))
116
                
119
                
117
                CardGalleryView(
120
                CardGalleryView(
-
 
121
                    slideUuid:  self.viewModel.slides[self.viewModel.slideActiveIndex].uuid
118
                    slideUuid:  self.viewModel.slides[0].uuid
122
                )
119
                )
123
                .environmentObject(appNavigation)
120
                .environmentObject(appNavigation)
124
                Text("slideActive : \(viewModel.slideActiveIndex)")
121
                .transition(.slide)
125
                .transition(.slide)
122
                .gesture(
126
                .gesture(
123
                    DragGesture(minimumDistance: 60).onEnded {
127
                    DragGesture(minimumDistance: 60).onEnded {
-
 
128
                        if $0.startLocation.x > $0.location.x {
124
                        if $0.startLocation.x > $0.location.x {
129
                            print("left")
-
 
130
                            if self.viewModel.hasPrevious()  {
125
                            print("left")
131
                                print("hasPrevious")
Línea 126... Línea 132...
126
                            if self.viewModel.hasPrevious()  {
132
                                self.viewModel.previous()
127
                                self.viewModel.previous()
133
                                print("slideActiveIndex: \(self.viewModel.slideActiveIndex)")
128
                                self.completeSlide(position: self.viewModel.slideActiveIndex)
134
                                self.completeSlide(position: self.viewModel.slideActiveIndex)
129
                                    
135
                                    
130
                                appData.slideUuidActive = self.viewModel.slides[self.viewModel.slideActiveIndex].uuid
136
                                appData.slideUuidActive = self.viewModel.slides[self.viewModel.slideActiveIndex].uuid
131
                                appData.save()
137
                                appData.save()
-
 
138
                            }
132
                            }
139
                        } else if $0.startLocation.x < $0.location.x {
-
 
140
                            print("right")
133
                        } else if $0.startLocation.x < $0.location.x {
141
                            if self.viewModel.hasNext() {
Línea 134... Línea 142...
134
                            print("right")
142
                                print("hasNext")
135
                            if self.viewModel.hasNext() {
143
                                self.viewModel.next()
136
                                self.viewModel.next()
144
                                print("slideActiveIndex: \(self.viewModel.slideActiveIndex)")