Skip to content

Commit 5d826b3

Browse files
committed
style: add solana logo to deposit withdrawal TextInput fields
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent cea6d0e commit 5d826b3

5 files changed

Lines changed: 76 additions & 15 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!--
2+
~ Copyright (C) 2026 The Android Open Source Project
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
17+
android:width="18dp"
18+
android:height="14dp"
19+
android:viewportWidth="18"
20+
android:viewportHeight="14">
21+
<path
22+
android:pathData="M17.291,10.346C17.547,10.346 17.675,10.656 17.494,10.837L14.723,13.608C14.615,13.716 14.469,13.776 14.316,13.776H0.288C0.231,13.777 0.176,13.76 0.128,13.728C0.081,13.697 0.044,13.652 0.022,13.599C0,13.547 -0.006,13.489 0.005,13.433C0.017,13.378 0.044,13.326 0.084,13.286L2.855,10.515C2.963,10.407 3.11,10.347 3.263,10.346H17.291Z"
23+
android:fillColor="#ffffff"
24+
android:fillAlpha="0.5"/>
25+
<path
26+
android:pathData="M14.316,5.14C14.469,5.14 14.614,5.201 14.722,5.308L17.494,8.08C17.675,8.261 17.547,8.571 17.291,8.571H3.263C3.108,8.571 2.962,8.509 2.855,8.402L0.084,5.63C0.044,5.59 0.017,5.539 0.005,5.483C-0.006,5.427 0,5.37 0.022,5.317C0.044,5.265 0.081,5.22 0.128,5.188C0.176,5.157 0.231,5.14 0.288,5.14H14.316Z"
27+
android:fillColor="#ffffff"
28+
android:fillAlpha="0.5"/>
29+
<path
30+
android:pathData="M17.291,0C17.547,0 17.675,0.309 17.494,0.491L14.723,3.262C14.615,3.369 14.469,3.43 14.316,3.43H0.288C0.231,3.43 0.176,3.413 0.128,3.382C0.081,3.35 0.044,3.305 0.022,3.253C0,3.2 -0.006,3.143 0.005,3.087C0.017,3.031 0.044,2.98 0.084,2.939L2.855,0.168L2.856,0.169C2.966,0.062 3.113,0 3.263,0H17.291Z"
31+
android:fillColor="#ffffff"
32+
android:fillAlpha="0.5"/>
33+
</vector>

‎apps/flipcash/core/src/main/res/values/strings.xml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@
128128
<string name="error_title_failedToDeleteAccount">Something went wrong</string>
129129
<string name="error_description_failedToDeleteAccount">We were unable to delete your Flipcash account. Please try again</string>
130130

131-
<string name="subtitle_howToDeposit">Deposit funds into your wallet by sending USDC on Solana to your deposit address below</string>
132-
<string name="subtitle_howToDepositToken">Deposit funds into your wallet by sending %1$s on Solana to your deposit address below</string>
131+
<string name="subtitle_howToDeposit">Deposit funds into your wallet by sending USDC to your deposit address below</string>
132+
<string name="subtitle_howToDepositToken">Deposit funds into your wallet by sending %1$s to your deposit address below</string>
133133

134134
<string name="title_clipboardLabelDepositAddress">Deposit Address</string>
135135
<string name="title_clipboardLabelPublicKey">Public Key</string>
@@ -145,7 +145,7 @@
145145
<string name="title_shareDownloadLink">Get the Flipcash App</string>
146146
<string name="title_shareCashLink">Send %1$s</string>
147147

148-
<string name="title_enterAddress">Enter address</string>
148+
<string name="title_enterAddress">Enter Solana address</string>
149149
<string name="subtitle_whereWithdrawTo">Where would you like to withdraw your %1$s to?</string>
150150
<string name="subtitle_withdrawHint">Enter up to %1$s</string>
151151
<string name="subtitle_withdrawHintLimitExceeded">You can only give up to %1$s</string>
@@ -624,4 +624,5 @@
624624
<string name="title_withdrawUsdfAsUsdc">Withdraw as USDC</string>
625625
<string name="description_withdrawUsdfAsUsdc">Your USDF will be converted 1:1 to Solana USDC on withdrawal</string>
626626
<string name="displayName_solanaUsdc">Solana USDC</string>
627+
<string name="displayName_usdc">USDC</string>
627628
</resources>

‎apps/flipcash/features/deposit/src/main/kotlin/com/flipcash/app/deposit/internal/DepositScreenContent.kt‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.flipcash.app.deposit.internal
22

