Fixed crashes related to grid layout when more than 6 participants
This commit is contained in:
parent
14685c550c
commit
bd0ba98a21
2 changed files with 10 additions and 1 deletions
|
@ -22,6 +22,7 @@ package org.linphone.activities.voip.fragments
|
|||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.navigation.navGraphViewModels
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.R
|
||||
|
@ -81,7 +82,7 @@ class ConferenceLayoutFragment : GenericFragment<VoipConferenceLayoutFragmentBin
|
|||
}
|
||||
|
||||
private fun showTooManyParticipantsForMosaicLayoutDialog() {
|
||||
val dialog = binding.root.findViewById<LinearLayout>(R.id.too_many_participants_dialog)
|
||||
val dialog = binding.root.findViewById<ConstraintLayout>(R.id.too_many_participants_dialog)
|
||||
dialog?.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import android.content.Context
|
|||
import android.util.AttributeSet
|
||||
import android.widget.GridLayout
|
||||
import androidx.core.view.children
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.core.tools.Log
|
||||
|
||||
class GridBoxLayout : GridLayout {
|
||||
|
@ -64,6 +65,13 @@ class GridBoxLayout : GridLayout {
|
|||
child.layoutParams = LayoutParams()
|
||||
}
|
||||
|
||||
val maxChild = placementMatrix[0].size
|
||||
if (childCount > maxChild) {
|
||||
val maxMosaicParticipants = corePreferences.maxConferenceParticipantsForMosaicLayout
|
||||
Log.e("[GridBoxLayout] $childCount children but placementMatrix only knows how to display $maxChild (max allowed participants for grid layout in settings is $maxMosaicParticipants)")
|
||||
return
|
||||
}
|
||||
|
||||
val availableSize = Pair(right - left, bottom - top)
|
||||
var cellSize = 0
|
||||
for (index in 1..childCount) {
|
||||
|
|
Loading…
Reference in a new issue