@@ -23,6 +23,8 @@ import androidx.compose.ui.Modifier
2323import androidx.compose.ui.graphics.Color
2424import androidx.compose.ui.text.font.FontWeight
2525import androidx.compose.ui.text.style.TextAlign
26+ import androidx.compose.foundation.border
27+ import androidx.compose.ui.focus.onFocusChanged
2628import androidx.compose.ui.unit.dp
2729import androidx.compose.ui.unit.sp
2830import com.xrontrix.lansync.ui.theme.*
@@ -143,26 +145,34 @@ fun BrowseScreen(
143145 Text (" Enter a name for the new folder" , color = TextMuted , fontSize = 12 .sp)
144146
145147 Spacer (modifier = Modifier .height(16 .dp))
148+ var isFolderFocused by remember { mutableStateOf(false ) }
146149
147150 OutlinedTextField (
148151 value = newFolderName,
149152 onValueChange = {
150153 newFolderName = it
151- folderError = " " // Clear error on typing
154+ folderError = " "
152155 },
153156 placeholder = { Text (" Vacation Photos" , color = TextMuted .copy(alpha = 0.5f ), fontSize = 13 .sp) },
154157 singleLine = true ,
155158 textStyle = androidx.compose.ui.text.TextStyle (color = TextPrimary , fontSize = 14 .sp),
156159 colors = OutlinedTextFieldDefaults .colors(
157- focusedBorderColor = GreenAccent ,
158- unfocusedBorderColor = Surface ,
160+ focusedBorderColor = Color . Transparent ,
161+ unfocusedBorderColor = Color . Transparent ,
159162 focusedContainerColor = BgBase ,
160163 unfocusedContainerColor = BgBase ,
161164 focusedTextColor = TextPrimary ,
162165 unfocusedTextColor = TextPrimary
163166 ),
164167 shape = RoundedCornerShape (10 .dp),
165- modifier = Modifier .fillMaxWidth()
168+ modifier = Modifier
169+ .fillMaxWidth()
170+ .onFocusChanged { isFolderFocused = it.isFocused }
171+ .border(
172+ width = 1 .dp,
173+ color = if (isFolderFocused) GoldAccent else Surface ,
174+ shape = RoundedCornerShape (10 .dp)
175+ )
166176 )
167177
168178 if (folderError.isNotEmpty()) {
@@ -207,12 +217,12 @@ fun BrowseScreen(
207217 },
208218 enabled = newFolderName.trim().isNotEmpty(),
209219 colors = ButtonDefaults .buttonColors(
210- containerColor = GreenAccent .copy(alpha = 0.1f ),
211- contentColor = GreenAccent ,
212- disabledContainerColor = GreenAccent .copy(alpha = 0.05f ),
213- disabledContentColor = GreenAccent .copy(alpha = 0.4f )
220+ containerColor = GoldAccent .copy(alpha = 0.1f ),
221+ contentColor = GoldAccent ,
222+ disabledContainerColor = GoldAccent .copy(alpha = 0.05f ),
223+ disabledContentColor = GoldAccent .copy(alpha = 0.4f )
214224 ),
215- border = BorderStroke (1 .dp, if (newFolderName.trim().isNotEmpty()) GreenAccent .copy(alpha = 0.3f ) else Color .Transparent ),
225+ border = BorderStroke (1 .dp, if (newFolderName.trim().isNotEmpty()) GoldAccent .copy(alpha = 0.3f ) else Color .Transparent ),
216226 shape = RoundedCornerShape (10 .dp),
217227 modifier = Modifier .height(36 .dp),
218228 contentPadding = PaddingValues (horizontal = 16 .dp, vertical = 0 .dp)
@@ -231,20 +241,30 @@ fun BrowseScreen(
231241
232242 Surface (color = BgBase , modifier = Modifier .fillMaxWidth()) {
233243 if (isSearchActive) {
244+ var isSearchFocused by remember { mutableStateOf(false ) }
245+
234246 OutlinedTextField (
235247 value = searchQuery,
236248 onValueChange = { searchQuery = it },
237249 placeholder = { Text (" Search files..." , color = TextMuted ) },
238250 singleLine = true ,
239251 textStyle = androidx.compose.ui.text.TextStyle (color = TextPrimary , fontSize = 14 .sp),
240252 colors = OutlinedTextFieldDefaults .colors(
241- focusedBorderColor = GreenAccent ,
242- unfocusedBorderColor = Surface ,
253+ focusedBorderColor = Color . Transparent ,
254+ unfocusedBorderColor = Color . Transparent ,
243255 focusedContainerColor = Surface ,
244256 unfocusedContainerColor = Surface ,
245257 focusedTextColor = TextPrimary
246258 ),
247- modifier = Modifier .weight(1f ).height(50 .dp),
259+ modifier = Modifier
260+ .weight(1f )
261+ .height(50 .dp)
262+ .onFocusChanged { isSearchFocused = it.isFocused }
263+ .border(
264+ width = 1 .dp,
265+ color = if (isSearchFocused) GoldAccent else Surface ,
266+ shape = RoundedCornerShape (12 .dp)
267+ ),
248268 shape = RoundedCornerShape (12 .dp),
249269 trailingIcon = {
250270 IconButton (
@@ -267,7 +287,7 @@ fun BrowseScreen(
267287 .padding(horizontal = 16 .dp, vertical = 16 .dp),
268288 verticalAlignment = Alignment .CenterVertically
269289 ) {
270- DeviceIcon (activeDeviceOS, GreenAccent , Modifier .size(20 .dp))
290+ DeviceIcon (activeDeviceOS, GoldAccent , Modifier .size(20 .dp))
271291 Spacer (modifier = Modifier .width(8 .dp))
272292 Text (
273293 text = activeDeviceName,
@@ -278,17 +298,17 @@ fun BrowseScreen(
278298 )
279299
280300 Surface (
281- color = GreenAccent .copy(alpha = 0.1f ),
282- contentColor = GreenAccent ,
301+ color = GoldAccent .copy(alpha = 0.1f ),
302+ contentColor = GoldAccent ,
283303 shape = RoundedCornerShape (10 .dp),
284- border = BorderStroke (1 .dp, GreenAccent .copy(alpha = 0.3f )),
304+ border = BorderStroke (1 .dp, GoldAccent .copy(alpha = 0.3f )),
285305 modifier = Modifier .size(36 .dp)
286306 ) {
287307 IconButton (onClick = { isSearchActive = true }) {
288308 Icon (
289309 imageVector = Icons .Rounded .Search ,
290310 contentDescription = " Search" ,
291- tint = GreenAccent ,
311+ tint = GoldAccent ,
292312 modifier = Modifier .size(20 .dp)
293313 )
294314 }
@@ -420,7 +440,7 @@ fun BrowseScreen(
420440 SmallFloatingActionButton (
421441 onClick = onShareClipboardClick,
422442 containerColor = Surface ,
423- contentColor = Color ( 0xFFa78bfa ) ,
443+ contentColor = Purple ,
424444 elevation = FloatingActionButtonDefaults .elevation(
425445 defaultElevation = 6 .dp,
426446 pressedElevation = 2 .dp
@@ -437,7 +457,7 @@ fun BrowseScreen(
437457 onDownloadFiles(selectedFiles.toList())
438458 selectedFiles = emptySet()
439459 },
440- containerColor = GreenAccent ,
460+ containerColor = GoldAccent ,
441461 contentColor = BgBase ,
442462 shape = RoundedCornerShape (16 .dp)
443463 ) {
@@ -492,7 +512,7 @@ fun BrowseScreen(
492512 ) {
493513 Text (" Upload Folder" , color = TextPrimary , fontSize = 14 .sp, fontWeight = FontWeight .Medium )
494514 Spacer (modifier = Modifier .width(12 .dp))
495- Icon (Icons .Filled .Folder , tint = Color ( 0xFFa78bfa ) , contentDescription = null , modifier = Modifier .size(22 .dp))
515+ Icon (Icons .Filled .Folder , tint = Purple , contentDescription = null , modifier = Modifier .size(22 .dp))
496516 }
497517 }
498518
@@ -508,7 +528,7 @@ fun BrowseScreen(
508528 ) {
509529 Text (" Create Folder" , color = TextPrimary , fontSize = 14 .sp, fontWeight = FontWeight .Medium )
510530 Spacer (modifier = Modifier .width(12 .dp))
511- Icon (Icons .Filled .CreateNewFolder , tint = GreenAccent , contentDescription = null , modifier = Modifier .size(22 .dp))
531+ Icon (Icons .Filled .CreateNewFolder , tint = GoldAccent , contentDescription = null , modifier = Modifier .size(22 .dp))
512532 }
513533 }
514534 }
@@ -557,15 +577,15 @@ fun DynamicFileIcon(name: String, isDir: Boolean, modifier: Modifier = Modifier)
557577 else -> Icons .AutoMirrored .Rounded .InsertDriveFile
558578 }
559579 val tint = when {
560- isDir -> Color ( 0xFF3d9eff )
561- imageExts.contains(ext) -> Color ( 0xFFA78BFA )
580+ isDir -> Accent
581+ imageExts.contains(ext) -> Purple
562582 videoExts.contains(ext) -> Color (0xFFF87171 )
563583 audioExts.contains(ext) -> Color (0xFF34D399 )
564584 archiveExts.contains(ext) -> Color (0xFFF0A44A )
565585 codeExts.contains(ext) -> Color (0xFF00C9A7 )
566586 docExts.contains(ext) -> Color (0xFF93C5FD )
567587 sheetExts.contains(ext) -> Color (0xFF6EE7B7 )
568- else -> Color ( 0xFF8090A8 )
588+ else -> TextMuted
569589 }
570590 Icon (imageVector = icon, contentDescription = null , tint = tint, modifier = modifier)
571591}
0 commit comments