Skip to content

Commit 1666c0d

Browse files
committed
added feature list explanation
1 parent 408ac25 commit 1666c0d

File tree

2 files changed

+34
-21
lines changed

2 files changed

+34
-21
lines changed

app/src/main/java/com/lcl/lclmeasurementtool/ui/SettingsView.kt

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@ fun SettingsDialog(
3636
) {
3737

3838
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+
) {
3954
AlertDialog(
4055
onDismissRequest = { onDismiss() },
4156
title = {
@@ -47,7 +62,7 @@ fun SettingsDialog(
4762
text = {
4863
Divider()
4964
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)
5166
Divider(Modifier.padding(top = 8.dp))
5267
LinksPanel()
5368
VersionInfo()
@@ -136,7 +151,7 @@ private fun VersionInfo() {
136151
Modifier
137152
.fillMaxWidth()
138153
.padding(top = 10.dp), horizontalAlignment = Alignment.CenterHorizontally) {
139-
Text(text = BuildConfig.VERSION_NAME)
154+
Text(text = "${BuildConfig.VERSION_NAME} (${BuildConfig.FLAVOR})")
140155
TextSummary(text = "By Local Connectivity Lab @ UWCSE")
141156
}
142157
}
@@ -161,6 +176,10 @@ private fun LinksPanel() {
161176
url = TOU
162177
)
163178
}
179+
Spacer(Modifier.height(8.dp))
180+
Row {
181+
TextLink(text = "Feature List", url = FEATURE_LIST)
182+
}
164183
}
165184
}
166185
}
@@ -181,23 +200,16 @@ private fun TextLink(text: String, url: String) {
181200
)
182201
}
183202

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+
}
201213
//
202214
//@Preview
203215
//@Composable
@@ -214,4 +226,5 @@ private fun TextLink(text: String, url: String) {
214226

215227
/* ktlint-disable max-line-length */
216228
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"

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<string name="top_app_bar_action_icon_description">Settings</string>
6262
<string name="settings_title">Settings</string>
6363
<string name="loading">Loading…</string>
64-
<string name="privacy_policy">Privacy policy</string>
64+
<string name="privacy_policy">Privacy Policy</string>
6565
<string name="licenses">Licenses</string>
6666
<string name="brand_guidelines">Brand Guidelines</string>
6767
<string name="feedback">Feedback</string>

0 commit comments

Comments
 (0)