Skip to content

Commit e0ddced

Browse files
migrate screens
1 parent 7445cda commit e0ddced

19 files changed

Lines changed: 153 additions & 343 deletions

app/src/main/java/org/bitcoindevkit/devkitwallet/presentation/theme/DevkitWalletColors.kt

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,6 @@ package org.bitcoindevkit.devkitwallet.presentation.theme
77

88
import androidx.compose.ui.graphics.Color
99

10-
object DevkitWalletColors {
11-
val primaryDark: Color = Color(0xFF203B46) // App bar
12-
val primary: Color = Color(0xFF264653) // Background
13-
val primaryLight: Color = Color(0xFF335F70) // Behind balance primary light
14-
val white: Color = Color(0xffffffff) // Most text
15-
val secondary: Color = Color(0xFF2A9D8F) // Buttons
16-
val accent1: Color = Color(0xFFE9C46A) // Receive button
17-
val accent2: Color = Color(0xFFE76F51) // Send button
18-
19-
// Dark warm palette (Concept D)
20-
val surface: Color = Color(0xFF1C1B1F)
21-
val onSurface: Color = Color(0xFFE6E1E5)
22-
val onSurfaceVariant: Color = Color(0xFFCAC4D0)
23-
val outline: Color = Color(0xFFCAC4D0)
24-
val receiveAccent: Color = Color(0xFFF2D2B6)
25-
val sendAccent: Color = Color(0xFFC6B2E0)
26-
val nodeAccent: Color = Color(0xFF8FD998)
27-
val historyAccent: Color = Color(0xFFE3D082)
28-
val subtle: Color = Color(0xFF79747E)
29-
}
30-
31-
internal val TestPink = Color(0xffff1493)
10+
// Accent colors not covered by the MaterialTheme colorScheme
11+
val NightGlowHistoryAccent: Color = Color(0xFFE3D082)
12+
val NightGlowSubtle: Color = Color(0xFF79747E)

app/src/main/java/org/bitcoindevkit/devkitwallet/presentation/theme/Type.kt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,7 @@ internal val devkitTypography =
1616
TextStyle(
1717
fontFamily = inter,
1818
fontWeight = FontWeight.Normal,
19-
color = DevkitWalletColors.white,
2019
fontSize = 16.sp,
2120
lineHeight = 28.sp,
2221
),
2322
)
24-
25-
val introText =
26-
TextStyle(
27-
fontFamily = inter,
28-
fontWeight = FontWeight.Normal,
29-
fontSize = 18.sp,
30-
lineHeight = 28.sp,
31-
)
32-
33-
// These are the default text styles used by Material3 components:
34-
// Buttons: labelLarge
35-
36-
internal val standardText =
37-
TextStyle(
38-
color = DevkitWalletColors.white,
39-
fontFamily = inter,
40-
fontSize = 14.sp,
41-
fontWeight = FontWeight.Normal,
42-
)

app/src/main/java/org/bitcoindevkit/devkitwallet/presentation/ui/components/CustomSnackbar.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package org.bitcoindevkit.devkitwallet.presentation.ui.components
88
import androidx.compose.foundation.layout.padding
99
import androidx.compose.material3.Icon
1010
import androidx.compose.material3.IconButton
11+
import androidx.compose.material3.MaterialTheme
1112
import androidx.compose.material3.Snackbar
1213
import androidx.compose.material3.SnackbarData
1314
import androidx.compose.material3.Text
@@ -17,11 +18,11 @@ import androidx.compose.ui.unit.dp
1718
import androidx.compose.ui.unit.sp
1819
import com.composables.icons.lucide.Lucide
1920
import com.composables.icons.lucide.X
20-
import org.bitcoindevkit.devkitwallet.presentation.theme.DevkitWalletColors
2121
import org.bitcoindevkit.devkitwallet.presentation.theme.inter
2222

2323
@Composable
2424
fun CustomSnackbar(data: SnackbarData) {
25+
val colorScheme = MaterialTheme.colorScheme
2526
Snackbar(
2627
modifier = Modifier.padding(12.dp),
2728
action = {
@@ -31,16 +32,17 @@ fun CustomSnackbar(data: SnackbarData) {
3132
Icon(
3233
imageVector = Lucide.X,
3334
contentDescription = "Ok",
34-
tint = DevkitWalletColors.white,
35+
tint = colorScheme.onSurface,
3536
)
3637
}
3738
},
38-
containerColor = DevkitWalletColors.primaryLight,
39+
containerColor = colorScheme.surfaceVariant,
3940
) {
4041
Text(
4142
text = data.visuals.message,
4243
fontFamily = inter,
4344
fontSize = 14.sp,
45+
color = colorScheme.onSurface,
4446
)
4547
}
4648
}

