mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
Open element call widget.
This commit is contained in:
parent
f5ec7a312f
commit
fd3b082a2c
4 changed files with 15 additions and 0 deletions
|
@ -84,4 +84,5 @@ sealed class RoomDetailViewEvents : VectorViewEvents {
|
|||
data class StartChatEffect(val type: ChatEffect) : RoomDetailViewEvents()
|
||||
object StopChatEffects : RoomDetailViewEvents()
|
||||
object RoomReplacementStarted : RoomDetailViewEvents()
|
||||
object OpenElementCallWidget : RoomDetailViewEvents()
|
||||
}
|
||||
|
|
|
@ -102,6 +102,8 @@ data class RoomDetailViewState(
|
|||
// It can differs for a short period of time on the JitsiState as its computed async.
|
||||
fun hasActiveJitsiWidget() = activeRoomWidgets()?.any { it.type == WidgetType.Jitsi && it.isActive }.orFalse()
|
||||
|
||||
fun hasActiveElementCallWidget() = activeRoomWidgets()?.any { it.type == WidgetType.ElementCall && it.isActive }.orFalse()
|
||||
|
||||
fun isDm() = asyncRoomSummary()?.isDirect == true
|
||||
|
||||
fun isThreadTimeline() = rootThreadEventId != null
|
||||
|
|
|
@ -498,6 +498,7 @@ class TimelineFragment @Inject constructor(
|
|||
RoomDetailViewEvents.StopChatEffects -> handleStopChatEffects()
|
||||
is RoomDetailViewEvents.DisplayAndAcceptCall -> acceptIncomingCall(it)
|
||||
RoomDetailViewEvents.RoomReplacementStarted -> handleRoomReplacement()
|
||||
RoomDetailViewEvents.OpenElementCallWidget -> handleOpenElementCallWidget()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2653,6 +2654,15 @@ class TimelineFragment @Inject constructor(
|
|||
.show(childFragmentManager, "ROOM_WIDGETS_BOTTOM_SHEET")
|
||||
}
|
||||
|
||||
private fun handleOpenElementCallWidget() = withState(timelineViewModel) { state ->
|
||||
state
|
||||
.activeRoomWidgets()
|
||||
?.find { it.type == WidgetType.ElementCall }
|
||||
?.also { widget ->
|
||||
navigator.openRoomWidget(requireContext(), state.roomId, widget)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTapToReturnToCall() {
|
||||
callManager.getCurrentCall()?.let { call ->
|
||||
VectorCallActivity.newIntent(
|
||||
|
|
|
@ -58,6 +58,8 @@ fun WebView.setupForWidget(activity: Activity, eventListener: WebEventListener)
|
|||
|
||||
settings.displayZoomControls = false
|
||||
|
||||
settings.mediaPlaybackRequiresUserGesture = false
|
||||
|
||||
// Permission requests
|
||||
webChromeClient = object : WebChromeClient() {
|
||||
override fun onPermissionRequest(request: PermissionRequest) {
|
||||
|
|
Loading…
Reference in a new issue