Fixed conversation menu icon size + prevent switching to mosaic mode when more than 6 participants while in conference

This commit is contained in:
Sylvain Berfini 2024-01-30 10:33:23 +01:00
parent 318a487e10
commit 1734d11639
3 changed files with 14 additions and 17 deletions

View file

@ -69,8 +69,12 @@ class ConferenceLayoutMenuDialogFragment(
view.viewModel = conferenceModel
view.setGridClickListener {
conferenceModel.changeLayout(ConferenceModel.GRID_LAYOUT)
dismiss()
if (conferenceModel.participantDevices.value.orEmpty().size < 6) {
conferenceModel.changeLayout(ConferenceModel.GRID_LAYOUT)
dismiss()
} else {
// TODO: notify user
}
}
view.setActiveSpeakerClickListener {
conferenceModel.changeLayout(ConferenceModel.ACTIVE_SPEAKER_LAYOUT)

View file

@ -311,6 +311,8 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
}
init {
fullScreenMode.value = false
coreContext.postOnCoreThread { core ->
core.addListener(coreListener)
@ -327,13 +329,6 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
}
}
isVideoEnabled.value = false
fullScreenMode.value = false
isMicrophoneMuted.value = ActivityCompat.checkSelfPermission(
coreContext.context,
Manifest.permission.RECORD_AUDIO
) != PackageManager.PERMISSION_GRANTED
numpadModel = NumpadModel(
{ digit -> // onDigitClicked
appendDigitToSearchBarEvent.value = Event(digit)
@ -773,7 +768,7 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
Log.w(
"$TAG RECORD_AUDIO permission wasn't granted yet, considering microphone as muted!"
)
isMicrophoneMuted.postValue(false)
isMicrophoneMuted.postValue(true)
} else {
isMicrophoneMuted.postValue(call.microphoneMuted)
}

View file

@ -85,7 +85,7 @@
android:layout_marginStart="5dp"
coilAvatar="@{viewModel.avatarModel}"
app:layout_constraintStart_toEndOf="@id/back"
app:layout_constraintTop_toTopOf="@id/back" />
app:layout_constraintTop_toTopOf="parent"/>
<ImageView
android:id="@+id/presence_badge"
@ -142,12 +142,11 @@
android:id="@+id/show_menu"
android:onClick="@{showMenuClickListener}"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_height="@dimen/top_bar_height"
android:padding="15dp"
android:adjustViewBounds="true"
android:src="@drawable/dots_three_vertical"
app:layout_constraintTop_toTopOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:tint="?attr/color_main2_500"/>
@ -155,12 +154,11 @@
android:id="@+id/start_call"
android:onClick="@{() -> viewModel.startCall()}"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_height="@dimen/top_bar_height"
android:padding="15dp"
android:src="@drawable/phone"
android:visibility="@{viewModel.isReadOnly || viewModel.searchBarVisible ? View.GONE : View.VISIBLE}"
app:layout_constraintTop_toTopOf="@id/back"
app:layout_constraintBottom_toBottomOf="@id/back"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toStartOf="@id/show_menu"
app:tint="?attr/color_main2_500" />