app/src/main/java/org/bitcoindevkit/devkitwallet/presentation/ui/components/NeutralButton.kt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,34 @@ import androidx.compose.foundation.layout.padding
1111
import androidx.compose.foundation.shape.RoundedCornerShape
1212
import androidx.compose.material3.Button
1313
import androidx.compose.material3.ButtonDefaults
14+
import androidx.compose.material3.MaterialTheme
1415
import androidx.compose.material3.Text
1516
import androidx.compose.runtime.Composable
1617
import androidx.compose.ui.Modifier
17-
import androidx.compose.ui.draw.shadow
1818
import androidx.compose.ui.unit.dp
19-
import org.bitcoindevkit.devkitwallet.presentation.theme.DevkitWalletColors
19+
import org.bitcoindevkit.devkitwallet.presentation.theme.inter
2020

2121
@Composable
2222
fun NeutralButton(text: String, enabled: Boolean, modifier: Modifier? = null, onClick: () -> Unit) {
23+
val colorScheme = MaterialTheme.colorScheme
2324
Button(
2425
onClick = onClick,
2526
colors =
2627
ButtonDefaults.buttonColors(
27-
containerColor = DevkitWalletColors.secondary,
28-
disabledContainerColor = DevkitWalletColors.secondary,
28+
containerColor = colorScheme.secondary,
29+
disabledContainerColor = colorScheme.secondary.copy(alpha = 0.4f),
2930
),
3031
shape = RoundedCornerShape(16.dp),
3132
enabled = enabled,
3233
modifier =
3334
modifier ?: Modifier
34-
.height(80.dp)
35+
.height(60.dp)
3536
.fillMaxWidth(0.9f)
36-
.padding(vertical = 8.dp, horizontal = 8.dp)
37-
.shadow(elevation = 4.dp, shape = RoundedCornerShape(16.dp)),
37+
.padding(vertical = 4.dp, horizontal = 8.dp),
3838
) {
3939
Text(
4040
text = text,
41+
fontFamily = inter,
4142
)
4243
}
4344
}

app/src/main/java/org/bitcoindevkit/devkitwallet/presentation/ui/components/RadioButtonWithLabel.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.Row
1111
import androidx.compose.foundation.layout.padding
1212
import androidx.compose.foundation.layout.size
1313
import androidx.compose.foundation.selection.selectable
14+
import androidx.compose.material3.MaterialTheme
1415
import androidx.compose.material3.RadioButton
1516
import androidx.compose.material3.RadioButtonDefaults
1617
import androidx.compose.material3.Text
@@ -19,13 +20,11 @@ import androidx.compose.ui.Alignment
1920
import androidx.compose.ui.Modifier
2021
import androidx.compose.ui.unit.dp
2122
import androidx.compose.ui.unit.sp
22-
import org.bitcoindevkit.devkitwallet.presentation.theme.DevkitWalletColors
2323
import org.bitcoindevkit.devkitwallet.presentation.theme.inter
2424

