Skip to content

Commit

Permalink
added feature list explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnzhou committed Apr 21, 2023
1 parent 408ac25 commit 1666c0d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 21 deletions.
53 changes: 33 additions & 20 deletions app/src/main/java/com/lcl/lclmeasurementtool/ui/SettingsView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ fun SettingsDialog(
) {

val showData = viewModel.shouldShowData.collectAsStateWithLifecycle()
SettingDialog(
onDismiss = onDismiss,
toggleShowData = viewModel::toggleShowData,
logout = viewModel::logout,
showData = showData.value
)
}

@Composable
fun SettingDialog(
onDismiss: () -> Unit,
toggleShowData: (Boolean) -> Unit,
logout: () -> Unit,
showData: Boolean
) {
AlertDialog(
onDismissRequest = { onDismiss() },
title = {
Expand All @@ -47,7 +62,7 @@ fun SettingsDialog(
text = {
Divider()
Column(Modifier.verticalScroll(rememberScrollState())) {
SettingsPanel(onSelectShowData = {viewModel.toggleShowData(!showData.value)}, onLogoutClicked = {viewModel.logout()}, showData = showData.value)
SettingsPanel(onSelectShowData = {toggleShowData(!showData)}, onLogoutClicked = {logout()}, showData = showData)
Divider(Modifier.padding(top = 8.dp))
LinksPanel()
VersionInfo()
Expand Down Expand Up @@ -136,7 +151,7 @@ private fun VersionInfo() {
Modifier
.fillMaxWidth()
.padding(top = 10.dp), horizontalAlignment = Alignment.CenterHorizontally) {
Text(text = BuildConfig.VERSION_NAME)
Text(text = "${BuildConfig.VERSION_NAME} (${BuildConfig.FLAVOR})")
TextSummary(text = "By Local Connectivity Lab @ UWCSE")
}
}
Expand All @@ -161,6 +176,10 @@ private fun LinksPanel() {
url = TOU
)
}
Spacer(Modifier.height(8.dp))
Row {
TextLink(text = "Feature List", url = FEATURE_LIST)
}
}
}
}
Expand All @@ -181,23 +200,16 @@ private fun TextLink(text: String, url: String) {
)
}

//@Preview
//@Composable
//private fun PreviewSettingsDialog() {
// NiaTheme {
// SettingsDialog(
// onDismiss = {},
// settingsUiState = Success(
// UserEditableSettings(
// brand = DEFAULT,
// darkThemeConfig = FOLLOW_SYSTEM
// )
// ),
// onChangeThemeBrand = { },
// onChangeDarkThemeConfig = { }
// )
// }
//}
@Preview
@Composable
private fun PreviewSettingsDialog() {
SettingDialog(
onDismiss = {},
toggleShowData = {},
logout = {},
showData = false
)
}
//
//@Preview
//@Composable
Expand All @@ -214,4 +226,5 @@ private fun TextLink(text: String, url: String) {

/* ktlint-disable max-line-length */
private const val PRIVACY_POLICY_URL = "https://seattlecommunitynetwork.org/"
private const val TOU = "https://seattlecommunitynetwork.org/"
private const val TOU = "https://seattlecommunitynetwork.org/"
private const val FEATURE_LIST = "https://docs.google.com/document/d/1cYU7ksEwtEyIS7jMeBPD1vM9Dz23Pzq0WJ8wqbnvjYQ/edit?usp=sharing"
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<string name="top_app_bar_action_icon_description">Settings</string>
<string name="settings_title">Settings</string>
<string name="loading">Loading…</string>
<string name="privacy_policy">Privacy policy</string>
<string name="privacy_policy">Privacy Policy</string>
<string name="licenses">Licenses</string>
<string name="brand_guidelines">Brand Guidelines</string>
<string name="feedback">Feedback</string>
Expand Down

0 comments on commit 1666c0d

Please sign in to comment.