Skip to content

Native Android client for Spotify, built with Jetpack Compose

The Classic search field follows the dark theme instead of a hard-coded white bar

Ashish Ranjan17fd96cf36a9
diff --git a/base/app/src/main/java/com/music/spotui/ui/screens/SearchScreen.kt b/base/app/src/main/java/com/music/spotui/ui/screens/SearchScreen.kt
index 15d7e4a3..388a9c8d 100644
--- a/base/app/src/main/java/com/music/spotui/ui/screens/SearchScreen.kt
+++ b/base/app/src/main/java/com/music/spotui/ui/screens/SearchScreen.kt
@@ -2,6 +2,7 @@ package com.music.spotui.ui.screens
import com.music.spotui.ui.components.secondaryClick
import com.music.spotui.ui.theme.tone
+import com.music.spotui.ui.theme.AppAccent
import com.music.spotui.ui.theme.AppText
import com.music.spotui.ui.theme.AppMuted
@@ -886,12 +887,12 @@ fun SearchStickyBar(
.padding(10.dp)
.clip(RoundedCornerShape(10.dp))
.height(55.dp)
- .background(Color.White)
+ .background(tone(0xFF2A2A2A))
.padding(10.dp, 0.dp)
){
Icon(
painterResource(id = R.drawable.ic_search_big),
- tint = Color.Black,
+ tint = AppMuted,
contentDescription = "")
TextField(
@@ -900,7 +901,7 @@ fun SearchStickyBar(
.focusRequester(fieldFocus)
.onFocusChanged { onFocusChange(it.isFocused) },
value = text,
- textStyle = TextStyle.Default.copy(fontSize = 16.sp, color = Color.Black, fontWeight = FontWeight(500)),
+ textStyle = TextStyle.Default.copy(fontSize = 16.sp, color = AppText, fontWeight = FontWeight(500)),
colors = TextFieldDefaults.colors(
unfocusedContainerColor = Color.Transparent,
disabledContainerColor = Color.Transparent,
@@ -908,21 +909,22 @@ fun SearchStickyBar(
disabledIndicatorColor = Color.Transparent,
focusedIndicatorColor = Color.Transparent,
unfocusedIndicatorColor = Color.Transparent,
- cursorColor = Color.Black
+ cursorColor = AppAccent
),
singleLine = true,
onValueChange = onTextChange,
placeholder = {
Text(
- textAlign = TextAlign.Center,
+ textAlign = TextAlign.Center,
+ color = AppMuted,
fontWeight = FontWeight.Bold,
text = stringResource(R.string.search_header_field_hint)
)
},
trailingIcon = if (text.isEmpty()) null else {
- { SearchClearButton(fieldFocus, Color.Black) { onTextChange("") } }
+ { SearchClearButton(fieldFocus, AppMuted) { onTextChange("") } }
},
)
}