11package org.nsh07.wikireader.ui.aboutScreen
22
33import androidx.compose.foundation.background
4- import androidx.compose.foundation.clickable
54import androidx.compose.foundation.layout.Arrangement
65import androidx.compose.foundation.layout.Column
76import androidx.compose.foundation.layout.Row
@@ -40,8 +39,9 @@ import androidx.compose.ui.tooling.preview.Preview
4039import androidx.compose.ui.unit.dp
4140import org.nsh07.wikireader.BuildConfig
4241import org.nsh07.wikireader.R
43- import org.nsh07.wikireader.ui.theme.CustomTopBarColors.topBarColors
44- import org.nsh07.wikireader.ui.theme.WRShapeDefaults.bottomListItemShape
42+ import org.nsh07.wikireader.ui.settingsScreen.ClickableListItem
43+ import org.nsh07.wikireader.ui.theme.CustomColors.listItemColors
44+ import org.nsh07.wikireader.ui.theme.CustomColors.topBarColors
4545import org.nsh07.wikireader.ui.theme.WRShapeDefaults.middleListItemShape
4646import org.nsh07.wikireader.ui.theme.WRShapeDefaults.topListItemShape
4747import org.nsh07.wikireader.ui.theme.WikiReaderTheme
@@ -67,17 +67,18 @@ fun AboutScreen(
6767 LazyColumn (
6868 verticalArrangement = Arrangement .spacedBy(2 .dp),
6969 contentPadding = insets,
70- modifier = Modifier .background(topBarColors.containerColor)
70+ modifier = Modifier
71+ .background(topBarColors.containerColor)
72+ .padding(horizontal = 16 .dp)
7173 ) {
7274 item { Spacer (Modifier .height(8 .dp)) }
7375 item {
7476 Column (
7577 horizontalAlignment = Alignment .CenterHorizontally ,
7678 modifier = Modifier
77- .padding(horizontal = 16 .dp)
7879 .clip(topListItemShape)
7980 .fillMaxWidth()
80- .background(colorScheme.surface )
81+ .background(listItemColors.containerColor )
8182 ) {
8283 Row (verticalAlignment = Alignment .CenterVertically ) {
8384 Icon (painterResource(R .drawable.ic_launcher_foreground), null )
@@ -113,70 +114,49 @@ fun AboutScreen(
113114 },
114115 headlineContent = { Text (stringResource(R .string.version)) },
115116 supportingContent = { Text (BuildConfig .VERSION_NAME ) },
116- modifier = Modifier
117- .padding(horizontal = 16 .dp)
118- .clip(middleListItemShape)
117+ colors = listItemColors,
118+ modifier = Modifier .clip(middleListItemShape)
119119 )
120- ListItem (
120+ ClickableListItem (
121121 leadingContent = {
122122 Icon (painterResource(R .drawable.code), null )
123123 },
124124 headlineContent = { Text (stringResource(R .string.sourceCode)) },
125125 supportingContent = { Text (" GitHub" ) },
126- modifier = Modifier
127- .padding(horizontal = 16 .dp)
128- .clip(middleListItemShape)
129- .clickable(
130- onClick = {
131- uriHandler.openUri(" https://github.com/nsh07/WikiReader" )
132- }
133- )
134- )
135- ListItem (
126+ colors = listItemColors,
127+ items = 6 ,
128+ index = 2
129+ ) { uriHandler.openUri(" https://github.com/nsh07/WikiReader" ) }
130+ ClickableListItem (
136131 leadingContent = {
137132 Icon (painterResource(R .drawable.gavel), null )
138133 },
139134 headlineContent = { Text (stringResource(R .string.license)) },
140135 supportingContent = { Text (" GPL v3.0" ) },
141- modifier = Modifier
142- .padding(horizontal = 16 .dp)
143- .clip(middleListItemShape)
144- .clickable(
145- onClick = {
146- uriHandler.openUri(" https://github.com/nsh07/WikiReader/blob/main/LICENSE" )
147- }
148- )
149- )
150- ListItem (
136+ colors = listItemColors,
137+ items = 6 ,
138+ index = 3
139+ ) { uriHandler.openUri(" https://github.com/nsh07/WikiReader/blob/main/LICENSE" ) }
140+ ClickableListItem (
151141 leadingContent = {
152142 Icon (painterResource(R .drawable.update), null )
153143 },
154144 headlineContent = { Text (stringResource(R .string.releases)) },
155145 supportingContent = { Text (stringResource(R .string.releasesDesc)) },
156- modifier = Modifier
157- .padding(horizontal = 16 .dp)
158- .clip(middleListItemShape)
159- .clickable(
160- onClick = {
161- uriHandler.openUri(" https://github.com/nsh07/WikiReader/releases" )
162- }
163- )
164- )
165- ListItem (
146+ colors = listItemColors,
147+ items = 6 ,
148+ index = 4
149+ ) { uriHandler.openUri(" https://github.com/nsh07/WikiReader/releases" ) }
150+ ClickableListItem (
166151 leadingContent = {
167152 Icon (painterResource(R .drawable.translate), null )
168153 },
169154 headlineContent = { Text (stringResource(R .string.translate)) },
170155 supportingContent = { Text (stringResource(R .string.translateDesc)) },
171- modifier = Modifier
172- .padding(horizontal = 16 .dp)
173- .clip(bottomListItemShape)
174- .clickable(
175- onClick = {
176- uriHandler.openUri(" https://hosted.weblate.org/engage/wikireader/" )
177- }
178- )
179- )
156+ colors = listItemColors,
157+ items = 6 ,
158+ index = 5
159+ ) { uriHandler.openUri(" https://hosted.weblate.org/engage/wikireader/" ) }
180160 }
181161 }
182162 item {
@@ -187,38 +167,28 @@ fun AboutScreen(
187167 color = colorScheme.primary,
188168 modifier = Modifier .padding(horizontal = 32 .dp, vertical = 14 .dp)
189169 )
190- ListItem (
170+ ClickableListItem (
191171 leadingContent = {
192172 Icon (
193173 painterResource(R .drawable.github), null
194174 )
195175 },
196176 headlineContent = { Text (" Nishant Mishra" ) },
197177 supportingContent = { Text (stringResource(R .string.otherProjectsDesc)) },
198- modifier = Modifier
199- .padding(horizontal = 16 .dp)
200- .clip(topListItemShape)
201- .clickable(
202- onClick = {
203- uriHandler.openUri(" https://github.com/nsh07" )
204- }
205- )
206- )
207- ListItem (
178+ colors = listItemColors,
179+ items = 2 ,
180+ index = 0
181+ ) { uriHandler.openUri(" https://github.com/nsh07" ) }
182+ ClickableListItem (
208183 leadingContent = {
209184 Icon (painterResource(R .drawable.heart), null )
210185 },
211186 headlineContent = { Text (stringResource(R .string.donate)) },
212187 supportingContent = { Text (stringResource(R .string.supportMyWork)) },
213- modifier = Modifier
214- .padding(horizontal = 16 .dp)
215- .clip(bottomListItemShape)
216- .clickable(
217- onClick = {
218- uriHandler.openUri(" https://github.com/sponsors/nsh07" )
219- }
220- )
221- )
188+ colors = listItemColors,
189+ items = 2 ,
190+ index = 1
191+ ) { uriHandler.openUri(" https://github.com/sponsors/nsh07" ) }
222192 }
223193 }
224194 item {
@@ -229,40 +199,30 @@ fun AboutScreen(
229199 color = colorScheme.primary,
230200 modifier = Modifier .padding(horizontal = 32 .dp, vertical = 14 .dp)
231201 )
232- ListItem (
202+ ClickableListItem (
233203 leadingContent = {
234204 Icon (
235205 painterResource(R .drawable.wikipedia_s_w), null
236206 )
237207 },
238208 headlineContent = { Text (stringResource(R .string.wikipedia)) },
239209 supportingContent = { Text (stringResource(R .string.wikipediaWebsiteDesc)) },
240- modifier = Modifier
241- .padding(horizontal = 16 .dp)
242- .clip(topListItemShape)
243- .clickable(
244- onClick = {
245- uriHandler.openUri(" https://wikipedia.org" )
246- }
247- )
248- )
249- ListItem (
210+ colors = listItemColors,
211+ items = 2 ,
212+ index = 0
213+ ) { uriHandler.openUri(" https://wikipedia.org" ) }
214+ ClickableListItem (
250215 leadingContent = {
251216 Icon (
252217 painterResource(R .drawable.wikimedia_logo_black), null
253218 )
254219 },
255220 headlineContent = { Text (stringResource(R .string.supportWikipedia)) },
256221 supportingContent = { Text (stringResource(R .string.donateToWikipedia)) },
257- modifier = Modifier
258- .padding(horizontal = 16 .dp)
259- .clip(bottomListItemShape)
260- .clickable(
261- onClick = {
262- uriHandler.openUri(" https://wikimediafoundation.org/support/" )
263- }
264- )
265- )
222+ colors = listItemColors,
223+ items = 2 ,
224+ index = 1
225+ ) { uriHandler.openUri(" https://wikimediafoundation.org/support/" ) }
266226 }
267227 }
268228 item { Spacer (Modifier .height(16 .dp)) }
0 commit comments