@@ -36,6 +36,21 @@ fun SettingsDialog(
36
36
) {
37
37
38
38
val showData = viewModel.shouldShowData.collectAsStateWithLifecycle()
39
+ SettingDialog (
40
+ onDismiss = onDismiss,
41
+ toggleShowData = viewModel::toggleShowData,
42
+ logout = viewModel::logout,
43
+ showData = showData.value
44
+ )
45
+ }
46
+
47
+ @Composable
48
+ fun SettingDialog (
49
+ onDismiss : () -> Unit ,
50
+ toggleShowData : (Boolean ) -> Unit ,
51
+ logout : () -> Unit ,
52
+ showData : Boolean
53
+ ) {
39
54
AlertDialog (
40
55
onDismissRequest = { onDismiss() },
41
56
title = {
@@ -47,7 +62,7 @@ fun SettingsDialog(
47
62
text = {
48
63
Divider ()
49
64
Column (Modifier .verticalScroll(rememberScrollState())) {
50
- SettingsPanel (onSelectShowData = {viewModel. toggleShowData(! showData.value )}, onLogoutClicked = {viewModel. logout()}, showData = showData.value )
65
+ SettingsPanel (onSelectShowData = {toggleShowData(! showData)}, onLogoutClicked = {logout()}, showData = showData)
51
66
Divider (Modifier .padding(top = 8 .dp))
52
67
LinksPanel ()
53
68
VersionInfo ()
@@ -136,7 +151,7 @@ private fun VersionInfo() {
136
151
Modifier
137
152
.fillMaxWidth()
138
153
.padding(top = 10 .dp), horizontalAlignment = Alignment .CenterHorizontally ) {
139
- Text (text = BuildConfig .VERSION_NAME )
154
+ Text (text = " ${ BuildConfig .VERSION_NAME } ( ${ BuildConfig . FLAVOR } ) " )
140
155
TextSummary (text = " By Local Connectivity Lab @ UWCSE" )
141
156
}
142
157
}
@@ -161,6 +176,10 @@ private fun LinksPanel() {
161
176
url = TOU
162
177
)
163
178
}
179
+ Spacer (Modifier .height(8 .dp))
180
+ Row {
181
+ TextLink (text = " Feature List" , url = FEATURE_LIST )
182
+ }
164
183
}
165
184
}
166
185
}
@@ -181,23 +200,16 @@ private fun TextLink(text: String, url: String) {
181
200
)
182
201
}
183
202
184
- // @Preview
185
- // @Composable
186
- // private fun PreviewSettingsDialog() {
187
- // NiaTheme {
188
- // SettingsDialog(
189
- // onDismiss = {},
190
- // settingsUiState = Success(
191
- // UserEditableSettings(
192
- // brand = DEFAULT,
193
- // darkThemeConfig = FOLLOW_SYSTEM
194
- // )
195
- // ),
196
- // onChangeThemeBrand = { },
197
- // onChangeDarkThemeConfig = { }
198
- // )
199
- // }
200
- // }
203
+ @Preview
204
+ @Composable
205
+ private fun PreviewSettingsDialog () {
206
+ SettingDialog (
207
+ onDismiss = {},
208
+ toggleShowData = {},
209
+ logout = {},
210
+ showData = false
211
+ )
212
+ }
201
213
//
202
214
// @Preview
203
215
// @Composable
@@ -214,4 +226,5 @@ private fun TextLink(text: String, url: String) {
214
226
215
227
/* ktlint-disable max-line-length */
216
228
private const val PRIVACY_POLICY_URL = " https://seattlecommunitynetwork.org/"
217
- private const val TOU = " https://seattlecommunitynetwork.org/"
229
+ private const val TOU = " https://seattlecommunitynetwork.org/"
230
+ private const val FEATURE_LIST = " https://docs.google.com/document/d/1cYU7ksEwtEyIS7jMeBPD1vM9Dz23Pzq0WJ8wqbnvjYQ/edit?usp=sharing"
0 commit comments