@@ -13,6 +13,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
13
13
import androidx.compose.foundation.layout.height
14
14
import androidx.compose.foundation.layout.padding
15
15
import androidx.compose.foundation.layout.size
16
+ import androidx.compose.foundation.layout.sizeIn
16
17
import androidx.compose.foundation.layout.width
17
18
import androidx.compose.foundation.rememberScrollState
18
19
import androidx.compose.foundation.text.KeyboardActions
@@ -253,19 +254,19 @@ fun TeamLookup(lookupViewModel: LookupViewModel, navController: NavController) {
253
254
.padding(horizontal = 20 .dp)
254
255
.fillMaxWidth()
255
256
) {
256
- Box (
257
- modifier = Modifier .width(40 .dp)
258
- ) {
259
- Icon (
260
- Icons .Filled .Star ,
261
- modifier = Modifier
262
- .size(30 .dp)
263
- .alpha(0F ),
264
- contentDescription = " Spacer" ,
265
- )
266
- }
267
- Spacer (modifier = Modifier .weight(1.0F ))
257
+ Spacer (Modifier .width(10 .dp)) // Thank you Android for making spacing weird
258
+ Icon (
259
+ Icons .Filled .Star ,
260
+ modifier = Modifier
261
+ .size(30 .dp)
262
+ .alpha(0F ),
263
+ contentDescription = " Spacer" ,
264
+ )
265
+ Spacer (modifier = Modifier .weight(1.0f ))
268
266
TextField (
267
+ modifier = Modifier .sizeIn(
268
+ maxWidth = 200 .dp,
269
+ ),
269
270
value = lookupViewModel.number.value,
270
271
onValueChange = { lookupViewModel.number.value = it },
271
272
singleLine = true ,
@@ -300,36 +301,35 @@ fun TeamLookup(lookupViewModel: LookupViewModel, navController: NavController) {
300
301
lookupViewModel.fetchTeam()
301
302
})
302
303
)
303
- Spacer (modifier = Modifier .weight(1.0F ))
304
- Box (
305
- modifier = Modifier .width(40 .dp)
306
- ) {
304
+ Spacer (modifier = Modifier .weight(1.0f ))
305
+ Box {
307
306
IconButton (onClick = {
308
- favoriteTeams = if (lookupViewModel.number.value.isEmpty() || lookupViewModel.number.value == " 229V\u200B " || ! lookupViewModel.fetchedTeams.value) {
309
- return @IconButton
310
- } else if (favoriteTeams.contains(lookupViewModel.number.value.uppercase()) && lookupViewModel.teamTextColor.value != Color .Unspecified ) {
311
- userSettings.removeFavoriteTeam(lookupViewModel.number.value.uppercase())
312
- userSettings.getData(" favoriteTeams" , " " ).replace(" [" , " " )
313
- .replace(" ]" , " " )
314
- .split(" , " )
315
- } else {
316
- userSettings.addFavoriteTeam(lookupViewModel.number.value.uppercase())
317
- userSettings.getData(" favoriteTeams" , " " ).replace(" [" , " " )
318
- .replace(" ]" , " " )
319
- .split(" , " )
320
- }
307
+ favoriteTeams =
308
+ if (lookupViewModel.number.value.isEmpty() || lookupViewModel.number.value == " 229V\u200B " || ! lookupViewModel.fetchedTeams.value) {
309
+ return @IconButton
310
+ } else if (favoriteTeams.contains(lookupViewModel.number.value.uppercase()) && lookupViewModel.teamTextColor.value != Color .Unspecified ) {
311
+ userSettings.removeFavoriteTeam(lookupViewModel.number.value.uppercase())
312
+ userSettings.getData(" favoriteTeams" , " " ).replace(" [" , " " )
313
+ .replace(" ]" , " " )
314
+ .split(" , " )
315
+ } else {
316
+ userSettings.addFavoriteTeam(lookupViewModel.number.value.uppercase())
317
+ userSettings.getData(" favoriteTeams" , " " ).replace(" [" , " " )
318
+ .replace(" ]" , " " )
319
+ .split(" , " )
320
+ }
321
321
}) {
322
322
if (favoriteTeams.contains(lookupViewModel.number.value.uppercase()) && lookupViewModel.number.value.isNotBlank()) {
323
323
Icon (
324
324
Icons .Filled .Star ,
325
- contentDescription = " Favorite " ,
325
+ contentDescription = " Unfavorite " ,
326
326
modifier = Modifier .size(30 .dp),
327
327
tint = MaterialTheme .colorScheme.button
328
328
)
329
329
} else {
330
330
Icon (
331
331
Icons .Outlined .StarOutline ,
332
- contentDescription = " Unfavorite " ,
332
+ contentDescription = " Favorite " ,
333
333
modifier = Modifier .size(30 .dp),
334
334
tint = MaterialTheme .colorScheme.button
335
335
)
0 commit comments