diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/call/CallManager.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/call/CallManager.kt index f6b3c899ae..1a2f5df573 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/call/CallManager.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/call/CallManager.kt @@ -3,6 +3,7 @@ package chat.simplex.common.views.call import chat.simplex.common.model.ChatModel import chat.simplex.common.platform.* import chat.simplex.common.views.helpers.withApi +import chat.simplex.common.views.usersettings.showInDevelopingAlert import kotlinx.datetime.Clock import kotlin.time.Duration.Companion.minutes @@ -24,6 +25,9 @@ class CallManager(val chatModel: ChatModel) { } fun acceptIncomingCall(invitation: RcvCallInvitation) { + if (appPlatform.isDesktop) { + return showInDevelopingAlert() + } val call = chatModel.activeCall.value if (call == null) { justAcceptIncomingCall(invitation = invitation) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt index 84a9d02bfd..209d1a80a9 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt @@ -34,6 +34,7 @@ import chat.simplex.common.views.helpers.* import chat.simplex.common.model.GroupInfo import chat.simplex.common.platform.* import chat.simplex.common.platform.AudioPlayer +import chat.simplex.common.views.usersettings.showInDevelopingAlert import chat.simplex.res.MR import kotlinx.coroutines.* import kotlinx.coroutines.flow.* @@ -236,7 +237,10 @@ fun ChatView(chatId: String, chatModel: ChatModel, onComposed: () -> Unit) { joinGroup = { groupId -> withApi { chatModel.controller.apiJoinGroup(groupId) } }, - startCall = { media -> + startCall = out@ { media -> + if (appPlatform.isDesktop) { + return@out showInDevelopingAlert() + } val cInfo = chat.chatInfo if (cInfo is ChatInfo.Direct) { chatModel.activeCall.value = Call(contact = cInfo.contact, callState = CallState.WaitCapabilities, localMedia = media) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/SendMsgView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/SendMsgView.kt index af8f4520b2..a660b75f31 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/SendMsgView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/SendMsgView.kt @@ -24,6 +24,7 @@ import chat.simplex.common.views.chat.item.ItemAction import chat.simplex.common.views.helpers.* import chat.simplex.common.model.ChatItem import chat.simplex.common.platform.* +import chat.simplex.common.views.usersettings.showInDevelopingAlert import chat.simplex.res.MR import dev.icerock.moko.resources.compose.stringResource import dev.icerock.moko.resources.compose.painterResource @@ -320,7 +321,10 @@ private fun RecordVoiceView(recState: MutableState, stopRecOnNex LockToCurrentOrientationUntilDispose() StopRecordButton(stopRecordingAndAddAudio) } else { - val startRecording: () -> Unit = { + val startRecording: () -> Unit = out@ { + if (appPlatform.isDesktop) { + return@out showInDevelopingAlert() + } recState.value = RecordingState.Started( filePath = rec.start { progress: Int?, finished: Boolean -> val state = recState.value diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/DeveloperView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/DeveloperView.kt index c69ba20939..68aa1fff9e 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/DeveloperView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/DeveloperView.kt @@ -13,6 +13,7 @@ import androidx.compose.ui.platform.LocalUriHandler import dev.icerock.moko.resources.compose.painterResource import dev.icerock.moko.resources.compose.stringResource import chat.simplex.common.model.ChatModel +import chat.simplex.common.platform.appPlatform import chat.simplex.common.views.TerminalView import chat.simplex.common.views.helpers.* import chat.simplex.res.MR @@ -41,3 +42,10 @@ fun DeveloperView( SectionBottomSpacer() } } + +fun showInDevelopingAlert() { + AlertManager.shared.showAlertMsg( + title = generalGetString(MR.strings.in_developing_title), + text = generalGetString(MR.strings.in_developing_desc) + ) +} diff --git a/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml b/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml index ac7451c389..9ed0c6fbd4 100644 --- a/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml +++ b/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml @@ -1526,4 +1526,8 @@ Delivery receipts are disabled! You can enable them later via app Privacy & Security settings. Error enabling delivery receipts! + + + Coming soon! + This feature is not yet supported. Try the next release. diff --git a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/RecAndPlay.desktop.kt b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/RecAndPlay.desktop.kt index 7e2ab9d5d0..2ba6f3b3f6 100644 --- a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/RecAndPlay.desktop.kt +++ b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/RecAndPlay.desktop.kt @@ -2,6 +2,7 @@ package chat.simplex.common.platform import androidx.compose.runtime.MutableState import chat.simplex.common.model.ChatItem +import chat.simplex.common.views.usersettings.showInDevelopingAlert import kotlinx.coroutines.CoroutineScope actual class RecorderNative: RecorderInterface { @@ -18,7 +19,7 @@ actual class RecorderNative: RecorderInterface { actual object AudioPlayer: AudioPlayerInterface { override fun play(filePath: String?, audioPlaying: MutableState, progress: MutableState, duration: MutableState, resetOnEnd: Boolean) { - /*LALAL*/ + showInDevelopingAlert() } override fun stop() { diff --git a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/VideoPlayer.desktop.kt b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/VideoPlayer.desktop.kt index 0c40c1c350..90f6a593f5 100644 --- a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/VideoPlayer.desktop.kt +++ b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/VideoPlayer.desktop.kt @@ -1,7 +1,9 @@ package chat.simplex.common.platform import androidx.compose.runtime.MutableState +import androidx.compose.runtime.mutableStateOf import androidx.compose.ui.graphics.ImageBitmap +import chat.simplex.common.views.usersettings.showInDevelopingAlert import java.net.URI actual class VideoPlayer: VideoPlayerInterface { @@ -12,39 +14,40 @@ actual class VideoPlayer: VideoPlayerInterface { defaultPreview: ImageBitmap, defaultDuration: Long, soundEnabled: Boolean - ): VideoPlayer = VideoPlayer() - actual fun enableSound(enable: Boolean, fileName: String?, gallery: Boolean): Boolean { TODO() } - actual fun release(uri: URI, gallery: Boolean, remove: Boolean) { TODO() } + ): VideoPlayer = VideoPlayer().also { + it.preview.value = defaultPreview + it.duration.value = defaultDuration + it.soundEnabled.value = soundEnabled + } + actual fun enableSound(enable: Boolean, fileName: String?, gallery: Boolean): Boolean { /*TODO*/ return false } + actual fun release(uri: URI, gallery: Boolean, remove: Boolean) { /*TODO*/ } actual fun stopAll() { /*LALAL*/ } actual fun releaseAll() { /*LALAL*/ } } - override val soundEnabled: MutableState - get() = TODO("Not yet implemented") - override val brokenVideo: MutableState - get() = TODO("Not yet implemented") - override val videoPlaying: MutableState - get() = TODO("Not yet implemented") - override val progress: MutableState - get() = TODO("Not yet implemented") - override val duration: MutableState - get() = TODO("Not yet implemented") - override val preview: MutableState - get() = TODO("Not yet implemented") + override val soundEnabled: MutableState = mutableStateOf(false) + override val brokenVideo: MutableState = mutableStateOf(false) + override val videoPlaying: MutableState = mutableStateOf(false) + override val progress: MutableState = mutableStateOf(0L) + override val duration: MutableState = mutableStateOf(0L) + override val preview: MutableState = mutableStateOf(ImageBitmap(0, 0)) override fun stop() { - TODO("Not yet implemented") + /*TODO*/ } override fun play(resetOnEnd: Boolean) { - TODO("Not yet implemented") + if (appPlatform.isDesktop) { + showInDevelopingAlert() + } } override fun enableSound(enable: Boolean): Boolean { - TODO("Not yet implemented") + /*TODO*/ + return false } override fun release(remove: Boolean) { - TODO("Not yet implemented") + /*TODO*/ } }