Skip to content

Commit a248cab

Browse files
committed
style: updated mobile color themes according to desktop app
1 parent 6df6470 commit a248cab

6 files changed

Lines changed: 90 additions & 46 deletions

File tree

mobile/app/src/main/java/com/xrontrix/lansync/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ class MainActivity : ComponentActivity(), BridgeCallback {
179179
incomingRequest.value = null
180180
Toast.makeText(this@MainActivity, "Connected to ${req.second}", Toast.LENGTH_SHORT).show()
181181
},
182-
color = GreenAccent.copy(alpha = 0.1f),
182+
color = GoldAccent.copy(alpha = 0.1f),
183183
shape = RoundedCornerShape(12.dp),
184184
modifier = Modifier.weight(1f).height(45.dp)
185185
) {
186-
Box(contentAlignment = Alignment.Center) { Text("Accept", color = GreenAccent, fontWeight = FontWeight.SemiBold, fontSize = 14.sp) }
186+
Box(contentAlignment = Alignment.Center) { Text("Accept", color = GoldAccent, fontWeight = FontWeight.SemiBold, fontSize = 14.sp) }
187187
}
188188
}
189189
}

mobile/app/src/main/java/com/xrontrix/lansync/ui/screens/BrowseScreen.kt

Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import androidx.compose.ui.Modifier
2323
import androidx.compose.ui.graphics.Color
2424
import androidx.compose.ui.text.font.FontWeight
2525
import androidx.compose.ui.text.style.TextAlign
26+
import androidx.compose.foundation.border
27+
import androidx.compose.ui.focus.onFocusChanged
2628
import androidx.compose.ui.unit.dp
2729
import androidx.compose.ui.unit.sp
2830
import 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
}

