Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Display server url in settings #122

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ private fun SettingsScreen(
AboutSection(
modifier = Modifier.fillMaxWidth(),
hasUserSelectedInstance = hasUserSelectedInstance,
serverUrl = serverUrl,
onOpenPrivacyPolicy = {
val link = URLBuilder(serverUrl).appendPathSegments("privacy").buildString()

Expand Down Expand Up @@ -334,6 +335,7 @@ private fun NotificationSection(modifier: Modifier, onOpenNotificationSettings:
private fun AboutSection(
modifier: Modifier,
hasUserSelectedInstance: Boolean,
serverUrl: String,
onRequestSelectServerInstance: () -> Unit,
onOpenPrivacyPolicy: () -> Unit,
onOpenImprint: () -> Unit,
Expand All @@ -352,6 +354,12 @@ private fun AboutSection(
}

if (hasUserSelectedInstance) {
PreferenceEntry(
modifier = Modifier.fillMaxWidth(),
text = stringResource(R.string.settings_server_url, serverUrl),
onClick = {}
)

PreferenceEntry(
modifier = Modifier.fillMaxWidth(),
text = stringResource(id = R.string.settings_about_privacy_policy),
Expand Down
1 change: 1 addition & 0 deletions feature/settings/src/main/res/values/settings_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

<string name="settings_about_section">About</string>
<string name="settings_server_specifics_information">Imprint and privacy policy depend on the server you have currently selected.</string>
<string name="settings_server_url">Server URL: %1$s</string>
<string name="settings_server_specifics_unavailable">Imprint and privacy policy are unavailable as you have not yet selected a server instance. Please select a server instance to view their privacy policy and imprint.</string>
<string name="settings_server_specifics_unavailable_select_instance_button">Select instance</string>
<string name="settings_about_privacy_policy">Privacy policy</string>
Expand Down
Loading