@@ -29,6 +29,7 @@ import androidx.activity.result.contract.ActivityResultContracts
29
29
import androidx.compose.animation.Crossfade
30
30
import androidx.compose.foundation.background
31
31
import androidx.compose.foundation.layout.Arrangement
32
+ import androidx.compose.foundation.layout.Box
32
33
import androidx.compose.foundation.layout.BoxWithConstraints
33
34
import androidx.compose.foundation.layout.PaddingValues
34
35
import androidx.compose.foundation.layout.Row
@@ -38,10 +39,13 @@ import androidx.compose.foundation.layout.fillMaxWidth
38
39
import androidx.compose.foundation.layout.padding
39
40
import androidx.compose.foundation.layout.size
40
41
import androidx.compose.material.ExperimentalMaterialApi
42
+ import androidx.compose.material.Icon
43
+ import androidx.compose.material.IconButton
41
44
import androidx.compose.material.ModalBottomSheetValue
42
45
import androidx.compose.material.Snackbar
43
46
import androidx.compose.material.Text
44
47
import androidx.compose.material.icons.Icons
48
+ import androidx.compose.material.icons.filled.Close
45
49
import androidx.compose.material.icons.filled.MoreVert
46
50
import androidx.compose.material.icons.filled.People
47
51
import androidx.compose.material.rememberModalBottomSheetState
@@ -58,6 +62,7 @@ import androidx.compose.runtime.setValue
58
62
import androidx.compose.ui.Alignment
59
63
import androidx.compose.ui.Modifier
60
64
import androidx.compose.ui.draw.clip
65
+ import androidx.compose.ui.graphics.Color
61
66
import androidx.compose.ui.graphics.vector.ImageVector
62
67
import androidx.compose.ui.platform.LocalConfiguration
63
68
import androidx.compose.ui.platform.LocalContext
@@ -140,6 +145,7 @@ fun CallScreen(
140
145
var isShowingStats by remember { mutableStateOf(false ) }
141
146
var layout by remember { mutableStateOf(LayoutType .DYNAMIC ) }
142
147
var unreadCount by remember { mutableIntStateOf(0 ) }
148
+ var showShareDialog by remember { mutableStateOf(true ) }
143
149
var showParticipants by remember { mutableStateOf(false ) }
144
150
val chatState = rememberModalBottomSheetState(
145
151
initialValue = ModalBottomSheetValue .Hidden ,
@@ -495,7 +501,7 @@ fun CallScreen(
495
501
ClosedCaptionsContainer (
496
502
call,
497
503
ClosedCaptionsDefaults .streamThemeConfig().copy(
498
- yOffset = (- 80 ).dp,
504
+ yOffset = (- 100 ).dp,
499
505
),
500
506
closedCaptionUiState,
501
507
)
@@ -546,7 +552,8 @@ fun CallScreen(
546
552
547
553
val isPictureInPictureMode = rememberIsInPipMode()
548
554
if (! isPictureInPictureMode) {
549
- if (participantsSize.size == 1 &&
555
+ if (showShareDialog &&
556
+ participantsSize.size == 1 &&
550
557
! chatState.isVisible &&
551
558
orientation == Configuration .ORIENTATION_PORTRAIT
552
559
) {
@@ -558,17 +565,31 @@ fun CallScreen(
558
565
alignment = Alignment .BottomCenter ,
559
566
offset = IntOffset (
560
567
0 ,
561
- - (VideoTheme .dimens.componentHeightL + VideoTheme .dimens.spacingS).toPx()
562
- .toInt(),
568
+ - (VideoTheme .dimens.componentHeightL + VideoTheme .dimens.spacingS).toPx().toInt(),
563
569
),
564
570
) {
565
- ShareCallWithOthers (
566
- modifier = Modifier .fillMaxWidth(),
567
- call = call,
568
- clipboardManager = clipboardManager,
569
- env = env,
570
- context = context,
571
- )
571
+ Box {
572
+ ShareCallWithOthers (
573
+ modifier = Modifier .fillMaxWidth(),
574
+ call = call,
575
+ clipboardManager = clipboardManager,
576
+ env = env,
577
+ context = context,
578
+ )
579
+
580
+ IconButton (
581
+ modifier = Modifier
582
+ .align(Alignment .TopEnd )
583
+ .padding(top = 10 .dp, end = 10 .dp),
584
+ onClick = { showShareDialog = false },
585
+ ) {
586
+ Icon (
587
+ tint = Color .White ,
588
+ imageVector = Icons .Default .Close ,
589
+ contentDescription = Icons .Default .Close .name,
590
+ )
591
+ }
592
+ }
572
593
}
573
594
}
574
595
}
0 commit comments