diff --git a/stream-video-android-core/api/stream-video-android-core.api b/stream-video-android-core/api/stream-video-android-core.api index 5475daa3d01..6e309aa6554 100644 --- a/stream-video-android-core/api/stream-video-android-core.api +++ b/stream-video-android-core/api/stream-video-android-core.api @@ -8886,7 +8886,6 @@ public final class io/getstream/video/android/core/ClientState { public final fun getRingingCall ()Lkotlinx/coroutines/flow/StateFlow; public final fun getTelecomIntegrationType ()Lio/getstream/video/android/core/notifications/internal/telecom/TelecomIntegrationType; public final fun getUser ()Lkotlinx/coroutines/flow/StateFlow; - public final fun handleError (Lio/getstream/result/Error;)V public final fun handleEvent (Lio/getstream/android/video/generated/models/VideoEvent;)V public final fun hasActiveOrRingingCall ()Z public final fun removeActiveCall ()V @@ -8895,49 +8894,6 @@ public final class io/getstream/video/android/core/ClientState { public final fun setActiveCall (Lio/getstream/video/android/core/Call;)V } -public abstract interface class io/getstream/video/android/core/ConnectionState { -} - -public final class io/getstream/video/android/core/ConnectionState$Connected : io/getstream/video/android/core/ConnectionState { - public static final field INSTANCE Lio/getstream/video/android/core/ConnectionState$Connected; - public fun equals (Ljava/lang/Object;)Z - public fun hashCode ()I - public fun toString ()Ljava/lang/String; -} - -public final class io/getstream/video/android/core/ConnectionState$Disconnected : io/getstream/video/android/core/ConnectionState { - public static final field INSTANCE Lio/getstream/video/android/core/ConnectionState$Disconnected; - public fun equals (Ljava/lang/Object;)Z - public fun hashCode ()I - public fun toString ()Ljava/lang/String; -} - -public final class io/getstream/video/android/core/ConnectionState$Failed : io/getstream/video/android/core/ConnectionState { - public fun (Lio/getstream/result/Error;)V - public final fun getError ()Lio/getstream/result/Error; -} - -public final class io/getstream/video/android/core/ConnectionState$Loading : io/getstream/video/android/core/ConnectionState { - public static final field INSTANCE Lio/getstream/video/android/core/ConnectionState$Loading; - public fun equals (Ljava/lang/Object;)Z - public fun hashCode ()I - public fun toString ()Ljava/lang/String; -} - -public final class io/getstream/video/android/core/ConnectionState$PreConnect : io/getstream/video/android/core/ConnectionState { - public static final field INSTANCE Lio/getstream/video/android/core/ConnectionState$PreConnect; - public fun equals (Ljava/lang/Object;)Z - public fun hashCode ()I - public fun toString ()Ljava/lang/String; -} - -public final class io/getstream/video/android/core/ConnectionState$Reconnecting : io/getstream/video/android/core/ConnectionState { - public static final field INSTANCE Lio/getstream/video/android/core/ConnectionState$Reconnecting; - public fun equals (Ljava/lang/Object;)Z - public fun hashCode ()I - public fun toString ()Ljava/lang/String; -} - public final class io/getstream/video/android/core/CreateCallOptions { public fun ()V public fun (Ljava/util/List;Ljava/util/List;Ljava/util/Map;Lio/getstream/android/video/generated/models/CallSettingsRequest;Lorg/threeten/bp/OffsetDateTime;Ljava/lang/String;)V diff --git a/stream-video-android-core/src/androidTest/kotlin/io/getstream/video/android/core/AndroidDeviceTest.kt b/stream-video-android-core/src/androidTest/kotlin/io/getstream/video/android/core/AndroidDeviceTest.kt index 653418ea80c..499c2d09f81 100644 --- a/stream-video-android-core/src/androidTest/kotlin/io/getstream/video/android/core/AndroidDeviceTest.kt +++ b/stream-video-android-core/src/androidTest/kotlin/io/getstream/video/android/core/AndroidDeviceTest.kt @@ -19,6 +19,7 @@ package io.getstream.video.android.core import app.cash.turbine.test import app.cash.turbine.testIn import com.google.common.truth.Truth.assertThat +import io.getstream.android.core.api.model.connection.StreamConnectionState import io.getstream.android.video.generated.models.MemberRequest import io.getstream.log.taggedLogger import io.getstream.video.android.core.api.SignalServerService @@ -260,7 +261,9 @@ class AndroidDeviceTest : IntegrationTestBase(connectCoordinatorWS = false) { @Test fun coordinatorWSConnection() = runTest { - assertThat(client.state.connection.value).isEqualTo(ConnectionState.Connected) + assertThat( + client.state.connection.value, + ).isInstanceOf(StreamConnectionState.Connected::class.java) } @Test diff --git a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/ClientState.kt b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/ClientState.kt index 3c499c4003d..01b12efaef2 100644 --- a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/ClientState.kt +++ b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/ClientState.kt @@ -17,18 +17,16 @@ package io.getstream.video.android.core import androidx.compose.runtime.Stable +import io.getstream.android.core.api.model.connection.StreamConnectionState import io.getstream.android.video.generated.models.CallCreatedEvent import io.getstream.android.video.generated.models.CallRingEvent -import io.getstream.android.video.generated.models.ConnectedEvent import io.getstream.android.video.generated.models.VideoEvent import io.getstream.log.taggedLogger -import io.getstream.result.Error import io.getstream.video.android.core.internal.InternalStreamVideoApi import io.getstream.video.android.core.notifications.internal.service.CallService import io.getstream.video.android.core.notifications.internal.service.ServiceIntentBuilder import io.getstream.video.android.core.notifications.internal.service.ServiceLauncher import io.getstream.video.android.core.notifications.internal.telecom.TelecomIntegrationType -import io.getstream.video.android.core.socket.coordinator.state.VideoSocketState import io.getstream.video.android.core.utils.safeCallWithDefault import io.getstream.video.android.model.User import kotlinx.coroutines.delay @@ -36,17 +34,6 @@ import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch -// These are UI states, need to move out. -@Stable -public sealed interface ConnectionState { - public data object PreConnect : ConnectionState - public data object Loading : ConnectionState - public data object Connected : ConnectionState - public data object Reconnecting : ConnectionState - public data object Disconnected : ConnectionState - public class Failed(val error: Error) : ConnectionState -} - // These are UI states, need to move out. @Stable public sealed interface RingingState { @@ -64,8 +51,8 @@ class ClientState(private val client: StreamVideo) { // Internal data private val _user: MutableStateFlow = MutableStateFlow(client.user) - private val _connection: MutableStateFlow = - MutableStateFlow(ConnectionState.PreConnect) + private val _connection: MutableStateFlow = + MutableStateFlow(StreamConnectionState.Idle) internal val _ringingCall: MutableStateFlow = MutableStateFlow(null) private val _activeCall: MutableStateFlow = MutableStateFlow(null) @@ -84,8 +71,11 @@ class ClientState(private val client: StreamVideo) { _user.value = user } - /** Coordinator connection state */ - public val connection: StateFlow = _connection + /** + * Coordinator connection state. Surfaces core's [StreamConnectionState] directly — + * the same type the Feeds SDK exposes — so there is no video-local copy to maintain. + */ + public val connection: StateFlow = _connection /** When there is an incoming call, this state will be set. */ public val ringingCall: StateFlow = _ringingCall @@ -127,12 +117,7 @@ class ClientState(private val client: StreamVideo) { * Most event logic happens in the Call instead of the client */ fun handleEvent(event: VideoEvent) { - // mark connected when (event) { - is ConnectedEvent -> { - _connection.value = ConnectionState.Connected - } - is CallCreatedEvent -> { // what's the right thing to do here? // if it's ringing we add it @@ -150,28 +135,9 @@ class ClientState(private val client: StreamVideo) { } } - internal fun handleState(socketState: VideoSocketState) { - val state = when (socketState) { - // Before connection is established - is VideoSocketState.Disconnected.Stopped -> ConnectionState.PreConnect - // Loading - is VideoSocketState.Connecting -> ConnectionState.Loading - // Connected - is VideoSocketState.Connected -> ConnectionState.Connected - // Reconnecting - is VideoSocketState.Disconnected.DisconnectedTemporarily -> ConnectionState.Reconnecting - is VideoSocketState.RestartConnection -> ConnectionState.Reconnecting - // Disconnected - is VideoSocketState.Disconnected.WebSocketEventLost -> ConnectionState.Disconnected - is VideoSocketState.Disconnected.NetworkDisconnected -> ConnectionState.Disconnected - is VideoSocketState.Disconnected.DisconnectedByRequest -> ConnectionState.Disconnected - is VideoSocketState.Disconnected.DisconnectedPermanently -> ConnectionState.Disconnected - } - _connection.value = state - } - - fun handleError(error: Error) { - _connection.value = ConnectionState.Failed(error) + /** Routes the coordinator connection state reported by core's StreamClient listener. */ + internal fun handleStreamState(streamState: StreamConnectionState) { + _connection.value = streamState } /** diff --git a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoClient.kt b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoClient.kt index 61ad61f7fd7..0965933ab52 100644 --- a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoClient.kt +++ b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoClient.kt @@ -230,9 +230,7 @@ internal class StreamVideoClient internal constructor( } override fun onState(state: StreamConnectionState) { - // TODO: replace with this@StreamVideoClient.state.handleStreamState(state) once - // ClientState.handleStreamState lands in the follow-up ConnectionState PR. Held to - // validate the listener wiring at SDK init; connection-state routing comes with it. + this@StreamVideoClient.state.handleStreamState(state) } override fun onError(err: Throwable) { @@ -425,7 +423,7 @@ internal class StreamVideoClient internal constructor( init { // Subscribe once to the StreamClient's listener stream. Events cast to VideoEvent // are forwarded to the existing fireEvent(...) dispatch pipeline; connection state - // routing arrives with the ConnectionState rewrite (see streamClientListener.onState). + // routes through ClientState.handleStreamState (see streamClientListener.onState). streamClientSubscription = streamClient.subscribe(streamClientListener).getOrThrow() // Re-watch active calls whenever the coordinator socket (re)connects. diff --git a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/socket/coordinator/v2/ConnectionStateMapper.kt b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/socket/coordinator/v2/ConnectionStateMapper.kt deleted file mode 100644 index ac2ced5e428..00000000000 --- a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/socket/coordinator/v2/ConnectionStateMapper.kt +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2014-2026 Stream.io Inc. All rights reserved. - * - * Licensed under the Stream License; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://github.com/GetStream/stream-video-android/blob/main/LICENSE - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.getstream.video.android.core.socket.coordinator.v2 - -import io.getstream.android.core.api.model.connection.StreamConnectionState -import io.getstream.result.Error -import io.getstream.video.android.core.ConnectionState - -/** - * Maps a core [StreamConnectionState] onto the SDK's existing [ConnectionState] shape. - * - * The mapping produced here is a placeholder that preserves compilation until a follow-up PR - * reshapes the video [ConnectionState] sealed interface to mirror the richer core states 1:1. - * Once that reshape lands, both this function body and the collaborating tests flip together - * in a single commit. - */ -internal fun StreamConnectionState.toVideoConnectionState(): ConnectionState { - // TODO: replace placeholder mapping when the ConnectionState sealed interface is rewritten. - return when (this) { - is StreamConnectionState.Idle -> ConnectionState.PreConnect - is StreamConnectionState.Connecting.Opening -> ConnectionState.Loading - is StreamConnectionState.Connecting.Authenticating -> ConnectionState.Loading - is StreamConnectionState.Connected -> ConnectionState.Connected - is StreamConnectionState.Disconnected -> { - val throwable = cause - if (throwable == null) { - ConnectionState.Disconnected - } else { - ConnectionState.Failed( - Error.ThrowableError( - message = throwable.message ?: "", - cause = throwable, - ), - ) - } - } - } -} diff --git a/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/ClientAndAuthTest.kt b/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/ClientAndAuthTest.kt index cfc17805610..ca629ba814f 100644 --- a/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/ClientAndAuthTest.kt +++ b/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/ClientAndAuthTest.kt @@ -17,6 +17,7 @@ package io.getstream.video.android.core import com.google.common.truth.Truth.assertThat +import io.getstream.android.core.api.model.connection.StreamConnectionState import io.getstream.android.video.generated.models.ConnectedEvent import io.getstream.android.video.generated.models.VideoEvent import io.getstream.log.taggedLogger @@ -235,14 +236,16 @@ class ClientAndAuthTest : TestBase() { user = testData.users["thierry"]!!, token = authData!!.token, ).build() - assertThat(client.state.connection.value).isEqualTo(ConnectionState.PreConnect) + assertThat(client.state.connection.value).isEqualTo(StreamConnectionState.Idle) val clientImpl = client as StreamVideoClient val connectResultDeferred = clientImpl.connectAsync() val connectResult = connectResultDeferred.await() delay(100L) - assertThat(client.state.connection.value).isEqualTo(ConnectionState.Connected) + assertThat( + client.state.connection.value, + ).isInstanceOf(StreamConnectionState.Connected::class.java) } @Test diff --git a/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/ClientStateConnectionMappingTest.kt b/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/ClientStateConnectionMappingTest.kt deleted file mode 100644 index 1aca624bd03..00000000000 --- a/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/ClientStateConnectionMappingTest.kt +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2014-2026 Stream.io Inc. All rights reserved. - * - * Licensed under the Stream License; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://github.com/GetStream/stream-video-android/blob/main/LICENSE - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.getstream.video.android.core - -import io.getstream.android.core.api.model.connection.StreamConnectedUser -import io.getstream.android.core.api.model.connection.StreamConnectionState -import io.getstream.video.android.core.socket.coordinator.v2.toVideoConnectionState -import org.junit.Test -import java.util.Date -import kotlin.test.assertEquals -import kotlin.test.assertTrue - -/** - * Table-driven mapping test for [StreamConnectionState] -> [ConnectionState] extension. - * - * Asserts the temporary placeholder mapping. A follow-up PR reshapes the video - * [ConnectionState] sealed interface to mirror core 1:1; both this test and the mapper body - * flip together in that PR. - */ -internal class ClientStateConnectionMappingTest { - - @Test - fun `Idle maps to PreConnect`() { - val result = (StreamConnectionState.Idle as StreamConnectionState).toVideoConnectionState() - assertEquals(ConnectionState.PreConnect, result) - // TODO: update expected value when the ConnectionState sealed interface is rewritten - } - - @Test - fun `Connecting Opening maps to Loading`() { - val result: ConnectionState = - StreamConnectionState.Connecting.Opening("user-1").toVideoConnectionState() - assertEquals(ConnectionState.Loading, result) - // TODO: update expected value when the ConnectionState sealed interface is rewritten - } - - @Test - fun `Connecting Authenticating maps to Loading`() { - val result: ConnectionState = - StreamConnectionState.Connecting.Authenticating("user-1").toVideoConnectionState() - assertEquals(ConnectionState.Loading, result) - // TODO: update expected value when the ConnectionState sealed interface is rewritten - } - - @Test - fun `Connected maps to Connected`() { - val result: ConnectionState = StreamConnectionState - .Connected(connectedUserFixture(), "connection-id") - .toVideoConnectionState() - assertEquals(ConnectionState.Connected, result) - // TODO: update expected value when the ConnectionState sealed interface is rewritten - } - - @Test - fun `Disconnected with null cause maps to Disconnected`() { - val result: ConnectionState = - StreamConnectionState.Disconnected(cause = null).toVideoConnectionState() - assertEquals(ConnectionState.Disconnected, result) - // TODO: update expected value when the ConnectionState sealed interface is rewritten - } - - @Test - fun `Disconnected with cause maps to Failed`() { - val boom = IllegalStateException("boom") - val result: ConnectionState = - StreamConnectionState.Disconnected(cause = boom).toVideoConnectionState() - - assertTrue(result is ConnectionState.Failed) - assertEquals("boom", result.error.message) - // TODO: update expected value when the ConnectionState sealed interface is rewritten - } - - private fun connectedUserFixture(): StreamConnectedUser = StreamConnectedUser( - createdAt = Date(0), - id = "user-1", - language = "en", - role = "user", - updatedAt = Date(0), - blockedUserIds = emptyList(), - teams = emptyList(), - ) -} diff --git a/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/ClientStateTest.kt b/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/ClientStateTest.kt new file mode 100644 index 00000000000..2ef7b788d37 --- /dev/null +++ b/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/ClientStateTest.kt @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2014-2026 Stream.io Inc. All rights reserved. + * + * Licensed under the Stream License; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://github.com/GetStream/stream-video-android/blob/main/LICENSE + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.getstream.video.android.core + +import io.getstream.android.core.api.model.connection.StreamConnectedUser +import io.getstream.android.core.api.model.connection.StreamConnectionState +import io.getstream.video.android.model.User +import io.mockk.every +import io.mockk.mockk +import org.junit.Test +import java.util.Date +import kotlin.test.assertEquals +import kotlin.test.assertSame + +/** + * Direct unit test for [ClientState.handleStreamState] — core's [StreamConnectionState] is the + * SDK's public connection state (same pattern as the Feeds SDK), so every reported state must be + * published on [ClientState.connection] unchanged. + * + * The test constructs a bare [ClientState] against a mocked [StreamVideoClient] to avoid pulling + * in the full client dependency graph. + */ +internal class ClientStateTest { + + @Test + fun `initial connection state is Idle`() { + val state = clientState() + + assertEquals(StreamConnectionState.Idle, state.connection.value) + } + + @Test + fun `handleStreamState publishes every reported state unchanged`() { + val state = clientState() + val reportedStates = listOf( + StreamConnectionState.Idle, + StreamConnectionState.Connecting.Opening("user-1"), + StreamConnectionState.Connecting.Authenticating("user-1"), + StreamConnectionState.Connected(connectedUserFixture(), "connection-id"), + StreamConnectionState.Disconnected(cause = null), + StreamConnectionState.Disconnected(cause = RuntimeException("boom")), + ) + + reportedStates.forEach { reported -> + state.handleStreamState(reported) + + assertSame(reported, state.connection.value) + } + } + + private fun clientState(): ClientState { + val streamVideo = mockk(relaxed = true) + every { streamVideo.user } returns User(id = "user-1") + return ClientState(streamVideo) + } + + private fun connectedUserFixture(): StreamConnectedUser = StreamConnectedUser( + createdAt = Date(0), + id = "user-1", + language = "en", + role = "user", + updatedAt = Date(0), + blockedUserIds = emptyList(), + teams = emptyList(), + ) +} diff --git a/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/StreamVideoClientTest.kt b/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/StreamVideoClientTest.kt index ef5a1e413e6..7811ffefaa1 100644 --- a/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/StreamVideoClientTest.kt +++ b/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/StreamVideoClientTest.kt @@ -392,6 +392,18 @@ class StreamVideoClientTest { assertTrue(received.isEmpty()) } + @Test + fun `streamClientListener routes connection state into ClientState`() { + val harness = prepareClient() + val listener = slot() + verify { harness.streamClient.subscribe(capture(listener)) } + val reported = StreamConnectionState.Connecting.Opening("user-1") + + listener.captured.onState(reported) + + assertEquals(reported, harness.client.state.connection.value) + } + @Test fun `streamClientListener onError does not throw`() { val harness = prepareClient() diff --git a/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/rtc/RtcSessionTest.kt b/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/rtc/RtcSessionTest.kt index e4f43803c80..b7d8db95462 100644 --- a/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/rtc/RtcSessionTest.kt +++ b/stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/rtc/RtcSessionTest.kt @@ -17,7 +17,7 @@ package io.getstream.video.android.core.rtc import com.google.common.truth.Truth -import io.getstream.video.android.core.ConnectionState +import io.getstream.video.android.core.RealtimeConnection import io.getstream.video.android.core.base.IntegrationTestBase import io.getstream.video.android.core.events.ICETrickleEvent import io.getstream.video.android.core.events.SFUConnectedEvent @@ -97,7 +97,10 @@ class RtcSessionTest : IntegrationTestBase() { val joinResult = call.join() assertSuccess(joinResult) waitForNextEvent() - Truth.assertThat(call.state.connection.value).isEqualTo(ConnectionState.Connected) + // call.state.connection is a RealtimeConnection (SFU), not the coordinator state. + Truth.assertThat( + call.state.connection.value, + ).isInstanceOf(RealtimeConnection.Joined::class.java) // call.session?.publishVideo() } diff --git a/stream-video-android-ui-xml/api/stream-video-android-ui-xml.api b/stream-video-android-ui-xml/api/stream-video-android-ui-xml.api index b0523e9e594..6e444b11554 100644 --- a/stream-video-android-ui-xml/api/stream-video-android-ui-xml.api +++ b/stream-video-android-ui-xml/api/stream-video-android-ui-xml.api @@ -285,7 +285,7 @@ public abstract interface class io/getstream/video/android/xml/viewmodel/CallVie } public abstract interface class io/getstream/video/android/xml/widget/appbar/CallAppBarContent { - public abstract fun renderState (Lio/getstream/video/android/core/ConnectionState;)V + public abstract fun renderState (Lio/getstream/android/core/api/model/connection/StreamConnectionState;)V } public final class io/getstream/video/android/xml/widget/appbar/CallAppBarStyle { @@ -338,7 +338,7 @@ public final class io/getstream/video/android/xml/widget/appbar/CallAppBarView : public final fun getOnBackPressed ()Lkotlin/jvm/functions/Function0; public final fun getOnParticipantsPressed ()Lkotlin/jvm/functions/Function0; public fun onOrientationChanged (Z)V - public final fun renderState (Lio/getstream/video/android/core/ConnectionState;)V + public final fun renderState (Lio/getstream/android/core/api/model/connection/StreamConnectionState;)V public final fun setCenterContent (Landroid/view/View;Landroid/widget/FrameLayout$LayoutParams;)V public static synthetic fun setCenterContent$default (Lio/getstream/video/android/xml/widget/appbar/CallAppBarView;Landroid/view/View;Landroid/widget/FrameLayout$LayoutParams;ILjava/lang/Object;)V public final fun setLeadingContent (Landroid/view/View;Landroid/widget/FrameLayout$LayoutParams;)V diff --git a/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/CallAppBarContent.kt b/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/CallAppBarContent.kt index 42d887029cf..d811ac5d135 100644 --- a/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/CallAppBarContent.kt +++ b/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/CallAppBarContent.kt @@ -16,7 +16,7 @@ package io.getstream.video.android.xml.widget.appbar -import io.getstream.video.android.core.ConnectionState +import io.getstream.android.core.api.model.connection.StreamConnectionState /** * An interface that must be implemented by the content views of [CallAppBarView]. @@ -28,5 +28,5 @@ public interface CallAppBarContent { * * @param callState The state that will be used to render the updated UI. */ - public fun renderState(callState: ConnectionState) + public fun renderState(callState: StreamConnectionState) } diff --git a/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/CallAppBarView.kt b/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/CallAppBarView.kt index cc9aa3493f3..6e85b208aad 100644 --- a/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/CallAppBarView.kt +++ b/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/CallAppBarView.kt @@ -24,7 +24,7 @@ import android.view.View import android.widget.FrameLayout import androidx.core.view.children import androidx.core.view.setPadding -import io.getstream.video.android.core.ConnectionState +import io.getstream.android.core.api.model.connection.StreamConnectionState import io.getstream.video.android.xml.databinding.StreamVideoViewCallAppBarBinding import io.getstream.video.android.xml.font.TextStyle import io.getstream.video.android.xml.font.setTextStyle @@ -213,7 +213,7 @@ public class CallAppBarView : CallConstraintLayout { * * @param callState The state that will be used to render the updated UI. */ - public fun renderState(callState: ConnectionState) { + public fun renderState(callState: StreamConnectionState) { (binding.callAppBarLeadingContent.children.firstOrNull() as? CallAppBarContent)?.renderState( callState, ) diff --git a/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/internal/DefaultCallAppBarCenterContent.kt b/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/internal/DefaultCallAppBarCenterContent.kt index b6f500d1f79..d5c2aacd6bd 100644 --- a/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/internal/DefaultCallAppBarCenterContent.kt +++ b/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/internal/DefaultCallAppBarCenterContent.kt @@ -20,7 +20,7 @@ import android.content.Context import android.text.TextUtils import android.util.AttributeSet import androidx.appcompat.widget.AppCompatTextView -import io.getstream.video.android.core.ConnectionState +import io.getstream.android.core.api.model.connection.StreamConnectionState import io.getstream.video.android.xml.utils.extensions.createStreamThemeWrapper import io.getstream.video.android.xml.widget.appbar.CallAppBarContent @@ -41,7 +41,7 @@ internal class DefaultCallAppBarCenterContent : AppCompatTextView, CallAppBarCon ellipsize = TextUtils.TruncateAt.END } - override fun renderState(callState: ConnectionState) { + override fun renderState(callState: StreamConnectionState) { text = "" } } diff --git a/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/internal/DefaultCallAppBarLeadingContent.kt b/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/internal/DefaultCallAppBarLeadingContent.kt index 18b37a590ad..aead0ae4f8d 100644 --- a/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/internal/DefaultCallAppBarLeadingContent.kt +++ b/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/internal/DefaultCallAppBarLeadingContent.kt @@ -19,7 +19,7 @@ package io.getstream.video.android.xml.widget.appbar.internal import android.content.Context import android.util.AttributeSet import androidx.appcompat.widget.AppCompatImageView -import io.getstream.video.android.core.ConnectionState +import io.getstream.android.core.api.model.connection.StreamConnectionState import io.getstream.video.android.xml.utils.extensions.createStreamThemeWrapper import io.getstream.video.android.xml.utils.extensions.setBackgroundRipple import io.getstream.video.android.xml.widget.appbar.CallAppBarContent @@ -40,5 +40,5 @@ internal class DefaultCallAppBarLeadingContent : AppCompatImageView, CallAppBarC setBackgroundRipple() } - override fun renderState(callState: ConnectionState) {} + override fun renderState(callState: StreamConnectionState) {} } diff --git a/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/internal/DefaultCallAppBarTrailingContent.kt b/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/internal/DefaultCallAppBarTrailingContent.kt index 521008d5c2e..90aacad91d2 100644 --- a/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/internal/DefaultCallAppBarTrailingContent.kt +++ b/stream-video-android-ui-xml/src/main/kotlin/io/getstream/video/android/xml/widget/appbar/internal/DefaultCallAppBarTrailingContent.kt @@ -19,7 +19,7 @@ package io.getstream.video.android.xml.widget.appbar.internal import android.content.Context import android.util.AttributeSet import androidx.appcompat.widget.AppCompatImageView -import io.getstream.video.android.core.ConnectionState +import io.getstream.android.core.api.model.connection.StreamConnectionState import io.getstream.video.android.xml.utils.extensions.createStreamThemeWrapper import io.getstream.video.android.xml.utils.extensions.setBackgroundRipple import io.getstream.video.android.xml.widget.appbar.CallAppBarContent @@ -40,5 +40,5 @@ internal class DefaultCallAppBarTrailingContent : AppCompatImageView, CallAppBar setBackgroundRipple() } - override fun renderState(callState: ConnectionState) {} + override fun renderState(callState: StreamConnectionState) {} }