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