Skip to content

Commit bf571cb

Browse files
Merge branch 'refs/heads/develop'
2 parents e9fec70 + 3f45333 commit bf571cb

File tree

39 files changed

+1151
-587
lines changed

39 files changed

+1151
-587
lines changed

buildSrc/src/main/kotlin/io/getstream/video/android/Configuration.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ object Configuration {
66
const val minSdk = 24
77
const val majorVersion = 1
88
const val minorVersion = 0
9-
const val patchVersion = 14
9+
const val patchVersion = 15
1010
const val versionName = "$majorVersion.$minorVersion.$patchVersion"
11-
const val versionCode = 38
11+
const val versionCode = 39
1212
const val snapshotVersionName = "$majorVersion.$minorVersion.${patchVersion + 1}-SNAPSHOT"
1313
const val artifactGroup = "io.getstream"
14-
const val streamVideoCallGooglePlayVersion = "1.1.7"
14+
const val streamVideoCallGooglePlayVersion = "1.1.8"
1515
const val streamWebRtcVersionName = "1.1.1"
1616
}

demo-app/src/main/kotlin/io/getstream/video/android/ui/call/CallScreen.kt

+33-21
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
7070
import io.getstream.chat.android.ui.common.state.messages.list.MessageItemState
7171
import io.getstream.video.android.BuildConfig
7272
import io.getstream.video.android.R
73+
import io.getstream.video.android.compose.pip.rememberIsInPipMode
7374
import io.getstream.video.android.compose.theme.VideoTheme
7475
import io.getstream.video.android.compose.ui.components.base.StreamBadgeBox
7576
import io.getstream.video.android.compose.ui.components.base.StreamDialogPositiveNegative
@@ -411,27 +412,32 @@ fun CallScreen(
411412
},
412413
)
413414

