Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

Rev 1 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
//
2
//  HomeView.swift
3
//  twogetskills
4
//
5
//  Created by Efrain Yanez Recanatini on 6/17/22.
6
//
7
 
8
import SwiftUI
8 efrain 9
import NavigationStack
1 efrain 10
 
11
struct HomeView: View {
12
 
13
 
14
 
15
    @EnvironmentObject var appNavigation : AppNavigation
16
    @EnvironmentObject var networkMonitor : NetworkMonitor
8 efrain 17
 
18
 
1 efrain 19
 
20
    @State var showPopUp = false
21
 
22
    var body: some View {
23
 
8 efrain 24
        NavigationStackView {
1 efrain 25
 
26
 
27
        GeometryReader { geometry in
28
        VStack(spacing: 0) {
8 efrain 29
 
1 efrain 30
 
31
 
32
            HomeViewSubPage()
33
                .environmentObject(appNavigation)
34
                .environmentObject(networkMonitor)
35
 
8 efrain 36
            Spacer()
37
 
38
 
1 efrain 39
           Spacer()
40
            ZStack {
41
                if showPopUp {
42
                    PlusMenuView(showPopUp: self.$showPopUp,  widthAndHeight: geometry.size.width/7)
43
                        .offset(y: -geometry.size.height/6 )
44
                }
45
                HStack {
46
                    TabBarIconView(appNavigation: appNavigation, assignedPage: .mycapsules, width: geometry.size.width/5, height: geometry.size.height/28, systemIconName: "house", tabName: Config.LANG_TAB_BAR_BUTTON_MY_CAPSULES )
47
 
48
                    TabBarIconView(appNavigation: appNavigation, assignedPage: .topics, width: geometry.size.width/5, height: geometry.size.height/28, systemIconName: "books.vertical", tabName: Config.LANG_TAB_BAR_BUTTON_TOPICS)
49
 
50
 
51
                    ZStack {
52
                        Circle()
53
                            .foregroundColor(.white)
54
                            .frame(width: geometry.size.width/7, height: geometry.size.width/7)
55
                            .shadow(radius: 4)
56
                        Image(systemName: showPopUp ? "minus.circle.fill"  : "plus.circle.fill")
57
                            .resizable()
58
                            .aspectRatio(contentMode: .fit)
59
                            .frame(width: geometry.size.width/7-6 , height: geometry.size.width/7-6)
60
                            .foregroundColor(Color("color_tab_bar_button_plus_background" ))
61
                            .rotationEffect(Angle(degrees: showPopUp ? 0 : 90))
62
                    }
63
                        .offset(y: -geometry.size.height/8/2)
64
                        .onTapGesture {
65
                            withAnimation {
66
                                showPopUp.toggle()
67
                            }
68
                        }
69
                    TabBarIconView(appNavigation: appNavigation, assignedPage: .timeline, width: geometry.size.width/5, height: geometry.size.height/28, systemIconName: "clock.arrow.circlepath", tabName: Config.LANG_TAB_BAR_BUTTON_TIME_LINE)
70
 
71
                    TabBarIconView(appNavigation: appNavigation, assignedPage: .companies, width: geometry.size.width/5, height: geometry.size.height/28, systemIconName: "chart.bar", tabName: Config.LANG_TAB_BAR_BUTTON_PROGRESS)
72
                }
73
                //.frame(width: geometry.size.width, height: geometry.size.height/8)
74
                .frame(width: geometry.size.width, height: 60)
75
                .background(Color("color_tab_bar_background").shadow(radius: 2))
76
 
77
            }
78
 
79
 
8 efrain 80
        }
1 efrain 81
 
82
        }
83
 
84
 
85
 
86
        }
87
 
88
 
89
 
90
 
91
 
92
 
93
    }
94
}
95
 
96
 
97
 
98
 
99
struct HomeView_Previews: PreviewProvider {
100
    static var previews: some View {
101
        HomeView()
102
    }
103
}