mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-11 00:03:12 +02:00
Refining the selection size when clicking in an account.
This commit is contained in:
@@ -86,9 +86,7 @@ fun AccountSwitchBottomSheet(
|
|||||||
val current = accountUser.pubkeyNpub() == acc.npub
|
val current = accountUser.pubkeyNpub() == acc.npub
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier.fillMaxWidth(),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(16.dp, 16.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
@@ -99,62 +97,69 @@ fun AccountSwitchBottomSheet(
|
|||||||
},
|
},
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
Box(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.width(55.dp)
|
.padding(16.dp, 16.dp)
|
||||||
.padding(0.dp)
|
.weight(1f),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
AsyncImageProxy(
|
|
||||||
model = ResizeImage(acc.profilePicture, 55.dp),
|
|
||||||
placeholder = BitmapPainter(RoboHashCache.get(context, acc.npub)),
|
|
||||||
fallback = BitmapPainter(RoboHashCache.get(context, acc.npub)),
|
|
||||||
error = BitmapPainter(RoboHashCache.get(context, acc.npub)),
|
|
||||||
contentDescription = stringResource(R.string.profile_image),
|
|
||||||
modifier = Modifier
|
|
||||||
.width(55.dp)
|
|
||||||
.height(55.dp)
|
|
||||||
.clip(shape = CircleShape)
|
|
||||||
)
|
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(20.dp)
|
.width(55.dp)
|
||||||
.align(Alignment.TopEnd)
|
.padding(0.dp)
|
||||||
) {
|
) {
|
||||||
if (acc.hasPrivKey) {
|
AsyncImageProxy(
|
||||||
Icon(
|
model = ResizeImage(acc.profilePicture, 55.dp),
|
||||||
imageVector = Icons.Default.Key,
|
placeholder = BitmapPainter(RoboHashCache.get(context, acc.npub)),
|
||||||
contentDescription = stringResource(R.string.account_switch_has_private_key),
|
fallback = BitmapPainter(RoboHashCache.get(context, acc.npub)),
|
||||||
modifier = Modifier.size(20.dp),
|
error = BitmapPainter(RoboHashCache.get(context, acc.npub)),
|
||||||
tint = MaterialTheme.colors.primary
|
contentDescription = stringResource(R.string.profile_image),
|
||||||
)
|
modifier = Modifier
|
||||||
} else {
|
.width(55.dp)
|
||||||
Icon(
|
.height(55.dp)
|
||||||
imageVector = Icons.Default.Visibility,
|
.clip(shape = CircleShape)
|
||||||
contentDescription = stringResource(R.string.account_switch_pubkey_only),
|
)
|
||||||
modifier = Modifier.size(20.dp),
|
|
||||||
tint = MaterialTheme.colors.primary
|
Box(
|
||||||
)
|
modifier = Modifier
|
||||||
|
.size(20.dp)
|
||||||
|
.align(Alignment.TopEnd)
|
||||||
|
) {
|
||||||
|
if (acc.hasPrivKey) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Key,
|
||||||
|
contentDescription = stringResource(R.string.account_switch_has_private_key),
|
||||||
|
modifier = Modifier.size(20.dp),
|
||||||
|
tint = MaterialTheme.colors.primary
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Visibility,
|
||||||
|
contentDescription = stringResource(R.string.account_switch_pubkey_only),
|
||||||
|
modifier = Modifier.size(20.dp),
|
||||||
|
tint = MaterialTheme.colors.primary
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
Spacer(modifier = Modifier.width(16.dp))
|
||||||
Spacer(modifier = Modifier.width(16.dp))
|
Column(modifier = Modifier.weight(1f)) {
|
||||||
Column(modifier = Modifier.weight(1f)) {
|
val npubShortHex = acc.npub.toShortenHex()
|
||||||
val npubShortHex = acc.npub.toShortenHex()
|
|
||||||
|
|
||||||
if (acc.displayName != null && acc.displayName != npubShortHex) {
|
if (acc.displayName != null && acc.displayName != npubShortHex) {
|
||||||
Text(acc.displayName)
|
Text(acc.displayName)
|
||||||
|
}
|
||||||
|
|
||||||
|
Text(npubShortHex)
|
||||||
}
|
}
|
||||||
|
Column(modifier = Modifier.width(32.dp)) {
|
||||||
Text(npubShortHex)
|
if (current) {
|
||||||
}
|
Icon(
|
||||||
Column(modifier = Modifier.width(32.dp)) {
|
imageVector = Icons.Default.RadioButtonChecked,
|
||||||
if (current) {
|
contentDescription = stringResource(R.string.account_switch_active_account),
|
||||||
Icon(
|
tint = MaterialTheme.colors.secondary
|
||||||
imageVector = Icons.Default.RadioButtonChecked,
|
)
|
||||||
contentDescription = stringResource(R.string.account_switch_active_account),
|
}
|
||||||
tint = MaterialTheme.colors.secondary
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user