3+
import androidx.compose.foundation.Image
34
import androidx.compose.foundation.background
45
import androidx.compose.foundation.border
56
import androidx.compose.foundation.layout.Arrangement
@@ -9,19 +10,18 @@ import androidx.compose.foundation.layout.fillMaxWidth
910
import androidx.compose.foundation.layout.height
1011
import androidx.compose.foundation.layout.navigationBarsPadding
1112
import androidx.compose.foundation.layout.padding
12-
import androidx.compose.material.Text
13+
import androidx.compose.material3.Text
1314
import androidx.compose.runtime.Composable
1415
import androidx.compose.runtime.getValue
1516
import androidx.compose.ui.Alignment
1617
import androidx.compose.ui.Modifier
1718
import androidx.compose.ui.draw.clip
18-
import androidx.compose.ui.platform.LocalContext
19-
import androidx.compose.ui.platform.LocalUriHandler
19+
import androidx.compose.ui.graphics.ColorFilter
20+
import androidx.compose.ui.res.painterResource
2021
import androidx.compose.ui.res.stringResource
2122
import androidx.compose.ui.text.style.TextAlign
2223
import androidx.compose.ui.text.style.TextOverflow
2324
import androidx.lifecycle.compose.collectAsStateWithLifecycle
24-
import com.flipcash.app.core.transfers.TransferDirection
2525
import com.flipcash.features.deposit.R
2626
import com.getcode.theme.CodeTheme
2727
import com.getcode.theme.White
@@ -90,13 +90,21 @@ private fun DepositScreenContent(state: DepositViewModel.State, dispatchEvent: (
9090
.background(White05)
9191
.rememberedClickable { dispatchEvent(DepositViewModel.Event.CopyAddress) }
9292
.padding(CodeTheme.dimens.grid.x2),
93+
horizontalArrangement = Arrangement.spacedBy(CodeTheme.dimens.grid.x2),
94+
verticalAlignment = Alignment.CenterVertically,
9395
) {
96+
Image(
97+
modifier = Modifier.padding(start = CodeTheme.dimens.grid.x1),
98+
painter = painterResource(R.drawable.ic_solana_logo),
99+
contentDescription = null,
100+
colorFilter = ColorFilter.tint(CodeTheme.colors.textSecondary),
101+
)
94102
Text(
95103
modifier = Modifier
96104
.align(Alignment.CenterVertically)
97105
.weight(1f),
98106
text = state.depositAddress,
99-
color = White,
107+
color = CodeTheme.colors.textMain,
100108
style = CodeTheme.typography.textMedium.copy(textAlign = TextAlign.Center),
101109
overflow = TextOverflow.MiddleEllipsis,
102110
maxLines = 1

‎apps/flipcash/features/withdrawal/src/main/kotlin/com/flipcash/app/withdrawal/WithdrawalViewModel.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ internal class WithdrawalViewModel @Inject constructor(
243243
token = token,
244244
balance = balance.convertingTo(rate),
245245
displayName = if (token.address == Mint.usdf) {
246-
resources.getString(R.string.displayName_solanaUsdc)
246+
resources.getString(R.string.displayName_usdc)
247247
} else {
248248
token.name
249249
}

‎apps/flipcash/features/withdrawal/src/main/kotlin/com/flipcash/app/withdrawal/internal/destination/WithdrawalDestinationScreen.kt‎

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ private fun WithdrawalDestinationScreenContent(
5353
CodeScaffold(
5454
bottomBar = {
5555
CodeButton(
56-
modifier = Modifier.fillMaxWidth()
56+
modifier = Modifier
57+
.fillMaxWidth()
5758
.navigationBarsPadding()
5859
.imePadding()
5960
.padding(horizontal = CodeTheme.dimens.inset)
@@ -70,17 +71,22 @@ private fun WithdrawalDestinationScreenContent(
7071
modifier = Modifier
7172
.fillMaxSize()
7273
.padding(padding)
73-
.padding(horizontal = CodeTheme.dimens.inset,),
74+
.padding(horizontal = CodeTheme.dimens.inset),
7475
verticalArrangement = Arrangement.spacedBy(CodeTheme.dimens.grid.x2),
7576
) {
7677
Text(
77-
text = stringResource(R.string.subtitle_whereWithdrawTo, state.token?.displayName.orEmpty()),
78+
text = stringResource(
79+
R.string.subtitle_whereWithdrawTo,
80+
state.token?.displayName.orEmpty()
81+
),
7882
style = CodeTheme.typography.textMedium,
7983
color = CodeTheme.colors.textSecondary
8084
)
8185

8286
Column(
83-
modifier = Modifier.fillMaxWidth().padding(top = CodeTheme.dimens.grid.x1),
87+
modifier = Modifier
88+
.fillMaxWidth()
89+
.padding(top = CodeTheme.dimens.grid.x1),
8490
verticalArrangement = Arrangement.spacedBy(CodeTheme.dimens.grid.x1)
8591
) {
8692
TextInput(
@@ -91,8 +97,21 @@ private fun WithdrawalDestinationScreenContent(
9197
placeholder = stringResource(R.string.title_enterAddress),
9298
placeholderStyle = CodeTheme.typography.textMedium,
9399
maxLines = 1,
94-
contentPadding = PaddingValues(CodeTheme.dimens.grid.x2),
95-
colors = inputColors(placeholderColor = CodeTheme.colors.textSecondary,),
100+
leadingIcon = {
101+
Image(
102+
modifier = Modifier.padding(start = CodeTheme.dimens.grid.x3),
103+
painter = painterResource(R.drawable.ic_solana_logo),
104+
contentDescription = null,
105+
colorFilter = ColorFilter.tint(CodeTheme.colors.textSecondary),
106+
)
107+
},
108+
contentPadding = PaddingValues(
109+
start = CodeTheme.dimens.grid.x1,
110+
top = CodeTheme.dimens.grid.x2,
111+
bottom = CodeTheme.dimens.grid.x2,
112+
end = CodeTheme.dimens.grid.x2,
113+
),
114+
colors = inputColors(placeholderColor = CodeTheme.colors.textSecondary),
96115
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text),
97116
)
98117

0 commit comments

Comments
 (0)