mobile/app/src/main/java/com/xrontrix/lansync/ui/screens/HomeScreen.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ fun HomeScreen(
6565

6666
Text(
6767
text = buildAnnotatedString {
68-
withStyle(style = SpanStyle(color = Color(0xFF3d4d63))) { append("Lan") }
69-
withStyle(style = SpanStyle(color = GreenAccent)) { append("Sync") }
68+
withStyle(style = SpanStyle(color = Color(0xFF5f4538))) { append("Lan") }
69+
withStyle(style = SpanStyle(color = GoldAccent)) { append("Sync") }
7070
},
7171
fontSize = 28.sp, fontWeight = FontWeight.Black, letterSpacing = 4.sp
7272
)
@@ -100,8 +100,8 @@ fun HomeScreen(
100100
Row(verticalAlignment = Alignment.CenterVertically) {
101101
Box(contentAlignment = Alignment.Center, modifier = Modifier.size(14.dp)) {
102102
if (isNetworkAvailable) {
103-
Box(modifier = Modifier.size(8.dp).scale(pingScale).alpha(pingAlpha).background(GreenAccent, CircleShape))
104-
Box(modifier = Modifier.size(8.dp).background(GreenAccent, CircleShape))
103+
Box(modifier = Modifier.size(8.dp).scale(pingScale).alpha(pingAlpha).background(GoldAccent, CircleShape))
104+
Box(modifier = Modifier.size(8.dp).background(GoldAccent, CircleShape))
105105
} else {
106106
Box(modifier = Modifier.size(8.dp).background(RedAccent, CircleShape))
107107
}

mobile/app/src/main/java/com/xrontrix/lansync/ui/screens/SettingsScreen.kt

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package com.xrontrix.lansync.ui.screens
33
import androidx.activity.compose.rememberLauncherForActivityResult
44
import androidx.activity.result.contract.ActivityResultContracts
55
import androidx.compose.foundation.BorderStroke
6+
import androidx.compose.foundation.background
7+
import androidx.compose.foundation.border
68
import androidx.compose.foundation.layout.*
79
import androidx.compose.foundation.shape.RoundedCornerShape
810
import androidx.compose.material.icons.Icons
@@ -13,6 +15,8 @@ import androidx.compose.material3.*
1315
import androidx.compose.runtime.*
1416
import androidx.compose.ui.Alignment
1517
import androidx.compose.ui.Modifier
18+
import androidx.compose.ui.focus.onFocusChanged
19+
import androidx.compose.ui.graphics.Color
1620
import androidx.compose.ui.text.font.FontWeight
1721
import androidx.compose.ui.text.style.TextOverflow
1822
import androidx.compose.ui.unit.dp
@@ -76,16 +80,31 @@ fun SettingsScreen(
7680
Column(modifier = Modifier.padding(20.dp)) {
7781
Text("DEVICE NAME", color = TextMuted, fontSize = 10.sp, fontWeight = FontWeight.Bold, letterSpacing = 1.sp)
7882
Spacer(modifier = Modifier.height(12.dp))
83+
var isDeviceNameFocused by remember { mutableStateOf(false) }
84+
7985
OutlinedTextField(
8086
value = deviceName,
8187
onValueChange = { deviceName = it },
8288
colors = OutlinedTextFieldDefaults.colors(
83-
focusedBorderColor = Accent, unfocusedBorderColor = BgBase,
84-
focusedContainerColor = BgBase, unfocusedContainerColor = BgBase,
85-
focusedTextColor = TextPrimary, unfocusedTextColor = TextPrimary
89+
focusedBorderColor = Color.Transparent,
90+
unfocusedBorderColor = Color.Transparent,
91+
focusedContainerColor = BgBase,
92+
unfocusedContainerColor = BgBase,
93+
focusedTextColor = TextPrimary,
94+
unfocusedTextColor = TextPrimary
8695
),
87-
singleLine = true, modifier = Modifier.fillMaxWidth(), shape = RoundedCornerShape(12.dp)
96+
singleLine = true,
97+
modifier = Modifier
98+
.fillMaxWidth()
99+
.onFocusChanged { isDeviceNameFocused = it.isFocused }
100+
.border(
101+
width = 1.dp,
102+
color = if (isDeviceNameFocused) Accent else Color.Transparent,
103+
shape = RoundedCornerShape(12.dp)
104+
),
105+
shape = RoundedCornerShape(12.dp)
88106
)
107+
89108
Spacer(modifier = Modifier.height(16.dp))
90109
Button(
91110
onClick = { onSaveName(deviceName) },
@@ -131,7 +150,7 @@ fun SettingsScreen(
131150
modifier = Modifier.weight(1f), onClick = { exposedPicker.launch(null) }
132151
) {
133152
Column(modifier = Modifier.padding(16.dp)) {
134-
Icon(Icons.Filled.Folder, contentDescription = null, tint = GreenAccent)
153+
Icon(Icons.Filled.Folder, contentDescription = null, tint = GoldAccent)
135154
Spacer(modifier = Modifier.height(12.dp))
136155
Text("Exposed Folder", color = TextPrimary, fontSize = 14.sp, fontWeight = FontWeight.Bold)
137156
Spacer(modifier = Modifier.height(2.dp))

mobile/app/src/main/java/com/xrontrix/lansync/ui/theme/Color.kt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ package com.xrontrix.lansync.ui.theme
22

33
import androidx.compose.ui.graphics.Color
44

5-
val BgBase = Color(0xFF080a0f)
6-
val Surface = Color(0xFF0e1117)
7-
val Panel = Color(0xFF13171f)
8-
val Accent = Color(0xFF3d9eff)
9-
val GreenAccent = Color(0xFF00c9a7)
10-
val RedAccent = Color(0xFFf04a6a)
11-
val TextPrimary = Color(0xFFdde4f0)
12-
val TextMuted = Color(0xFF8090a8)
5+
val BgBase = Color(0xFF090810) // --color-bg-base
6+
val Surface = Color(0xFF100f17) // --color-surface
7+
val Panel = Color(0xFF15131e) // --color-panel
8+
val Purple = Color(0xFFa78bfa) // --color-purple
9+
val Accent = Color(0xFFd76a04) // --color-accent (Orange)
10+
val GoldAccent = Color(0xFFFFDF00) // --color-gold (Replaces GoldAccent)
11+
val RedAccent = Color(0xFFf04a6a) // --color-red
12+
val TextPrimary = Color(0xFFffe5da) // --color-text (Warmer white)
13+
val TextMuted = Color(0xFF8a8099) // --color-muted

mobile/app/src/main/java/com/xrontrix/lansync/ui/theme/Theme.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ private val LanSyncColorScheme = darkColorScheme(
1414
surface = Surface,
1515
surfaceVariant = Panel,
1616
primary = Accent,
17-
secondary = GreenAccent,
17+
secondary = GoldAccent, // Updated to Gold
1818
error = RedAccent,
1919
onBackground = TextPrimary,
2020
onSurface = TextPrimary
@@ -28,16 +28,20 @@ fun LansyncTheme(
2828
if (!view.isInEditMode) {
2929
SideEffect {
3030
val window = (view.context as Activity).window
31-
// This makes the Android top status bar and bottom nav bar blend perfectly
31+
32+
// ── Suppress the API 35 Integer deprecation warnings ──
33+
@Suppress("DEPRECATION")
3234
window.statusBarColor = BgBase.toArgb()
35+
@Suppress("DEPRECATION")
3336
window.navigationBarColor = Surface.toArgb()
37+
3438
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = false
3539
}
3640
}
3741

3842
MaterialTheme(
3943
colorScheme = LanSyncColorScheme,
40-
typography = Typography, // This pulls from your Type.kt file
44+
typography = Typography,
4145
content = content
4246
)
4347
}

0 commit comments

Comments
 (0)