1
1
package app.fyreplace.fyreplace.ui.screens
2
2
3
+ import androidx.compose.foundation.clickable
3
4
import androidx.compose.foundation.layout.Arrangement
4
5
import androidx.compose.foundation.layout.Column
5
6
import androidx.compose.foundation.layout.fillMaxWidth
6
7
import androidx.compose.foundation.rememberScrollState
7
8
import androidx.compose.foundation.verticalScroll
8
9
import androidx.compose.material.icons.Icons
9
- import androidx.compose.material.icons.automirrored.filled.Logout
10
+ import androidx.compose.material.icons.automirrored.outlined.Logout
11
+ import androidx.compose.material.icons.outlined.Code
12
+ import androidx.compose.material.icons.outlined.Info
13
+ import androidx.compose.material.icons.outlined.Lock
14
+ import androidx.compose.material.icons.outlined.Shield
10
15
import androidx.compose.material3.Icon
16
+ import androidx.compose.material3.ListItem
17
+ import androidx.compose.material3.Text
11
18
import androidx.compose.runtime.Composable
12
19
import androidx.compose.runtime.getValue
13
20
import androidx.compose.ui.Modifier
@@ -24,8 +31,8 @@ import app.fyreplace.fyreplace.fakes.FakeEventBus
24
31
import app.fyreplace.fyreplace.fakes.FakeStoreResolver
25
32
import app.fyreplace.fyreplace.fakes.placeholder
26
33
import app.fyreplace.fyreplace.ui.theme.AppTheme
27
- import app.fyreplace.fyreplace.ui.views.settings.AvatarPreference
28
- import app.fyreplace.fyreplace.ui.views.settings.Preference
34
+ import app.fyreplace.fyreplace.ui.views.settings.AvatarListItem
35
+ import app.fyreplace.fyreplace.ui.views.settings.LinkListItem
29
36
import app.fyreplace.fyreplace.ui.views.settings.Section
30
37
import app.fyreplace.fyreplace.viewmodels.screens.SettingsViewModel
31
38
@@ -39,18 +46,45 @@ fun SettingsScreen(viewModel: SettingsViewModel = hiltViewModel()) {
39
46
) {
40
47
val currentUser by viewModel.currentUser.collectAsStateWithLifecycle()
41
48
42
- Section (stringResource(R .string.settings_header_profile )) {
43
- AvatarPreference (
49
+ Section (stringResource(R .string.settings_profile_header )) {
50
+ AvatarListItem (
44
51
user = currentUser,
45
52
onUpdateAvatar = viewModel::updateAvatar,
46
53
onRemoveAvatar = viewModel::removeAvatar
47
54
)
48
55
49
- Preference (
50
- title = stringResource(R .string.settings_logout),
51
- summary = stringResource(R .string.settings_logout_summary),
52
- icon = { Icon (Icons .AutoMirrored .Filled .Logout , null ) },
53
- onClick = viewModel::logout
56
+
57
+ ListItem (
58
+ headlineContent = { Text (stringResource(R .string.settings_profile_logout)) },
59
+ supportingContent = { Text (stringResource(R .string.settings_profile_logout_summary)) },
60
+ leadingContent = { Icon (Icons .AutoMirrored .Outlined .Logout , null ) },
61
+ modifier = Modifier .clickable(onClick = viewModel::logout)
62
+ )
63
+ }
64
+
65
+ Section (stringResource(R .string.settings_about_header)) {
66
+ LinkListItem (
67
+ title = stringResource(R .string.settings_about_website),
68
+ uri = stringResource(R .string.info_url_website),
69
+ icon = Icons .Outlined .Info
70
+ )
71
+
72
+ LinkListItem (
73
+ title = stringResource(R .string.settings_about_terms_of_service),
74
+ uri = stringResource(R .string.info_url_terms_of_service),
75
+ icon = Icons .Outlined .Shield
76
+ )
77
+
78
+ LinkListItem (
79
+ title = stringResource(R .string.settings_about_privacy_policy),
80
+ uri = stringResource(R .string.info_url_privacy_policy),
81
+ icon = Icons .Outlined .Lock
82
+ )
83
+
84
+ LinkListItem (
85
+ title = stringResource(R .string.settings_about_source_code),
86
+ uri = stringResource(R .string.info_url_source_code),
87
+ icon = Icons .Outlined .Code
54
88
)
55
89
}
56
90
}
0 commit comments