Show video preview in calls list fragment
This commit is contained in:
parent
69ce331a05
commit
358ab96d17
2 changed files with 32 additions and 0 deletions
|
@ -27,9 +27,11 @@ import android.view.View
|
|||
import android.widget.PopupWindow
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.navigation.navGraphViewModels
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.R
|
||||
import org.linphone.activities.GenericFragment
|
||||
import org.linphone.activities.main.MainActivity
|
||||
import org.linphone.activities.voip.ConferenceDisplayMode
|
||||
import org.linphone.activities.voip.data.CallData
|
||||
import org.linphone.activities.voip.viewmodels.CallsViewModel
|
||||
import org.linphone.activities.voip.viewmodels.ConferenceViewModel
|
||||
|
@ -77,6 +79,22 @@ class CallsListFragment : GenericFragment<VoipCallsListFragmentBinding>() {
|
|||
data.contextMenuClickListener = callContextMenuClickListener
|
||||
}
|
||||
}
|
||||
|
||||
conferenceViewModel.conferenceDisplayMode.observe(
|
||||
viewLifecycleOwner
|
||||
) {
|
||||
binding.localPreviewVideoSurface.visibility = if (it == ConferenceDisplayMode.AUDIO_ONLY) {
|
||||
View.GONE
|
||||
} else {
|
||||
View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
coreContext.core.nativePreviewWindowId = binding.localPreviewVideoSurface
|
||||
}
|
||||
|
||||
private fun showCallMenu(anchor: View, callData: CallData) {
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bottom_buttons"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
|
@ -109,6 +110,19 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<org.linphone.activities.voip.views.RoundCornersTextureView
|
||||
android:id="@+id/local_preview_video_surface"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_size="@{@dimen/video_preview_max_size}"
|
||||
app:alignTopRight="true"
|
||||
app:displayMode="black_bars"
|
||||
app:layout_constraintBottom_toTopOf="@id/bottom_buttons"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="200dp"
|
||||
app:layout_constraintWidth_max="200dp" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
Loading…
Reference in a new issue