@@ -59,7 +59,9 @@ fun CountersScreen(
59
59
Scaffold (
60
60
topBar = {
61
61
Column (
62
- modifier = modifier.fillMaxWidth().background(MaterialTheme .colors.primary),
62
+ modifier = modifier
63
+ .fillMaxWidth()
64
+ .background(MaterialTheme .colors.primary),
63
65
) {
64
66
Row (
65
67
verticalAlignment = Alignment .CenterVertically ,
@@ -84,10 +86,18 @@ fun CountersScreen(
84
86
) { innerPadding ->
85
87
Box (modifier = modifier.padding(innerPadding)) {
86
88
val isRefreshing by countersViewModel.isRefreshing.collectAsState()
89
+
87
90
val patientsCount by countersViewModel.patientsCountStateFlow.collectAsState()
91
+ val isRefreshingPatientsCount by countersViewModel.isRefreshingPatientsCountStateFlow.collectAsState()
92
+
88
93
val homeTracingCount by countersViewModel.homeTracingCountStateFlow.collectAsState()
94
+ val isRefreshingHomeTracingCount by countersViewModel.isRefreshingHomeTracingCountStateFlow.collectAsState()
95
+
89
96
val phoneTracingCount by countersViewModel.phoneTracingCountStateFlow.collectAsState()
97
+ val isRefreshingPhoneTracingCount by countersViewModel.isRefreshingPhoneTracingCountStateFlow.collectAsState()
98
+
90
99
val appointmentsCount by countersViewModel.appointmentsCountStateFlow.collectAsState()
100
+ val isRefreshingAppointmentsCount by countersViewModel.isRefreshingAppointmentsCountStateFlow.collectAsState()
91
101
92
102
SwipeRefresh (
93
103
state = rememberSwipeRefreshState(isRefreshing),
@@ -97,20 +107,23 @@ fun CountersScreen(
97
107
LazyColumn {
98
108
item {
99
109
Card (
100
- modifier = Modifier .padding(8 .dp).fillMaxWidth().height(IntrinsicSize .Min ),
110
+ modifier = Modifier
111
+ .padding(8 .dp)
112
+ .fillMaxWidth()
113
+ .height(IntrinsicSize .Min ),
101
114
) {
102
115
Box (
103
116
modifier = Modifier .padding(8 .dp),
104
117
) {
105
118
Column {
106
119
Text (
107
- text = " Patients " ,
108
- style = MaterialTheme .typography.h4,
120
+ text = stringResource( R .string.patients_counter_label) ,
121
+ style = MaterialTheme .typography.h4.copy(color = Color . Gray ) ,
109
122
)
110
123
Spacer (modifier = Modifier .height(8 .dp))
111
124
Text (
112
125
text = " $patientsCount " ,
113
- style = MaterialTheme .typography.h2.copy(color = Color .Gray ) ,
126
+ style = if (isRefreshingPatientsCount) MaterialTheme .typography.h2.copy(color = Color .Gray .copy(alpha = 0.5F )) else MaterialTheme .typography.h2 ,
114
127
)
115
128
}
116
129
}
@@ -119,20 +132,23 @@ fun CountersScreen(
119
132
120
133
item {
121
134
Card (
122
- modifier = Modifier .padding(8 .dp).fillMaxWidth().height(IntrinsicSize .Min ),
135
+ modifier = Modifier
136
+ .padding(8 .dp)
137
+ .fillMaxWidth()
138
+ .height(IntrinsicSize .Min ),
123
139
) {
124
140
Box (
125
141
modifier = Modifier .padding(8 .dp),
126
142
) {
127
143
Column {
128
144
Text (
129
- text = " Home Tracing " ,
130
- style = MaterialTheme .typography.h4,
145
+ text = stringResource( R .string.home_tracing_conter_label) ,
146
+ style = MaterialTheme .typography.h4.copy(color = Color . Gray ) ,
131
147
)
132
148
Spacer (modifier = Modifier .height(8 .dp))
133
149
Text (
134
150
text = " $homeTracingCount " ,
135
- style = MaterialTheme .typography.h2.copy(color = Color .Gray ) ,
151
+ style = if (isRefreshingHomeTracingCount) MaterialTheme .typography.h2.copy(color = Color .Gray .copy(alpha = 0.5F )) else MaterialTheme .typography.h2 ,
136
152
)
137
153
}
138
154
}
@@ -141,20 +157,23 @@ fun CountersScreen(
141
157
142
158
item {
143
159
Card (
144
- modifier = Modifier .padding(8 .dp).fillMaxWidth().height(IntrinsicSize .Min ),
160
+ modifier = Modifier
161
+ .padding(8 .dp)
162
+ .fillMaxWidth()
163
+ .height(IntrinsicSize .Min ),
145
164
) {
146
165
Box (
147
166
modifier = Modifier .padding(8 .dp),
148
167
) {
149
168
Column {
150
169
Text (
151
- text = " Phone Tracing " ,
152
- style = MaterialTheme .typography.h4,
170
+ text = stringResource( R .string.phone_tracing_counter_label) ,
171
+ style = MaterialTheme .typography.h4.copy(color = Color . Gray ) ,
153
172
)
154
173
Spacer (modifier = Modifier .height(8 .dp))
155
174
Text (
156
175
text = " $phoneTracingCount " ,
157
- style = MaterialTheme .typography.h2.copy(color = Color .Gray ) ,
176
+ style = if (isRefreshingPhoneTracingCount) MaterialTheme .typography.h2.copy(color = Color .Gray .copy(alpha = 0.5F )) else MaterialTheme .typography.h2 ,
158
177
)
159
178
}
160
179
}
@@ -163,20 +182,23 @@ fun CountersScreen(
163
182
164
183
item {
165
184
Card (
166
- modifier = Modifier .padding(8 .dp).fillMaxWidth().height(IntrinsicSize .Min ),
185
+ modifier = Modifier
186
+ .padding(8 .dp)
187
+ .fillMaxWidth()
188
+ .height(IntrinsicSize .Min ),
167
189
) {
168
190
Box (
169
191
modifier = Modifier .padding(8 .dp),
170
192
) {
171
193
Column {
172
194
Text (
173
- text = " Appointments " ,
174
- style = MaterialTheme .typography.h4,
195
+ text = stringResource( R .string.appointments_counter_label) ,
196
+ style = MaterialTheme .typography.h4.copy(color = Color . Gray ) ,
175
197
)
176
198
Spacer (modifier = Modifier .height(8 .dp))
177
199
Text (
178
200
text = " $appointmentsCount " ,
179
- style = MaterialTheme .typography.h2.copy(color = Color .Gray ) ,
201
+ style = if (isRefreshingAppointmentsCount) MaterialTheme .typography.h2.copy(color = Color .Gray .copy(alpha = 0.5F )) else MaterialTheme .typography.h2 ,
180
202
)
181
203
}
182
204
}
0 commit comments