414-
if (participantsSize.size == 1 && !chatState.isVisible && orientation == Configuration.ORIENTATION_PORTRAIT) {
415-
val context = LocalContext.current
416-
val clipboardManager = remember(context) {
417-
context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager
418-
}
419-
val env = AppConfig.currentEnvironment.collectAsStateWithLifecycle()
420-
Popup(
421-
alignment = Alignment.BottomCenter,
422-
offset = IntOffset(
423-
0,
424-
-(VideoTheme.dimens.componentHeightL + VideoTheme.dimens.spacingS).toPx()
425-
.toInt(),
426-
),
415+
val isPictureInPictureMode = rememberIsInPipMode()
416+
if (!isPictureInPictureMode) {
417+
if (participantsSize.size == 1 &&
418+
!chatState.isVisible &&
419+
orientation == Configuration.ORIENTATION_PORTRAIT
427420
) {
428-
ShareCallWithOthers(
429-
modifier = Modifier.fillMaxWidth(),
430-
call = call,
431-
clipboardManager = clipboardManager,
432-
env = env,
433-
context = context,
434-
)
421+
val clipboardManager = remember(context) {
422+
context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager
423+
}
424+
val env = AppConfig.currentEnvironment.collectAsStateWithLifecycle()
425+
Popup(
426+
alignment = Alignment.BottomCenter,
427+
offset = IntOffset(
428+
0,
429+
-(VideoTheme.dimens.componentHeightL + VideoTheme.dimens.spacingS).toPx()
430+
.toInt(),
431+
),
432+
) {
433+
ShareCallWithOthers(
434+
modifier = Modifier.fillMaxWidth(),
435+
call = call,
436+
clipboardManager = clipboardManager,
437+
env = env,
438+
context = context,
439+
)
440+
}
435441
}
436442
}
437443

@@ -440,7 +446,13 @@ fun CallScreen(
440446
}
441447

442448
if (showingLandscapeControls && orientation == Configuration.ORIENTATION_LANDSCAPE) {
443-
LandscapeControls(call) {
449+
LandscapeControls(call, onChat = {
450+
showingLandscapeControls = false
451+
scope.launch { chatState.show() }
452+
}, onSettings = {
453+
showingLandscapeControls = false
454+
isShowingSettingMenu = true
455+
}) {
444456
showingLandscapeControls = !showingLandscapeControls
445457
}
446458
}

demo-app/src/main/kotlin/io/getstream/video/android/ui/call/LandscapeControls.kt

+44-14
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@ import androidx.compose.foundation.layout.Arrangement
2121
import androidx.compose.foundation.layout.Box
2222
import androidx.compose.foundation.layout.Column
2323
import androidx.compose.foundation.layout.Row
24+
import androidx.compose.foundation.layout.Spacer
2425
import androidx.compose.foundation.layout.fillMaxWidth
26+
import androidx.compose.foundation.layout.height
2527
import androidx.compose.foundation.layout.padding
2628
import androidx.compose.foundation.layout.width
2729
import androidx.compose.material.icons.Icons
2830
import androidx.compose.material.icons.filled.CallEnd
31+
import androidx.compose.material.icons.filled.Settings
2932
import androidx.compose.runtime.Composable
3033
import androidx.compose.runtime.getValue
3134
import androidx.compose.ui.Alignment
@@ -38,6 +41,7 @@ import androidx.compose.ui.window.Popup
3841
import androidx.lifecycle.compose.collectAsStateWithLifecycle
3942
import io.getstream.video.android.compose.theme.VideoTheme
4043
import io.getstream.video.android.compose.ui.components.base.StreamButton
44+
import io.getstream.video.android.compose.ui.components.call.controls.actions.ChatDialogAction
4145
import io.getstream.video.android.compose.ui.components.call.controls.actions.FlipCameraAction
4246
import io.getstream.video.android.compose.ui.components.call.controls.actions.ToggleCameraAction
4347
import io.getstream.video.android.compose.ui.components.call.controls.actions.ToggleMicrophoneAction
@@ -48,7 +52,12 @@ import io.getstream.video.android.mock.previewCall
4852
import io.getstream.video.android.tooling.extensions.toPx
4953

5054
@Composable
51-
fun LandscapeControls(call: Call, onDismiss: () -> Unit) {
55+
fun LandscapeControls(
56+
call: Call,
57+
onChat: () -> Unit,
58+
onSettings: () -> Unit,
59+
onDismiss: () -> Unit,
60+
) {
5261
val isCameraEnabled by call.camera.isEnabled.collectAsStateWithLifecycle()
5362
val isMicrophoneEnabled by call.microphone.isEnabled.collectAsStateWithLifecycle()
5463
val toggleCamera = {
@@ -76,6 +85,8 @@ fun LandscapeControls(call: Call, onDismiss: () -> Unit) {
7685
camera = toggleCamera,
7786
mic = toggleMicrophone,
7887
onClick = onClick,
88+
onChat = onChat,
89+
onSettings = onSettings,
7990
) {
8091
onDismiss()
8192
}
@@ -87,6 +98,8 @@ fun LandscapeControlsContent(
8798
isCameraEnabled: Boolean,
8899
isMicEnabled: Boolean,
89100
call: Call,
101+
onChat: () -> Unit,
102+
onSettings: () -> Unit,
90103
camera: () -> Unit,
91104
mic: () -> Unit,
92105
onClick: () -> Unit,
@@ -107,21 +120,36 @@ fun LandscapeControlsContent(
107120
ReactionsMenu(call = call, reactionMapper = ReactionMapper.defaultReactionMapper()) {
108121
onDismiss()
109122
}
110-
Row(
111-
modifier = Modifier.fillMaxWidth(),
112-
horizontalArrangement = Arrangement.SpaceBetween,
113-
) {
114-
ToggleCameraAction(isCameraEnabled = isCameraEnabled) {
115-
camera()
116-
}
117-
ToggleMicrophoneAction(isMicrophoneEnabled = isMicEnabled) {
118-
mic()
119-
}
120-
FlipCameraAction {
121-
call.camera.flip()
122-
}
123+
Column {
124+
Row(
125+
modifier = Modifier.fillMaxWidth(),
126+
horizontalArrangement = Arrangement.SpaceBetween,
127+
) {
128+
ToggleCameraAction(isCameraEnabled = isCameraEnabled) {
129+
camera()
130+
}
131+
ToggleMicrophoneAction(isMicrophoneEnabled = isMicEnabled) {
132+
mic()
133+
}
134+
FlipCameraAction {
135+
call.camera.flip()
136+
}
123137

138+
ChatDialogAction(
139+
messageCount = 0,
140+
onCallAction = { onChat() },
141+
)
142+
}
143+
Spacer(modifier = Modifier.height(16.dp))
144+
StreamButton(
145+
modifier = Modifier.fillMaxWidth(),
146+
style = VideoTheme.styles.buttonStyles.primaryIconButtonStyle(),
147+
icon = Icons.Default.Settings,
148+
text = "Settings",
149+
onClick = onSettings,
150+
)
124151
StreamButton(
152+
modifier = Modifier.fillMaxWidth(),
125153
style = VideoTheme.styles.buttonStyles.alertButtonStyle(),
126154
icon = Icons.Default.CallEnd,
127155
text = "Leave call",
@@ -144,6 +172,8 @@ fun LandscapeControlsPreview() {
144172
{},
145173
{},
146174
{},
175+
{},
176+
{},
147177
) {
148178
}
149179
}

docusaurus/docs/Android/05-ui-cookbook/05-incoming-and-outgoing-call.mdx

+1-4
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,5 @@ fun MyRingingCallScreen() {
8787
So you'll be able to render your own composable or navigate to a different screen depending on the call state.
8888
8989
## Sounds
90-
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`.
9190
92-
`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.
93-
94-
To disable sounds, pass `null` to `incomingCallSound` or `outgoingCallSound`.
91+
The SDK plays sounds for incoming and outgoing calls. Read [here](../06-advanced/01-ringing.mdx#sounds) for more details.

0 commit comments

Comments
 (0)