@@ -84,150 +84,161 @@ fun AboutContent(
8484 verticalArrangement = Arrangement .Top ,
8585 horizontalAlignment = Alignment .Start
8686 ) {
87- Spacer (modifier = Modifier .height(24 .dp))
88-
89- // App description
90- Text (
91- text = stringResource(id = R .string.about_description),
92- style = MaterialTheme .typography.bodyLarge
93- )
87+ Spacer (modifier = Modifier .height(16 .dp))
9488
95- Spacer (modifier = Modifier .height(24 .dp))
96-
97- val websiteUrl = stringResource(id = R .string.about_promo_url)
98- Text (
99- text = websiteUrl,
100- style = MaterialTheme .typography.bodyMedium,
101- color = MaterialTheme .colorScheme.primary,
102- textDecoration = TextDecoration .Underline ,
103- modifier = Modifier .clickable {
104- openUrl(context, websiteUrl)
105- }
106- )
89+ // App description + website
90+ SectionCard {
91+ Text (
92+ text = stringResource(id = R .string.about_description),
93+ style = MaterialTheme .typography.bodyLarge
94+ )
95+ Spacer (modifier = Modifier .height(8 .dp))
96+ val websiteUrl = stringResource(id = R .string.about_promo_url)
97+ Text (
98+ text = websiteUrl,
99+ style = MaterialTheme .typography.bodyMedium,
100+ color = MaterialTheme .colorScheme.primary,
101+ textDecoration = TextDecoration .Underline ,
102+ modifier = Modifier .clickable { openUrl(context, websiteUrl) }
103+ )
104+ }
107105
108- Spacer (modifier = Modifier .height(24 .dp))
106+ Spacer (modifier = Modifier .height(12 .dp))
109107
110108 // Community section
111- Text (
112- text = " Join our Community" ,
113- style = MaterialTheme .typography.titleMedium
114- )
115-
116- Spacer (modifier = Modifier .height(8 .dp))
117-
118- val discordUrl = stringResource(id = R .string.about_discord_url)
119- Text (
120- text = stringResource(id = R .string.about_discord),
121- style = MaterialTheme .typography.bodyMedium,
122- color = MaterialTheme .colorScheme.primary,
123- textDecoration = TextDecoration .Underline ,
124- modifier = Modifier .clickable {
125- openUrl(context, discordUrl)
126- }
127- )
109+ SectionCard {
110+ Text (
111+ text = " Join our Community" ,
112+ style = MaterialTheme .typography.titleMedium
113+ )
114+ Spacer (modifier = Modifier .height(8 .dp))
115+ val discordUrl = stringResource(id = R .string.about_discord_url)
116+ Text (
117+ text = stringResource(id = R .string.about_discord),
118+ style = MaterialTheme .typography.bodyMedium,
119+ color = MaterialTheme .colorScheme.primary,
120+ textDecoration = TextDecoration .Underline ,
121+ modifier = Modifier .clickable { openUrl(context, discordUrl) }
122+ )
123+ }
128124
129- Spacer (modifier = Modifier .height(24 .dp))
125+ Spacer (modifier = Modifier .height(12 .dp))
130126
131127 // Open Source section
132- Text (
133- text = stringResource(id = R .string.about_open_source),
134- style = MaterialTheme .typography.titleMedium
135- )
136-
137- Spacer (modifier = Modifier .height(8 .dp))
138-
139- Text (
140- text = stringResource(id = R .string.about_open_source_description),
141- style = MaterialTheme .typography.bodyLarge
142- )
143-
144- // Repository link
145- Text (
146- text = repositoryUrl,
147- style = MaterialTheme .typography.bodyMedium,
148- color = MaterialTheme .colorScheme.primary,
149- textDecoration = TextDecoration .Underline ,
150- modifier = Modifier .clickable {
151- openUrl(context, repositoryUrl)
152- }
153- )
128+ SectionCard {
129+ Text (
130+ text = stringResource(id = R .string.about_open_source),
131+ style = MaterialTheme .typography.titleMedium
132+ )
133+ Spacer (modifier = Modifier .height(8 .dp))
134+ Text (
135+ text = stringResource(id = R .string.about_open_source_description),
136+ style = MaterialTheme .typography.bodyLarge
137+ )
138+ Spacer (modifier = Modifier .height(8 .dp))
139+ Text (
140+ text = repositoryUrl,
141+ style = MaterialTheme .typography.bodyMedium,
142+ color = MaterialTheme .colorScheme.primary,
143+ textDecoration = TextDecoration .Underline ,
144+ modifier = Modifier .clickable { openUrl(context, repositoryUrl) }
145+ )
146+ }
154147
155- Spacer (modifier = Modifier .height(24 .dp))
148+ Spacer (modifier = Modifier .height(12 .dp))
156149
157150 // Privacy Policy section
158- Text (
159- text = stringResource(id = R .string.about_privacy_policy),
160- style = MaterialTheme .typography.titleMedium
161- )
162-
163- Spacer (modifier = Modifier .height(8 .dp))
164-
165- Text (
166- text = stringResource(id = R .string.about_privacy_policy_description),
167- style = MaterialTheme .typography.bodyLarge
168- )
169-
170- // Privacy Policy link
171- Text (
172- text = privacyPolicyUrl,
173- style = MaterialTheme .typography.bodyMedium,
174- color = MaterialTheme .colorScheme.primary,
175- textDecoration = TextDecoration .Underline ,
176- modifier = Modifier .clickable {
177- openUrl(context, privacyPolicyUrl)
178- }
179- )
151+ SectionCard {
152+ Text (
153+ text = stringResource(id = R .string.about_privacy_policy),
154+ style = MaterialTheme .typography.titleMedium
155+ )
156+ Spacer (modifier = Modifier .height(8 .dp))
157+ Text (
158+ text = stringResource(id = R .string.about_privacy_policy_description),
159+ style = MaterialTheme .typography.bodyLarge
160+ )
161+ Spacer (modifier = Modifier .height(8 .dp))
162+ Text (
163+ text = privacyPolicyUrl,
164+ style = MaterialTheme .typography.bodyMedium,
165+ color = MaterialTheme .colorScheme.primary,
166+ textDecoration = TextDecoration .Underline ,
167+ modifier = Modifier .clickable { openUrl(context, privacyPolicyUrl) }
168+ )
169+ }
180170
181- Spacer (modifier = Modifier .height(24 .dp))
171+ Spacer (modifier = Modifier .height(12 .dp))
182172
183173 // Report Bugs section
184- Text (
185- text = stringResource(id = R .string.about_report_bugs),
186- style = MaterialTheme .typography.titleMedium
187- )
188-
189- Spacer (modifier = Modifier .height(8 .dp))
190-
191- Text (
192- text = stringResource(id = R .string.about_report_bugs_description),
193- style = MaterialTheme .typography.bodyLarge
194- )
195-
196- // Report Bugs link
197- Text (
198- text = reportBugsUrl,
199- style = MaterialTheme .typography.bodyMedium,
200- color = MaterialTheme .colorScheme.primary,
201- textDecoration = TextDecoration .Underline ,
202- modifier = Modifier .clickable {
203- openUrl(context, reportBugsUrl)
204- }
205- )
206-
207- Spacer (modifier = Modifier .height(24 .dp))
208-
209- // Version info
210- Row (
211- modifier = Modifier .fillMaxWidth(),
212- verticalAlignment = Alignment .CenterVertically
213- ) {
174+ SectionCard {
214175 Text (
215- text = stringResource(id = R .string.about_version),
216- style = MaterialTheme .typography.bodyLarge,
217- modifier = Modifier .weight(1f )
176+ text = stringResource(id = R .string.about_report_bugs),
177+ style = MaterialTheme .typography.titleMedium
218178 )
179+ Spacer (modifier = Modifier .height(8 .dp))
219180 Text (
220- text = uiState.versionName,
181+ text = stringResource(id = R .string.about_report_bugs_description),
182+ style = MaterialTheme .typography.bodyLarge
183+ )
184+ Spacer (modifier = Modifier .height(8 .dp))
185+ Text (
186+ text = reportBugsUrl,
221187 style = MaterialTheme .typography.bodyMedium,
222- color = MaterialTheme .colorScheme.primary
188+ color = MaterialTheme .colorScheme.primary,
189+ textDecoration = TextDecoration .Underline ,
190+ modifier = Modifier .clickable { openUrl(context, reportBugsUrl) }
223191 )
224192 }
225193
194+ Spacer (modifier = Modifier .height(12 .dp))
195+
196+ // Version info
197+ SectionCard {
198+ Row (
199+ modifier = Modifier .fillMaxWidth(),
200+ verticalAlignment = Alignment .CenterVertically
201+ ) {
202+ Text (
203+ text = stringResource(id = R .string.about_version),
204+ style = MaterialTheme .typography.bodyLarge,
205+ modifier = Modifier .weight(1f )
206+ )
207+ Text (
208+ text = uiState.versionName,
209+ style = MaterialTheme .typography.bodyMedium,
210+ color = MaterialTheme .colorScheme.primary
211+ )
212+ }
213+ }
214+
226215 Spacer (modifier = Modifier .height(24 .dp))
227216 }
228217 }
229218}
230219
220+ @Composable
221+ private fun SectionCard (
222+ modifier : Modifier = Modifier ,
223+ content : @Composable ColumnScope .() -> Unit
224+ ) {
225+ Card (
226+ modifier = modifier.fillMaxWidth(),
227+ colors = CardDefaults .cardColors(
228+ containerColor = MaterialTheme .colorScheme.surface
229+ ),
230+ shape = MaterialTheme .shapes.medium
231+ ) {
232+ Column (
233+ modifier = Modifier
234+ .fillMaxWidth()
235+ .padding(16 .dp)
236+ ) {
237+ content()
238+ }
239+ }
240+ }
241+
231242private fun openUrl (context : android.content.Context , url : String ) {
232243 val intent = Intent (Intent .ACTION_VIEW , url.toUri())
233244 context.startActivity(intent)
0 commit comments