Skip to content

Commit d91c138

Browse files
committed
feat: image receive WIP
1 parent a2a6deb commit d91c138

File tree

1 file changed

+62
-46
lines changed

1 file changed

+62
-46
lines changed

app/src/main/java/to/bitkit/ui/screens/wallets/sheets/NewTransactionSheet.kt

Lines changed: 62 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package to.bitkit.ui.screens.wallets.sheets
22

33
import androidx.compose.foundation.Image
44
import androidx.compose.foundation.layout.Arrangement
5+
import androidx.compose.foundation.layout.Box
56
import androidx.compose.foundation.layout.Column
67
import androidx.compose.foundation.layout.Row
78
import androidx.compose.foundation.layout.Spacer
@@ -79,69 +80,84 @@ private fun NewTransactionSheetView(
7980
onCloseClick: () -> Unit,
8081
onDetailClick: () -> Unit,
8182
) {
82-
Column(
83-
horizontalAlignment = Alignment.CenterHorizontally,
83+
Box(
8484
modifier = Modifier
8585
.fillMaxSize()
86-
.padding(horizontal = 16.dp),
8786
) {
88-
val titleText = when (details.type) {
89-
NewTransactionSheetType.LIGHTNING -> when (details.direction) {
90-
NewTransactionSheetDirection.SENT -> stringResource(R.string.wallet__send_sent)
91-
else -> stringResource(R.string.wallet__payment_received)
92-
}
9387

94-
NewTransactionSheetType.ONCHAIN -> when (details.direction) {
95-
NewTransactionSheetDirection.SENT -> stringResource(R.string.wallet__send_sent)
96-
else -> stringResource(R.string.wallet__payment_received)
97-
}
88+
if (details.direction == NewTransactionSheetDirection.RECEIVED) {
89+
Image(
90+
painter = painterResource(R.drawable.coin_stack), //TODO IMPLEMENT CORRECT IMAGE
91+
contentDescription = null,
92+
contentScale = ContentScale.FillWidth,
93+
modifier = Modifier.fillMaxWidth().padding(start = 32.dp, bottom = 32.dp).align(Alignment.BottomEnd)
94+
)
9895
}
9996

100-
SheetTopBar(titleText)
97+
Column(
98+
horizontalAlignment = Alignment.CenterHorizontally,
99+
modifier = Modifier
100+
.fillMaxSize()
101+
.padding(horizontal = 16.dp),
102+
) {
103+
val titleText = when (details.type) {
104+
NewTransactionSheetType.LIGHTNING -> when (details.direction) {
105+
NewTransactionSheetDirection.SENT -> stringResource(R.string.wallet__send_sent)
106+
else -> stringResource(R.string.wallet__payment_received)
107+
}
108+
109+
NewTransactionSheetType.ONCHAIN -> when (details.direction) {
110+
NewTransactionSheetDirection.SENT -> stringResource(R.string.wallet__send_sent)
111+
else -> stringResource(R.string.wallet__payment_received)
112+
}
113+
}
101114

102-
Spacer(modifier = Modifier.height(24.dp))
115+
SheetTopBar(titleText)
103116

104-
BalanceHeaderView(sats = details.sats, modifier = Modifier.fillMaxWidth())
117+
Spacer(modifier = Modifier.height(24.dp))
105118

106-
if (details.direction == NewTransactionSheetDirection.SENT) {
107-
Spacer(modifier = Modifier.weight(1f))
119+
BalanceHeaderView(sats = details.sats, modifier = Modifier.fillMaxWidth())
108120

109-
Image(
110-
painter = painterResource(R.drawable.check),
111-
contentDescription = null,
112-
contentScale = ContentScale.FillWidth,
113-
modifier = Modifier.fillMaxWidth().padding(horizontal = 32.dp)
114-
)
115-
}
121+
if (details.direction == NewTransactionSheetDirection.SENT) {
122+
Spacer(modifier = Modifier.weight(1f))
116123

117-
Spacer(modifier = Modifier.weight(1f))
118-
119-
if (details.direction == NewTransactionSheetDirection.SENT) {
120-
Row(
121-
horizontalArrangement = Arrangement.spacedBy(16.dp),
122-
modifier = Modifier.fillMaxWidth()
123-
) {
124-
SecondaryButton(
125-
text = stringResource(R.string.wallet__send_details),
126-
onClick = onDetailClick,
127-
fullWidth = false,
128-
modifier = Modifier.weight(1f)
124+
Image(
125+
painter = painterResource(R.drawable.check),
126+
contentDescription = null,
127+
contentScale = ContentScale.FillWidth,
128+
modifier = Modifier.fillMaxWidth().padding(horizontal = 32.dp)
129129
)
130+
}
131+
132+
Spacer(modifier = Modifier.weight(1f))
133+
134+
if (details.direction == NewTransactionSheetDirection.SENT) {
135+
Row(
136+
horizontalArrangement = Arrangement.spacedBy(16.dp),
137+
modifier = Modifier.fillMaxWidth()
138+
) {
139+
SecondaryButton(
140+
text = stringResource(R.string.wallet__send_details),
141+
onClick = onDetailClick,
142+
fullWidth = false,
143+
modifier = Modifier.weight(1f)
144+
)
145+
PrimaryButton(
146+
text = stringResource(R.string.common__close),
147+
onClick = onCloseClick,
148+
fullWidth = false,
149+
modifier = Modifier.weight(1f)
150+
)
151+
}
152+
} else {
130153
PrimaryButton(
131-
text = stringResource(R.string.common__close),
154+
text = stringResource(R.string.common__close), //TODO get correct text
132155
onClick = onCloseClick,
133-
fullWidth = false,
134-
modifier = Modifier.weight(1f)
135156
)
136157
}
137-
} else {
138-
PrimaryButton(
139-
text = stringResource(R.string.common__close), //TODO get correct text
140-
onClick = onCloseClick,
141-
)
142-
}
143158

144-
Spacer(modifier = Modifier.height(16.dp))
159+
Spacer(modifier = Modifier.height(16.dp))
160+
}
145161
}
146162
}
147163

0 commit comments

Comments
 (0)