Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/PBE-6044-device-switch-improveme…
Browse files Browse the repository at this point in the history
…nts' into feature/audio-filter
  • Loading branch information
kanat committed Sep 23, 2024
2 parents 696470e + b7391b4 commit f2bfb6f
Show file tree
Hide file tree
Showing 64 changed files with 1,610 additions and 702 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ jobs:
./gradlew :stream-video-android-core:testDebugUnitTest --scan --stacktrace
- name: Unit tests core results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: unit-tests-core-results
path: stream-video-android-core/build/reports/tests/testDebugUnitTest/index.html

- name: Unit tests compose results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: unit-tests-compose-results
path: stream-video-android-ui-compose/build/reports/tests/testDebugUnitTest/index.html
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/app-distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Assemble
run: bash ./gradlew :demo-app:assembleRelease --stacktrace
- name: Upload APK
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: demo-app-release
path: demo-app/build/outputs/apk/demo-app/release/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/artifact-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: ./gradlew bundleRelease --stacktrace

- name: Upload AAB as artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: app-bundle
path: demo-app/build/outputs/bundle/productionRelease/demo-app-production-release.aab
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag

/**
* Configure Compose-specific options
Expand All @@ -31,7 +32,7 @@ internal fun Project.configureAndroidCompose(
}

extensions.configure<ComposeCompilerGradlePluginExtension> {
enableStrongSkippingMode = true
featureFlags.addAll(ComposeFeatureFlag.StrongSkipping, ComposeFeatureFlag.IntrinsicRemember)
reportsDestination = layout.buildDirectory.dir("compose_compiler")
stabilityConfigurationFile = rootProject.layout.projectDirectory.file("compose_compiler_config.conf")
}
Expand Down
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 = 12
const val patchVersion = 14
const val versionName = "$majorVersion.$minorVersion.$patchVersion"
const val versionCode = 36
const val versionCode = 38
const val snapshotVersionName = "$majorVersion.$minorVersion.${patchVersion + 1}-SNAPSHOT"
const val artifactGroup = "io.getstream"
const val streamVideoCallGooglePlayVersion = "1.1.5"
const val streamVideoCallGooglePlayVersion = "1.1.7"
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,15 +21,17 @@ 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
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.tooling.preview.Preview
Expand All @@ -39,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,9 +51,13 @@ import io.getstream.video.android.mock.StreamPreviewDataUtils
import io.getstream.video.android.mock.previewCall
import io.getstream.video.android.tooling.extensions.toPx

@OptIn(ExperimentalComposeUiApi::class)
@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 @@ -78,6 +85,8 @@ fun LandscapeControls(call: Call, onDismiss: () -> Unit) {
camera = toggleCamera,
mic = toggleMicrophone,
onClick = onClick,
onChat = onChat,
onSettings = onSettings,
) {
onDismiss()
}
Expand All @@ -89,6 +98,8 @@ fun LandscapeControlsContent(
isCameraEnabled: Boolean,
isMicEnabled: Boolean,
call: Call,
onChat: () -> Unit,
onSettings: () -> Unit,
camera: () -> Unit,
mic: () -> Unit,
onClick: () -> Unit,
Expand All @@ -109,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 @@ -146,6 +172,8 @@ fun LandscapeControlsPreview() {
{},
{},
{},
{},
{},
) {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@
* limitations under the License.
*/

@file:OptIn(ExperimentalLayoutApi::class)

package io.getstream.video.android.ui.call

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.width
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.AutoAwesome
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package io.getstream.video.android.ui.call

import android.content.ClipboardManager
import android.content.Context
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand Down Expand Up @@ -100,7 +99,6 @@ fun ParticipantsList(call: Call) {
ParticipantsListContent(call, clipboardManager, participants)
}

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun ParticipantsListContent(
call: Call,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
Expand All @@ -48,7 +47,7 @@ import androidx.compose.material.icons.filled.Email
import androidx.compose.material.icons.filled.Settings
import androidx.compose.material.icons.outlined.Adb
import androidx.compose.material.icons.outlined.GroupAdd
import androidx.compose.material.ripple.rememberRipple
import androidx.compose.material.ripple
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
Expand Down Expand Up @@ -408,7 +407,7 @@ private fun BuiltInUsersLoginDialog(
.fillMaxWidth()
.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = rememberRipple(bounded = true),
indication = ripple(bounded = true),
onClick = {
login(true, LoginEvent.SignIn(user))
onDismissRequest()
Expand Down Expand Up @@ -439,7 +438,6 @@ private fun BuiltInUsersLoginDialog(
)
}

@OptIn(ExperimentalLayoutApi::class)
@Composable
fun SelectableDialog(
items: List<StreamEnvironment>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.tooling.preview.Preview
Expand All @@ -63,7 +62,7 @@ import io.getstream.video.android.util.filters.SampleAudioFilter
import kotlinx.coroutines.launch
import java.nio.ByteBuffer

@OptIn(ExperimentalComposeUiApi::class, ExperimentalPermissionsApi::class)
@OptIn(ExperimentalPermissionsApi::class)
@Composable
internal fun SettingsMenu(
call: Call,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ object StreamVideoInitHelper {
)
authData.token
},
appName = "Stream Video Demo App",
).build()
}
}
Loading

0 comments on commit f2bfb6f

Please sign in to comment.