mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-07-26 22:42:17 +00:00
Merge pull request #1180 from luqmanfadlli/fix-ios-animated-avatar
feat: Support animated GIF avatars on iOS
This commit is contained in:
commit
61ab0e7e3d
4 changed files with 21 additions and 12 deletions
|
|
@ -54,6 +54,7 @@ import com.nuvio.app.core.ui.NuvioScreen
|
|||
import com.nuvio.app.core.ui.NuvioScreenHeader
|
||||
import com.nuvio.app.core.ui.NuvioStatusModal
|
||||
import com.nuvio.app.core.ui.NuvioSurfaceCard
|
||||
import com.nuvio.app.features.home.components.CollectionCardRemoteImage
|
||||
import kotlinx.coroutines.launch
|
||||
import nuvio.composeapp.generated.resources.*
|
||||
import org.jetbrains.compose.resources.stringResource
|
||||
|
|
@ -408,11 +409,12 @@ private fun ProfileIdentityCard(
|
|||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
if (customAvatarUrl != null) {
|
||||
AsyncImage(
|
||||
model = customAvatarUrl,
|
||||
CollectionCardRemoteImage(
|
||||
imageUrl = customAvatarUrl,
|
||||
contentDescription = name,
|
||||
modifier = Modifier.size(88.dp).clip(CircleShape),
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
contentScale = ContentScale.Crop,
|
||||
animateIfPossible = true,
|
||||
)
|
||||
} else if (selectedAvatar != null) {
|
||||
AsyncImage(
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
|||
import coil3.compose.AsyncImage
|
||||
import com.nuvio.app.core.auth.AuthRepository
|
||||
import com.nuvio.app.core.auth.AuthState
|
||||
import com.nuvio.app.features.home.components.CollectionCardRemoteImage
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import nuvio.composeapp.generated.resources.*
|
||||
|
|
@ -373,11 +374,12 @@ private fun ProfileAvatarCard(
|
|||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
if (avatarImageUrl != null) {
|
||||
AsyncImage(
|
||||
model = avatarImageUrl,
|
||||
CollectionCardRemoteImage(
|
||||
imageUrl = avatarImageUrl,
|
||||
contentDescription = avatarItem?.displayName ?: profile.name,
|
||||
modifier = Modifier.size(100.dp).clip(CircleShape),
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
contentScale = ContentScale.Crop,
|
||||
animateIfPossible = true,
|
||||
)
|
||||
} else if (profile.name.isNotBlank()) {
|
||||
Text(
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import androidx.compose.foundation.layout.Box
|
|||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.imePadding
|
||||
|
|
@ -69,6 +70,7 @@ import androidx.compose.ui.window.Popup
|
|||
import androidx.compose.ui.window.PopupProperties
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import coil3.compose.AsyncImage
|
||||
import com.nuvio.app.features.home.components.CollectionCardRemoteImage
|
||||
import com.nuvio.app.isIos
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
|
|
@ -504,11 +506,12 @@ private fun PopupProfileBubble(
|
|||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
if (avatarImageUrl != null) {
|
||||
AsyncImage(
|
||||
model = avatarImageUrl,
|
||||
CollectionCardRemoteImage(
|
||||
imageUrl = avatarImageUrl,
|
||||
contentDescription = profile.name,
|
||||
modifier = Modifier.size(48.dp).clip(CircleShape),
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
contentScale = ContentScale.Crop,
|
||||
animateIfPossible = true,
|
||||
)
|
||||
} else if (profile.name.isNotBlank()) {
|
||||
Text(
|
||||
|
|
@ -818,11 +821,12 @@ fun ActiveProfileMiniAvatar(
|
|||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
if (avatarImageUrl != null) {
|
||||
AsyncImage(
|
||||
model = avatarImageUrl,
|
||||
CollectionCardRemoteImage(
|
||||
imageUrl = avatarImageUrl,
|
||||
contentDescription = profile.name,
|
||||
modifier = Modifier.size(size.dp).clip(CircleShape),
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
contentScale = ContentScale.Crop,
|
||||
animateIfPossible = true,
|
||||
)
|
||||
} else if (profile.name.isNotBlank()) {
|
||||
Text(
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ internal actual fun CollectionCardRemoteImage(
|
|||
|
||||
UIKitView(
|
||||
modifier = modifier,
|
||||
interactive = false,
|
||||
factory = {
|
||||
UIImageView().apply {
|
||||
contentMode = UIViewContentMode.UIViewContentModeScaleAspectFill
|
||||
|
|
|
|||
Loading…
Reference in a new issue