@@ -23,6 +23,7 @@ import com.google.accompanist.drawablepainter.rememberDrawablePainter
2323import kotlinx.coroutines.Dispatchers
2424import kotlinx.coroutines.withContext
2525import tech.httptoolkit.android.R
26+ import tech.httptoolkit.android.ui.AppConstants
2627
2728@Composable
2829fun AppListScreen (
@@ -72,21 +73,21 @@ fun AppListScreen(
7273 modifier = modifier
7374 .fillMaxSize()
7475 .windowInsetsPadding(WindowInsets .statusBars.only(WindowInsetsSides .Top ))
75- .padding(horizontal = 16 .dp )
76+ .padding(horizontal = AppConstants .spacingLarge )
7677 ) {
7778 // Search and menu card
7879 Card (
7980 modifier = Modifier
8081 .fillMaxWidth()
81- .padding(top = 8 .dp )
82+ .padding(top = AppConstants .spacingSmall )
8283 .zIndex(1f ),
83- elevation = CardDefaults .cardElevation(defaultElevation = 4 .dp ),
84+ elevation = CardDefaults .cardElevation(defaultElevation = AppConstants .elevationDefault ),
8485 colors = CardDefaults .cardColors(containerColor = MaterialTheme .colorScheme.surface)
8586 ) {
8687 Row (
8788 modifier = Modifier
8889 .fillMaxWidth()
89- .padding(horizontal = 16 .dp ),
90+ .padding(horizontal = AppConstants .spacingLarge ),
9091 verticalAlignment = Alignment .CenterVertically
9192 ) {
9293 TextField (
@@ -95,7 +96,7 @@ fun AppListScreen(
9596 placeholder = { Text (stringResource(R .string.all_applications)) },
9697 modifier = Modifier
9798 .weight(1f )
98- .padding(vertical = 8 .dp ),
99+ .padding(vertical = AppConstants .spacingSmall ),
99100 singleLine = true ,
100101 colors = TextFieldDefaults .colors(
101102 focusedContainerColor = MaterialTheme .colorScheme.surface,
@@ -145,7 +146,7 @@ fun AppListScreen(
145146 checked = showEnabledOnly,
146147 onCheckedChange = null
147148 )
148- Spacer (modifier = Modifier .width(8 .dp ))
149+ Spacer (modifier = Modifier .width(AppConstants .spacingSmall ))
149150 Text (stringResource(R .string.show_enabled))
150151 }
151152 },
@@ -161,7 +162,7 @@ fun AppListScreen(
161162 checked = showSystem,
162163 onCheckedChange = null
163164 )
164- Spacer (modifier = Modifier .width(8 .dp ))
165+ Spacer (modifier = Modifier .width(AppConstants .spacingSmall ))
165166 Text (stringResource(R .string.show_system))
166167 }
167168 },
@@ -185,7 +186,7 @@ fun AppListScreen(
185186 } else {
186187 LazyColumn (
187188 modifier = Modifier .fillMaxSize(),
188- contentPadding = PaddingValues (vertical = 8 .dp )
189+ contentPadding = PaddingValues (vertical = AppConstants .spacingSmall )
189190 ) {
190191 items(
191192 items = filteredApps,
@@ -228,13 +229,13 @@ fun AppListItem(
228229 Card (
229230 modifier = modifier
230231 .fillMaxWidth()
231- .padding(vertical = 4 .dp , horizontal = 8 .dp ),
232+ .padding(vertical = AppConstants .spacingTiny , horizontal = AppConstants .spacingSmall ),
232233 colors = CardDefaults .cardColors(containerColor = MaterialTheme .colorScheme.surface)
233234 ) {
234235 Row (
235236 modifier = Modifier
236237 .fillMaxWidth()
237- .padding(vertical = 8 .dp , horizontal = 16 .dp ),
238+ .padding(vertical = AppConstants .spacingSmall , horizontal = AppConstants .spacingLarge ),
238239 verticalAlignment = Alignment .CenterVertically
239240 ) {
240241 // App icon
@@ -243,14 +244,14 @@ fun AppListItem(
243244 contentDescription = stringResource(R .string.cd_app_icon, appLabel),
244245 modifier = Modifier
245246 .size(72 .dp)
246- .padding(vertical = 8 .dp )
247+ .padding(vertical = AppConstants .spacingSmall )
247248 )
248249
249250 // App name and package
250251 Column (
251252 modifier = Modifier
252253 .weight(1f )
253- .padding(horizontal = 8 .dp )
254+ .padding(horizontal = AppConstants .spacingSmall )
254255 ) {
255256 Text (
256257 text = appLabel,
@@ -271,7 +272,7 @@ fun AppListItem(
271272 checked = isEnabled,
272273 onCheckedChange = onEnabledChange,
273274 modifier = Modifier
274- .padding(end = 8 .dp )
275+ .padding(end = AppConstants .spacingSmall )
275276 )
276277 }
277278 }
0 commit comments