feat: Update UnlockScreen to display account initials and username for better user identification
This commit is contained in:
@@ -41,6 +41,7 @@ import com.rosetta.messenger.network.ProtocolManager
|
|||||||
import com.rosetta.messenger.network.ProtocolState
|
import com.rosetta.messenger.network.ProtocolState
|
||||||
import com.rosetta.messenger.ui.chats.getAvatarColor
|
import com.rosetta.messenger.ui.chats.getAvatarColor
|
||||||
import com.rosetta.messenger.ui.chats.getAvatarText
|
import com.rosetta.messenger.ui.chats.getAvatarText
|
||||||
|
import com.rosetta.messenger.ui.chats.utils.getInitials
|
||||||
import com.rosetta.messenger.ui.onboarding.PrimaryBlue
|
import com.rosetta.messenger.ui.onboarding.PrimaryBlue
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@@ -252,7 +253,7 @@ fun UnlockScreen(
|
|||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = getAvatarText(selectedAccount!!.publicKey),
|
text = getInitials(selectedAccount!!.name),
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
color = avatarColors.textColor
|
color = avatarColors.textColor
|
||||||
@@ -273,8 +274,10 @@ fun UnlockScreen(
|
|||||||
overflow = TextOverflow.Ellipsis
|
overflow = TextOverflow.Ellipsis
|
||||||
)
|
)
|
||||||
if (selectedAccount != null) {
|
if (selectedAccount != null) {
|
||||||
|
val displayText = selectedAccount!!.encryptedAccount.username
|
||||||
|
?: selectedAccount!!.publicKey.take(20) + "..."
|
||||||
Text(
|
Text(
|
||||||
text = selectedAccount!!.publicKey.take(20) + "...",
|
text = displayText,
|
||||||
fontSize = 13.sp,
|
fontSize = 13.sp,
|
||||||
color = secondaryTextColor,
|
color = secondaryTextColor,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
@@ -438,7 +441,7 @@ fun UnlockScreen(
|
|||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = getAvatarText(account.publicKey),
|
text = getInitials(account.name),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
color = avatarColors.textColor
|
color = avatarColors.textColor
|
||||||
@@ -458,8 +461,10 @@ fun UnlockScreen(
|
|||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
overflow = TextOverflow.Ellipsis
|
overflow = TextOverflow.Ellipsis
|
||||||
)
|
)
|
||||||
|
val displayText = account.encryptedAccount.username
|
||||||
|
?: account.publicKey.take(16) + "..."
|
||||||
Text(
|
Text(
|
||||||
text = account.publicKey.take(16) + "...",
|
text = displayText,
|
||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
color = secondaryTextColor,
|
color = secondaryTextColor,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user