Skip to content

Commit

Permalink
Fix up colors which should have been within Theme
Browse files Browse the repository at this point in the history
Some other UI fixes as I've tested
  • Loading branch information
davecraig committed Feb 27, 2025
1 parent 9fbb93a commit 354c541
Show file tree
Hide file tree
Showing 16 changed files with 213 additions and 165 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ import androidx.compose.material3.NavigationDrawerItem
import androidx.compose.material3.NavigationDrawerItemDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector

@Composable
fun DrawerMenuItem(onClick: () -> Unit, label: String, icon: ImageVector) {
NavigationDrawerItem(
label = { Text(
text = label,
color = Color.White
color = MaterialTheme.colorScheme.onBackground
) },
colors = NavigationDrawerItemDefaults.colors(
unselectedContainerColor = MaterialTheme.colorScheme.background
Expand All @@ -23,7 +22,7 @@ fun DrawerMenuItem(onClick: () -> Unit, label: String, icon: ImageVector) {
Icon(
icon,
null,
tint = Color.White
tint = MaterialTheme.colorScheme.onBackground
)
},
selected = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ fun LocationItem(
Icon(
Icons.Rounded.LocationOn,
contentDescription = null,
tint = Color.White,
tint = MaterialTheme.colorScheme.onBackground,
modifier = Modifier.width(spacing.icon)
)
} else if (decoration.index != -1) {
Text(
text = (decoration.index + 1).toString(),
style = MaterialTheme.typography.titleLarge,
color = Color.White,
color = MaterialTheme.colorScheme.onBackground,
modifier = Modifier.width(spacing.targetSize).align(Alignment.CenterVertically)
)
}
Expand All @@ -90,7 +90,7 @@ fun LocationItem(
Text(
text = it,
style = MaterialTheme.typography.titleLarge,
color = Color.White,
color = MaterialTheme.colorScheme.onBackground,
)
}
if(distanceString.isNotEmpty()) {
Expand Down Expand Up @@ -122,7 +122,7 @@ fun LocationItem(
Icon(
Icons.Rounded.ChevronRight,
contentDescription = null,
tint = Color.White,
tint = MaterialTheme.colorScheme.onBackground,
modifier = Modifier.width(spacing.icon)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import androidx.compose.material3.SearchBarDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.CollectionInfo
import androidx.compose.ui.semantics.CollectionItemInfo
Expand Down Expand Up @@ -56,7 +55,7 @@ fun MainSearchBar(
},
),
shape = RoundedCornerShape(spacing.small),
colors = SearchBarDefaults.colors(containerColor = Color.White),
colors = SearchBarDefaults.colors(containerColor = MaterialTheme.colorScheme.surface),
inputField = {
SearchBarDefaults.InputField(
query = searchText,
Expand All @@ -71,7 +70,7 @@ fun MainSearchBar(
Icon(
imageVector = Icons.Rounded.Search,
contentDescription = null,
tint = Color.Gray,
tint = MaterialTheme.colorScheme.onSurfaceVariant,
)
}

Expand All @@ -83,13 +82,13 @@ fun MainSearchBar(
Icons.AutoMirrored.Rounded.ArrowBack,
contentDescription =
stringResource(R.string.cancel_search_contentDescription),
tint = Color.Gray,
tint = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
}
}
},
colors = SearchBarDefaults.inputFieldColors(focusedTextColor = Color.Black),
colors = SearchBarDefaults.inputFieldColors(focusedTextColor = MaterialTheme.colorScheme.onSurface),
)
},
expanded = isSearching,
Expand Down Expand Up @@ -134,7 +133,7 @@ fun MainSearchBar(
},
userLocation = userLocation
)
HorizontalDivider(color = Color.White)
HorizontalDivider(color = MaterialTheme.colorScheme.onPrimary)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
Expand Down Expand Up @@ -51,7 +50,7 @@ fun NavigationButton(
Icon(
icon,
null,
tint = Color.White
tint = MaterialTheme.colorScheme.onPrimary
)
Spacer(modifier = Modifier.width(spacing.small))
}
Expand All @@ -64,7 +63,7 @@ fun NavigationButton(
Icon(
Icons.Rounded.ChevronRight,
null,
tint = Color.White,
tint = MaterialTheme.colorScheme.onPrimary,
modifier = Modifier.defaultMinSize(spacing.targetSize)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import androidx.compose.material3.ModalDrawerSheet
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -61,7 +60,7 @@ fun DrawerContent(
.size(spacing.targetSize)
.padding(start = spacing.extraSmall),
contentDescription = stringResource(R.string.ui_menu_close),
tint = Color.White,
tint = MaterialTheme.colorScheme.onPrimary,
)
}
DrawerMenuItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.heading
import androidx.compose.ui.semantics.semantics
Expand Down Expand Up @@ -414,7 +413,7 @@ fun HelpScreen(
)
) ),
style = MaterialTheme.typography.bodyMedium,
color = OnSurface,
color = MaterialTheme.colorScheme.onPrimary,
)
}

Expand All @@ -438,7 +437,7 @@ fun HelpScreen(
text = stringResource(section.textId),
textAlign = TextAlign.Start,
style = MaterialTheme.typography.titleMedium,
color = OnSurface,
color = MaterialTheme.colorScheme.onPrimary,
)
}
Box(
Expand All @@ -447,7 +446,7 @@ fun HelpScreen(
Icon(
Icons.Rounded.ChevronRight,
null,
tint = Color.White,
tint = MaterialTheme.colorScheme.onPrimary,
modifier = Modifier.align(Alignment.CenterEnd)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import androidx.compose.material3.rememberDrawerState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.heading
Expand All @@ -45,7 +44,6 @@ import org.scottishtecharmy.soundscape.screens.home.StreetPreviewFunctions
import org.scottishtecharmy.soundscape.screens.home.data.LocationDescription
import org.scottishtecharmy.soundscape.screens.home.locationDetails.generateLocationDetailsRoute
import org.scottishtecharmy.soundscape.services.RoutePlayerState
import org.scottishtecharmy.soundscape.ui.theme.OnPrimary
import org.scottishtecharmy.soundscape.ui.theme.SoundscapeTheme
import org.scottishtecharmy.soundscape.viewmodels.home.HomeState

Expand Down Expand Up @@ -161,7 +159,7 @@ fun HomeTopAppBar(
Icon(
imageVector = Icons.Rounded.Menu,
contentDescription = stringResource(R.string.ui_menu),
tint = Color.White,
tint = MaterialTheme.colorScheme.onPrimary,
modifier = Modifier.semantics { heading() },
)
}
Expand All @@ -177,7 +175,7 @@ fun HomeTopAppBar(
.semantics { onClick(label = sleepHint, action = { false }) }
) {
Icon(Icons.Rounded.Snooze,
tint = OnPrimary,
tint = MaterialTheme.colorScheme.onPrimary,
contentDescription = stringResource(R.string.sleep_sleep))
}
},
Expand Down
Loading

0 comments on commit 354c541

Please # to comment.