diff --git a/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/views/chatlist/ChatListView.android.kt b/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/views/chatlist/ChatListView.android.kt index 7fef60e782..870a97f4dd 100644 --- a/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/views/chatlist/ChatListView.android.kt +++ b/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/views/chatlist/ChatListView.android.kt @@ -18,16 +18,12 @@ import chat.simplex.common.platform.* import chat.simplex.common.ui.theme.* import chat.simplex.common.views.call.* import chat.simplex.common.views.helpers.* -import chat.simplex.res.MR -import dev.icerock.moko.resources.compose.painterResource -import dev.icerock.moko.resources.compose.stringResource import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.datetime.Clock @Composable actual fun ActiveCallInteractiveArea(call: Call, newChatSheetState: MutableStateFlow) { - val media = call.peerMedia ?: call.localMedia Row( Modifier .fillMaxSize() @@ -39,14 +35,6 @@ actual fun ActiveCallInteractiveArea(call: Call, newChatSheetState: MutableState verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.Center ) { - if (chatModel.users.size > 1) { - ProfileImage(size = 30.dp, image = call.user.image, color = MaterialTheme.colors.secondaryVariant) - Spacer(Modifier.width(4.dp)) - } - if (media == CallMediaType.Video) CallIcon(painterResource(MR.images.ic_videocam_filled), stringResource(MR.strings.icon_descr_video_call)) - else CallIcon(painterResource(MR.images.ic_call_filled), stringResource(MR.strings.icon_descr_audio_call)) - Spacer(Modifier.width(4.dp)) - ProfileImage(size = 30.dp, image = call.contact.profile.image) Spacer(Modifier.weight(1f)) CallDuration(call) } @@ -62,9 +50,6 @@ actual fun ActiveCallInteractiveArea(call: Call, newChatSheetState: MutableState } } -@Composable -private fun CallIcon(icon: Painter, descr: String) = Icon(icon, descr, Modifier.size(20.dp), tint = Color.White) - @Composable private fun CallDuration(call: Call) { val connectedAt = call.connectedAt diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/App.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/App.kt index b924a7bf32..fdd6827d06 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/App.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/App.kt @@ -5,12 +5,14 @@ import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.* +import androidx.compose.foundation.shape.CircleShape import androidx.compose.material.* import androidx.compose.runtime.* import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clipToBounds +import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.unit.dp import chat.simplex.common.views.usersettings.SetDeliveryReceiptsView @@ -218,11 +220,6 @@ fun AndroidScreen(settingsState: SettingsViewState) { BoxWithConstraints { val call = remember { chatModel.activeCall} .value val showCallArea = call != null && call.callState != CallState.WaitCapabilities - if (call != null && showCallArea) { - Box(Modifier.height(CALL_INTERACTIVE_AREA_HEIGHT)) { - ActiveCallInteractiveArea(call, remember { MutableStateFlow(AnimatedViewState.GONE) }) - } - } var currentChatId by rememberSaveable { mutableStateOf(chatModel.chatId.value) } val offset = remember { Animatable(if (chatModel.chatId.value == null) 0f else maxWidth.value) } Box( @@ -265,6 +262,17 @@ fun AndroidScreen(settingsState: SettingsViewState) { ChatView(it, chatModel, onComposed) } } + if (call != null && showCallArea) { + Box(Modifier.height(CALL_INTERACTIVE_AREA_HEIGHT + 10.dp)) { + Box(Modifier.height(CALL_INTERACTIVE_AREA_HEIGHT)) { + ActiveCallInteractiveArea(call, remember { MutableStateFlow(AnimatedViewState.GONE) }) + } + Box(Modifier.size(50.dp).background(SimplexGreen, CircleShape).align(Alignment.BottomCenter), contentAlignment = Alignment.Center) { + val media = call.peerMedia ?: call.localMedia + Icon(painterResource(if (media == CallMediaType.Video) MR.images.ic_videocam_filled else MR.images.ic_call_filled), null, Modifier.size(30.dp), tint = Color.White) + } + } + } } }