-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
copy address and back button fixes #133
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
248dc50
copy address and back button fixes
sajalbnl cc94765
Merge branch 'keep-starknet-strange:main' into main
sajalbnl 66a0fcf
Some minor changes
sajalbnl 1ec8f02
Merge remote-tracking branch 'origin/main'
sajalbnl f3a7149
Remove local.properties from repository
sajalbnl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package com.example.walletapp.ui.transfer | ||
|
||
import android.content.ClipData | ||
import android.widget.Toast | ||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.clickable | ||
|
@@ -21,17 +22,21 @@ import androidx.compose.ui.graphics.Color | |
import androidx.compose.ui.platform.ClipEntry | ||
import androidx.compose.ui.platform.ClipboardManager | ||
import androidx.compose.ui.platform.LocalClipboardManager | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.text.font.Font | ||
import androidx.compose.ui.text.font.FontFamily | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import androidx.core.graphics.toColorInt | ||
import com.example.walletapp.BuildConfig | ||
import com.example.walletapp.R | ||
|
||
@Composable | ||
fun ReceiveScreen(modifier: Modifier) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a back button here as well. |
||
val clipboard: ClipboardManager = LocalClipboardManager.current | ||
val context= LocalContext.current | ||
val address= BuildConfig.ACCOUNT_ADDRESS | ||
|
||
Surface(modifier = Modifier.fillMaxSize()) { | ||
Column( | ||
|
@@ -59,7 +64,7 @@ fun ReceiveScreen(modifier: Modifier) { | |
|
||
// Wallet Address | ||
Text( | ||
text = "0xfoo...123", // Replace with actual wallet address | ||
text = address.take(8) + "....", | ||
fontFamily = FontFamily(Font(R.font.publicsans_bold)), | ||
color = Color.White, | ||
fontSize = 40.sp | ||
|
@@ -74,8 +79,9 @@ fun ReceiveScreen(modifier: Modifier) { | |
color = Color.White, | ||
fontSize = 15.sp, | ||
modifier = Modifier.clickable { | ||
val clip = ClipEntry(ClipData.newPlainText("Wallet Address", "0xfoo...123")) // TODO: Replace with actual wallet address | ||
val clip = ClipEntry(ClipData.newPlainText("Wallet Address", address)) | ||
clipboard.setClip(clip) | ||
Toast.makeText(context, "Address Copied", Toast.LENGTH_LONG).show() | ||
} | ||
) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,8 +44,8 @@ import com.example.walletapp.R | |
import com.example.walletapp.ui.account.WalletViewModel | ||
import android.widget.Toast | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.material.DropdownMenuItem | ||
import androidx.compose.material3.DropdownMenu | ||
import androidx.compose.material3.DropdownMenuItem | ||
import androidx.compose.runtime.LaunchedEffect | ||
import androidx.compose.runtime.collectAsState | ||
import androidx.compose.runtime.remember | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add a back button to this screen as well |
||
|
@@ -306,27 +306,33 @@ fun TokenDropdown( | |
DropdownMenuItem(onClick = { | ||
onTokenSelected("ethereum") | ||
expanded = false | ||
}) { | ||
Image( | ||
painter = painterResource(id = R.drawable.ic_ethereum), | ||
contentDescription = null, | ||
modifier = Modifier.size(24.dp) | ||
) | ||
Spacer(modifier = Modifier.width(8.dp)) | ||
Text("ETH", color = Color.White) | ||
} | ||
}, | ||
leadingIcon = { | ||
Image( | ||
painter = painterResource(id = R.drawable.ic_ethereum), | ||
contentDescription = null, | ||
modifier = Modifier.size(24.dp) | ||
) | ||
|
||
}, | ||
text={ | ||
Text("ETH", color = Color.White) | ||
}) | ||
DropdownMenuItem(onClick = { | ||
onTokenSelected("starknet") | ||
expanded = false | ||
}) { | ||
Image( | ||
painter = painterResource(id = R.drawable.starknet_icon), | ||
contentDescription = null, | ||
modifier = Modifier.size(24.dp) | ||
) | ||
Spacer(modifier = Modifier.width(8.dp)) | ||
Text("STRK", color = Color.White) | ||
} | ||
}, | ||
leadingIcon = { | ||
Image( | ||
painter = painterResource(id = R.drawable.starknet_icon), | ||
contentDescription = null, | ||
modifier = Modifier.size(24.dp) | ||
) | ||
|
||
}, | ||
text={ | ||
Text("STRK", color = Color.White) | ||
}) | ||
} | ||
} | ||
} | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you center this with the text please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also can you make the receive screen look and behave the same way?