|
1 | 1 | package com.yogeshpaliyal.deepr.ui.components
|
2 | 2 |
|
3 |
| -import androidx.compose.foundation.background |
| 3 | +import androidx.compose.foundation.BorderStroke |
4 | 4 | import androidx.compose.foundation.clickable
|
5 | 5 | import androidx.compose.foundation.layout.Arrangement
|
6 | 6 | import androidx.compose.foundation.layout.Row
|
7 | 7 | import androidx.compose.foundation.layout.fillMaxWidth
|
8 | 8 | import androidx.compose.foundation.layout.padding
|
9 | 9 | import androidx.compose.foundation.layout.size
|
| 10 | +import androidx.compose.material3.CardDefaults |
10 | 11 | import androidx.compose.material3.Icon
|
| 12 | +import androidx.compose.material3.OutlinedCard |
11 | 13 | import androidx.compose.material3.Text
|
12 | 14 | import androidx.compose.runtime.Composable
|
13 | 15 | import androidx.compose.runtime.getValue
|
@@ -35,35 +37,40 @@ fun ServerStatusBar(
|
35 | 37 | val serverUrl by viewModel.serverUrl.collectAsStateWithLifecycle()
|
36 | 38 |
|
37 | 39 | if (isRunning) {
|
38 |
| - Row( |
39 |
| - modifier = |
40 |
| - modifier |
41 |
| - .fillMaxWidth() |
42 |
| - .background(Color(0xFF4CAF50)) |
43 |
| - .clickable { onServerStatusClick() } |
44 |
| - .padding(horizontal = 16.dp, vertical = 12.dp), |
45 |
| - horizontalArrangement = Arrangement.spacedBy(8.dp), |
46 |
| - verticalAlignment = Alignment.CenterVertically, |
| 40 | + OutlinedCard( |
| 41 | + modifier = modifier.padding(8.dp), |
| 42 | + colors = CardDefaults.outlinedCardColors(containerColor = Color(0xFF4CAF50)), |
| 43 | + border = BorderStroke(1.dp, Color(0xFF3C8D3E)), |
47 | 44 | ) {
|
48 |
| - Icon( |
49 |
| - TablerIcons.Server, |
50 |
| - contentDescription = null, |
51 |
| - tint = Color.White, |
52 |
| - modifier = Modifier.size(16.dp), |
53 |
| - ) |
54 |
| - Text( |
55 |
| - text = stringResource(R.string.server_running_tap_to_configure), |
56 |
| - color = Color.White, |
57 |
| - fontSize = 14.sp, |
58 |
| - fontWeight = FontWeight.Medium, |
59 |
| - modifier = Modifier.weight(1f), |
60 |
| - ) |
61 |
| - if (serverUrl != null) { |
| 45 | + Row( |
| 46 | + modifier = |
| 47 | + Modifier |
| 48 | + .fillMaxWidth() |
| 49 | + .clickable { onServerStatusClick() } |
| 50 | + .padding(horizontal = 16.dp, vertical = 12.dp), |
| 51 | + horizontalArrangement = Arrangement.spacedBy(8.dp), |
| 52 | + verticalAlignment = Alignment.CenterVertically, |
| 53 | + ) { |
| 54 | + Icon( |
| 55 | + TablerIcons.Server, |
| 56 | + contentDescription = null, |
| 57 | + tint = Color.White, |
| 58 | + modifier = Modifier.size(16.dp), |
| 59 | + ) |
62 | 60 | Text(
|
63 |
| - text = serverUrl!!.substringAfter("://"), |
64 |
| - color = Color.White.copy(alpha = 0.8f), |
65 |
| - fontSize = 12.sp, |
| 61 | + text = stringResource(R.string.server_running_tap_to_configure), |
| 62 | + color = Color.White, |
| 63 | + fontSize = 14.sp, |
| 64 | + fontWeight = FontWeight.Medium, |
| 65 | + modifier = Modifier.weight(1f), |
66 | 66 | )
|
| 67 | + if (serverUrl != null) { |
| 68 | + Text( |
| 69 | + text = serverUrl!!.substringAfter("://"), |
| 70 | + color = Color.White.copy(alpha = 0.8f), |
| 71 | + fontSize = 12.sp, |
| 72 | + ) |
| 73 | + } |
67 | 74 | }
|
68 | 75 | }
|
69 | 76 | }
|
|
0 commit comments