mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 09:49:30 +01:00
Convert private story settings fragment to compose.
This commit is contained in:
committed by
jeffrey-signal
parent
24c8501985
commit
55040091af
@@ -18,6 +18,7 @@ import androidx.compose.ui.viewinterop.AndroidView
|
||||
import org.thoughtcrime.securesms.components.AvatarImageView
|
||||
import org.thoughtcrime.securesms.database.model.ProfileAvatarFileDetails
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId
|
||||
import org.thoughtcrime.securesms.recipients.rememberRecipientField
|
||||
|
||||
@Composable
|
||||
@@ -26,6 +27,21 @@ fun AvatarImage(
|
||||
modifier: Modifier = Modifier,
|
||||
useProfile: Boolean = true,
|
||||
contentDescription: String? = null
|
||||
) {
|
||||
AvatarImage(
|
||||
recipientId = recipient.id,
|
||||
modifier = modifier,
|
||||
useProfile = useProfile,
|
||||
contentDescription = contentDescription
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun AvatarImage(
|
||||
recipientId: RecipientId,
|
||||
modifier: Modifier = Modifier,
|
||||
useProfile: Boolean = true,
|
||||
contentDescription: String? = null
|
||||
) {
|
||||
if (LocalInspectionMode.current) {
|
||||
Spacer(
|
||||
@@ -34,7 +50,7 @@ fun AvatarImage(
|
||||
)
|
||||
} else {
|
||||
val context = LocalContext.current
|
||||
val avatarImageState by rememberRecipientField(recipient) {
|
||||
val avatarImageState by rememberRecipientField(recipientId) {
|
||||
AvatarImageState(
|
||||
getDisplayName(context),
|
||||
this,
|
||||
|
||||
Reference in New Issue
Block a user