Skip to content

Commit

Permalink
Merge branch 'refs/heads/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandar-apostolov committed Sep 27, 2024
2 parents e9fec70 + 3f45333 commit bf571cb
Show file tree
Hide file tree
Showing 39 changed files with 1,151 additions and 587 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ object Configuration {
const val minSdk = 24
const val majorVersion = 1
const val minorVersion = 0
const val patchVersion = 14
const val patchVersion = 15
const val versionName = "$majorVersion.$minorVersion.$patchVersion"
const val versionCode = 38
const val versionCode = 39
const val snapshotVersionName = "$majorVersion.$minorVersion.${patchVersion + 1}-SNAPSHOT"
const val artifactGroup = "io.getstream"
const val streamVideoCallGooglePlayVersion = "1.1.7"
const val streamVideoCallGooglePlayVersion = "1.1.8"
const val streamWebRtcVersionName = "1.1.1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
import io.getstream.chat.android.ui.common.state.messages.list.MessageItemState
import io.getstream.video.android.BuildConfig
import io.getstream.video.android.R
import io.getstream.video.android.compose.pip.rememberIsInPipMode
import io.getstream.video.android.compose.theme.VideoTheme
import io.getstream.video.android.compose.ui.components.base.StreamBadgeBox
import io.getstream.video.android.compose.ui.components.base.StreamDialogPositiveNegative
Expand Down Expand Up @@ -411,27 +412,32 @@ fun CallScreen(
},
)

if (participantsSize.size == 1 && !chatState.isVisible && orientation == Configuration.ORIENTATION_PORTRAIT) {
val context = LocalContext.current
val clipboardManager = remember(context) {
context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager
}
val env = AppConfig.currentEnvironment.collectAsStateWithLifecycle()
Popup(
alignment = Alignment.BottomCenter,
offset = IntOffset(
0,
-(VideoTheme.dimens.componentHeightL + VideoTheme.dimens.spacingS).toPx()
.toInt(),
),
val isPictureInPictureMode = rememberIsInPipMode()
if (!isPictureInPictureMode) {
if (participantsSize.size == 1 &&
!chatState.isVisible &&
orientation == Configuration.ORIENTATION_PORTRAIT
) {
ShareCallWithOthers(
modifier = Modifier.fillMaxWidth(),
call = call,
clipboardManager = clipboardManager,
env = env,
context = context,
)
val clipboardManager = remember(context) {
context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager
}
val env = AppConfig.currentEnvironment.collectAsStateWithLifecycle()
Popup(
alignment = Alignment.BottomCenter,
offset = IntOffset(
0,
-(VideoTheme.dimens.componentHeightL + VideoTheme.dimens.spacingS).toPx()
.toInt(),
),
) {
ShareCallWithOthers(
modifier = Modifier.fillMaxWidth(),
call = call,
clipboardManager = clipboardManager,
env = env,
context = context,
)
}
}
}

Expand All @@ -440,7 +446,13 @@ fun CallScreen(
}

if (showingLandscapeControls && orientation == Configuration.ORIENTATION_LANDSCAPE) {
LandscapeControls(call) {
LandscapeControls(call, onChat = {
showingLandscapeControls = false
scope.launch { chatState.show() }
}, onSettings = {
showingLandscapeControls = false
isShowingSettingMenu = true
}) {
showingLandscapeControls = !showingLandscapeControls
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ import androidx.compose.foundation.layout.Arrangement
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.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.CallEnd
import androidx.compose.material.icons.filled.Settings
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
Expand All @@ -38,6 +41,7 @@ import androidx.compose.ui.window.Popup
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import io.getstream.video.android.compose.theme.VideoTheme
import io.getstream.video.android.compose.ui.components.base.StreamButton
import io.getstream.video.android.compose.ui.components.call.controls.actions.ChatDialogAction
import io.getstream.video.android.compose.ui.components.call.controls.actions.FlipCameraAction
import io.getstream.video.android.compose.ui.components.call.controls.actions.ToggleCameraAction
import io.getstream.video.android.compose.ui.components.call.controls.actions.ToggleMicrophoneAction
Expand All @@ -48,7 +52,12 @@ import io.getstream.video.android.mock.previewCall
import io.getstream.video.android.tooling.extensions.toPx

@Composable
fun LandscapeControls(call: Call, onDismiss: () -> Unit) {
fun LandscapeControls(
call: Call,
onChat: () -> Unit,
onSettings: () -> Unit,
onDismiss: () -> Unit,
) {
val isCameraEnabled by call.camera.isEnabled.collectAsStateWithLifecycle()
val isMicrophoneEnabled by call.microphone.isEnabled.collectAsStateWithLifecycle()
val toggleCamera = {
Expand Down Expand Up @@ -76,6 +85,8 @@ fun LandscapeControls(call: Call, onDismiss: () -> Unit) {
camera = toggleCamera,
mic = toggleMicrophone,
onClick = onClick,
onChat = onChat,
onSettings = onSettings,
) {
onDismiss()
}
Expand All @@ -87,6 +98,8 @@ fun LandscapeControlsContent(
isCameraEnabled: Boolean,
isMicEnabled: Boolean,
call: Call,
onChat: () -> Unit,
onSettings: () -> Unit,
camera: () -> Unit,
mic: () -> Unit,
onClick: () -> Unit,
Expand All @@ -107,21 +120,36 @@ fun LandscapeControlsContent(
ReactionsMenu(call = call, reactionMapper = ReactionMapper.defaultReactionMapper()) {
onDismiss()
}
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween,
) {
ToggleCameraAction(isCameraEnabled = isCameraEnabled) {
camera()
}
ToggleMicrophoneAction(isMicrophoneEnabled = isMicEnabled) {
mic()
}
FlipCameraAction {
call.camera.flip()
}
Column {
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween,
) {
ToggleCameraAction(isCameraEnabled = isCameraEnabled) {
camera()
}
ToggleMicrophoneAction(isMicrophoneEnabled = isMicEnabled) {
mic()
}
FlipCameraAction {
call.camera.flip()
}

ChatDialogAction(
messageCount = 0,
onCallAction = { onChat() },
)
}
Spacer(modifier = Modifier.height(16.dp))
StreamButton(
modifier = Modifier.fillMaxWidth(),
style = VideoTheme.styles.buttonStyles.primaryIconButtonStyle(),
icon = Icons.Default.Settings,
text = "Settings",
onClick = onSettings,
)
StreamButton(
modifier = Modifier.fillMaxWidth(),
style = VideoTheme.styles.buttonStyles.alertButtonStyle(),
icon = Icons.Default.CallEnd,
text = "Leave call",
Expand All @@ -144,6 +172,8 @@ fun LandscapeControlsPreview() {
{},
{},
{},
{},
{},
) {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,5 @@ fun MyRingingCallScreen() {
So you'll be able to render your own composable or navigate to a different screen depending on the call state.
## Sounds
The SDK plays default sounds for incoming and outgoing calls. You can customize the sounds by passing your own instance of the `Sounds` class to `StreamVideoBuilder`.
`Sounds` has two properties, `incomingCallSound` and `outgoingCallSound`. You need to assign raw resource identifiers to these properties. These identifiers correspond to audio files in your project's `res/raw` directory.

To disable sounds, pass `null` to `incomingCallSound` or `outgoingCallSound`.
The SDK plays sounds for incoming and outgoing calls. Read [here](../06-advanced/01-ringing.mdx#sounds) for more details.
Loading

0 comments on commit bf571cb

Please sign in to comment.