Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

Rev 8 | Ir a la última revisión | | 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
9
 
10
struct HomeView: View {
11
 
12
 
13
 
14
    @EnvironmentObject var appNavigation : AppNavigation
15
    @EnvironmentObject var networkMonitor : NetworkMonitor
16
 
17
    @State var showPopUp = false
18
 
19
    var body: some View {
20
 
21
 
22
 
23
 
24
        GeometryReader { geometry in
25
        VStack(spacing: 0) {
26
            Spacer()
27
 
28
 
29
            HomeViewSubPage()
30
                .environmentObject(appNavigation)
31
                .environmentObject(networkMonitor)
32
 
33
 
34
 
35
           Spacer()
36
            ZStack {
37
                if showPopUp {
38
                    PlusMenuView(showPopUp: self.$showPopUp,  widthAndHeight: geometry.size.width/7)
39
                        .offset(y: -geometry.size.height/6 )
40
                }
41
                HStack {
42
                    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 )
43
 
44
                    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)
45
 
46
 
47
                    ZStack {
48
                        Circle()
49
                            .foregroundColor(.white)
50
                            .frame(width: geometry.size.width/7, height: geometry.size.width/7)
51
                            .shadow(radius: 4)
52
                        Image(systemName: showPopUp ? "minus.circle.fill"  : "plus.circle.fill")
53
                            .resizable()
54
                            .aspectRatio(contentMode: .fit)
55
                            .frame(width: geometry.size.width/7-6 , height: geometry.size.width/7-6)
56
                            .foregroundColor(Color("color_tab_bar_button_plus_background" ))
57
                            .rotationEffect(Angle(degrees: showPopUp ? 0 : 90))
58
                    }
59
                        .offset(y: -geometry.size.height/8/2)
60
                        .onTapGesture {
61
                            withAnimation {
62
                                showPopUp.toggle()
63
                            }
64
                        }
65
                    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)
66
 
67
                    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)
68
                }
69
                //.frame(width: geometry.size.width, height: geometry.size.height/8)
70
                .frame(width: geometry.size.width, height: 60)
71
                .background(Color("color_tab_bar_background").shadow(radius: 2))
72
 
73
            }
74
 
75
 
76
 
77
 
78
        }
79
 
80
 
81
 
82
        }
83
 
84
 
85
 
86
 
87
 
88
 
89
    }
90
}
91
 
92
 
93
 
94
 
95
struct HomeView_Previews: PreviewProvider {
96
    static var previews: some View {
97
        HomeView()
98
    }
99
}