25-
// import org.bitcoindevkit.devkitwallet.presentation.theme.monoRegular
26-
2725
@Composable
2826
fun RadioButtonWithLabel(label: String, isSelected: Boolean, onSelect: () -> Unit) {
27+
val colorScheme = MaterialTheme.colorScheme
2928
Row(
3029
verticalAlignment = Alignment.CenterVertically,
3130
horizontalArrangement = Arrangement.spacedBy(4.dp),
@@ -42,8 +41,8 @@ fun RadioButtonWithLabel(label: String, isSelected: Boolean, onSelect: () -> Uni
4241
onClick = onSelect,
4342
colors =
4443
RadioButtonDefaults.colors(
45-
selectedColor = DevkitWalletColors.accent1,
46-
unselectedColor = DevkitWalletColors.accent2,
44+
selectedColor = colorScheme.primary,
45+
unselectedColor = colorScheme.outline,
4746
),
4847
modifier =
4948
Modifier
@@ -52,7 +51,7 @@ fun RadioButtonWithLabel(label: String, isSelected: Boolean, onSelect: () -> Uni
5251
)
5352
Text(
5453
text = label,
55-
color = DevkitWalletColors.white,
54+
color = colorScheme.onSurface,
5655
fontFamily = inter,
5756
fontSize = 12.sp,
5857
modifier =

app/src/main/java/org/bitcoindevkit/devkitwallet/presentation/ui/components/TransactionCards.kt

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,40 @@ import androidx.compose.foundation.layout.padding
1717
import androidx.compose.foundation.layout.size
1818
import androidx.compose.foundation.shape.CircleShape
1919
import androidx.compose.foundation.shape.RoundedCornerShape
20+
import androidx.compose.material3.MaterialTheme
2021
import androidx.compose.material3.Text
2122
import androidx.compose.runtime.Composable
2223
import androidx.compose.ui.Alignment
2324
import androidx.compose.ui.Modifier
2425
import androidx.compose.ui.draw.clip
25-
import androidx.compose.ui.graphics.Color
2626
import androidx.compose.ui.unit.dp
2727
import androidx.compose.ui.unit.sp
2828
import androidx.navigation.NavController
2929
import org.bitcoindevkit.devkitwallet.data.TxDetails
3030
import org.bitcoindevkit.devkitwallet.domain.utils.timestampToString
31-
import org.bitcoindevkit.devkitwallet.presentation.theme.DevkitWalletColors
31+
import org.bitcoindevkit.devkitwallet.presentation.theme.NightGlowHistoryAccent
3232
import org.bitcoindevkit.devkitwallet.presentation.theme.inter
3333
import org.bitcoindevkit.devkitwallet.presentation.ui.screens.wallet.viewTransaction
3434

3535
private const val TAG = "TransactionCards"
3636

3737
@Composable
3838
fun ConfirmedTransactionCard(details: TxDetails, navController: NavController) {
39+
val colorScheme = MaterialTheme.colorScheme
3940
Row(
4041
Modifier
4142
.padding(horizontal = 8.dp, vertical = 6.dp)
4243
.fillMaxWidth()
4344
.background(
44-
color = DevkitWalletColors.primaryLight,
45+
color = colorScheme.surfaceVariant.copy(alpha = 0.5f),
4546
shape = RoundedCornerShape(16.dp),
46-
).clickable { viewTransaction(navController = navController, txid = details.txid) },
47+
)
48+
.border(
49+
width = 1.dp,
50+
color = colorScheme.outline.copy(alpha = 0.08f),
51+
shape = RoundedCornerShape(16.dp),
52+
)
53+
.clickable { viewTransaction(navController = navController, txid = details.txid) },
4754
verticalAlignment = Alignment.CenterVertically,
4855
horizontalArrangement = Arrangement.Absolute.SpaceBetween,
4956
) {
@@ -52,33 +59,34 @@ fun ConfirmedTransactionCard(details: TxDetails, navController: NavController) {
5259
fontFamily = inter,
5360
fontSize = 12.sp,
5461
lineHeight = 20.sp,
55-
color = DevkitWalletColors.white,
62+
color = colorScheme.onSurface,
5663
modifier = Modifier.padding(16.dp),
5764
)
5865
Box(
5966
modifier =
6067
Modifier
6168
.padding(top = 16.dp, end = 16.dp)
62-
.size(size = 24.dp)
69+
.size(24.dp)
6370
.clip(shape = CircleShape)
64-
.background(DevkitWalletColors.secondary)
71+
.background(colorScheme.tertiary.copy(alpha = 0.6f))
6572
.align(Alignment.Top),
6673
)
6774
}
6875
}
6976

7077
@Composable
7178
fun PendingTransactionCard(details: TxDetails, navController: NavController) {
79+
val colorScheme = MaterialTheme.colorScheme
7280
Row(
7381
Modifier
7482
.padding(horizontal = 8.dp, vertical = 6.dp)
7583
.fillMaxWidth()
7684
.background(
77-
color = DevkitWalletColors.primaryLight,
85+
color = colorScheme.surfaceVariant.copy(alpha = 0.5f),
7886
shape = RoundedCornerShape(16.dp),
7987
).border(
80-
width = 2.dp,
81-
color = DevkitWalletColors.accent1,
88+
width = 1.5.dp,
89+
color = NightGlowHistoryAccent.copy(alpha = 0.5f),
8290
shape = RoundedCornerShape(16.dp),
8391
).clickable {
8492
viewTransaction(
@@ -93,16 +101,16 @@ fun PendingTransactionCard(details: TxDetails, navController: NavController) {
93101
pendingTransactionsItem(details),
94102
fontFamily = inter,
95103
fontSize = 12.sp,
96-
color = DevkitWalletColors.white,
104+
color = colorScheme.onSurface,
97105
modifier = Modifier.padding(16.dp),
98106
)
99107
Box(
100108
modifier =
101109
Modifier
102110
.padding(top = 16.dp, end = 16.dp)
103-
.size(size = 24.dp)
111+
.size(24.dp)
104112
.clip(shape = CircleShape)
105-
.background(Color(0xffE9C46A))
113+
.background(NightGlowHistoryAccent.copy(alpha = 0.6f))
106114
.align(Alignment.Top),
107115
)
108116
}

app/src/main/java/org/bitcoindevkit/devkitwallet/presentation/ui/components/WalletOptionsCard.kt

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
1313
import androidx.compose.foundation.layout.padding
1414
import androidx.compose.foundation.shape.RoundedCornerShape
1515
import androidx.compose.material3.HorizontalDivider
16+
import androidx.compose.material3.MaterialTheme
1617
import androidx.compose.material3.Text
1718
import androidx.compose.runtime.Composable
1819
import androidx.compose.runtime.MutableState
@@ -23,7 +24,6 @@ import androidx.compose.ui.unit.sp
2324
import org.bitcoindevkit.Network
2425
import org.bitcoindevkit.devkitwallet.data.ActiveWalletScriptType
2526
import org.bitcoindevkit.devkitwallet.domain.supportedNetworks
26-
import org.bitcoindevkit.devkitwallet.presentation.theme.DevkitWalletColors
2727
import org.bitcoindevkit.devkitwallet.presentation.theme.inter
2828
import org.bitcoindevkit.devkitwallet.presentation.ui.screens.intro.displayString
2929

@@ -33,11 +33,12 @@ fun WalletOptionsCard(
3333
selectedNetwork: MutableState<Network>,
3434
selectedScriptType: MutableState<ActiveWalletScriptType>,
3535
) {
36+
val colorScheme = MaterialTheme.colorScheme
3637
Column(
3738
Modifier
3839
.fillMaxWidth()
3940
.background(
40-
color = DevkitWalletColors.primaryLight,
41+
color = colorScheme.surfaceVariant,
4142
shape = RoundedCornerShape(16.dp),
4243
),
4344
verticalArrangement = Arrangement.Center,
@@ -47,16 +48,16 @@ fun WalletOptionsCard(
4748
text = "Network",
4849
fontFamily = inter,
4950
fontSize = 14.sp,
50-
color = DevkitWalletColors.white,
51+
color = colorScheme.onSurface,
5152
modifier =
5253
Modifier
5354
.align(Alignment.CenterHorizontally)
5455
.padding(top = 8.dp, bottom = 8.dp),
5556
)
5657

5758
HorizontalDivider(
58-
color = DevkitWalletColors.primaryDark,
59-
thickness = 4.dp,
59+
color = colorScheme.outline.copy(alpha = 0.15f),
60+
thickness = 1.dp,
6061
modifier = Modifier.padding(bottom = 8.dp),
6162
)
6263

@@ -73,16 +74,16 @@ fun WalletOptionsCard(
7374
text = "Script Type",
7475
fontFamily = inter,
7576
fontSize = 14.sp,
76-
color = DevkitWalletColors.white,
77+
color = colorScheme.onSurface,
7778
modifier =
7879
Modifier
7980
.align(Alignment.CenterHorizontally)
8081
.padding(top = 16.dp, bottom = 8.dp),
8182
)
8283

8384
HorizontalDivider(
84-
color = DevkitWalletColors.primaryDark,
85-
thickness = 4.dp,
85+
color = colorScheme.outline.copy(alpha = 0.15f),
86+
thickness = 1.dp,
8687
modifier = Modifier.padding(bottom = 8.dp),
8788
)
8889

@@ -99,11 +100,12 @@ fun WalletOptionsCard(
99100

100101
@Composable
101102
fun NetworkOptionsCard(selectedNetwork: MutableState<Network>) {
103+
val colorScheme = MaterialTheme.colorScheme
102104
Column(
103105
Modifier
104106
.fillMaxWidth()
105107
.background(
106-
color = DevkitWalletColors.primaryLight,
108+
color = colorScheme.surfaceVariant,
107109
shape = RoundedCornerShape(16.dp),
108110
),
109111
verticalArrangement = Arrangement.Center,
@@ -113,16 +115,16 @@ fun NetworkOptionsCard(selectedNetwork: MutableState<Network>) {
113115
text = "Network",
114116
fontFamily = inter,
115117
fontSize = 14.sp,
116-
color = DevkitWalletColors.white,
118+
color = colorScheme.onSurface,
117119
modifier =
118120
Modifier
119121
.align(Alignment.CenterHorizontally)
120122
.padding(top = 8.dp, bottom = 8.dp),
121123
)
122124

123125
HorizontalDivider(
124-
color = DevkitWalletColors.primaryDark,
125-
thickness = 4.dp,
126+
color = colorScheme.outline.copy(alpha = 0.15f),
127+
thickness = 1.dp,
126128
modifier = Modifier.padding(bottom = 8.dp),
127129
)
128130

0 commit comments

Comments
 (0)