diff --git a/app/src/main/java/com/nextcloud/talk/adapters/ParticipantDisplayItem.kt b/app/src/main/java/com/nextcloud/talk/adapters/ParticipantDisplayItem.kt index 2af4ffde3..9b0fa75e6 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/ParticipantDisplayItem.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/ParticipantDisplayItem.kt @@ -30,6 +30,7 @@ import org.webrtc.MediaStream import org.webrtc.PeerConnection.IceConnectionState import org.webrtc.SurfaceViewRenderer +@Suppress("LongParameterList") class ParticipantDisplayItem( private val context: Context, private val baseUrl: String, @@ -79,6 +80,7 @@ class ParticipantDisplayItem( } override fun onReaction(reaction: String) { + // unused } } @@ -88,6 +90,7 @@ class ParticipantDisplayItem( updateFromModel() } + @Suppress("Detekt.TooGenericExceptionCaught") fun destroy() { callParticipantModel.removeObserver(callParticipantModelObserver) diff --git a/app/src/main/java/com/nextcloud/talk/call/components/ParticipantGrid.kt b/app/src/main/java/com/nextcloud/talk/call/components/ParticipantGrid.kt index 1833c448a..b9c4e0ee6 100644 --- a/app/src/main/java/com/nextcloud/talk/call/components/ParticipantGrid.kt +++ b/app/src/main/java/com/nextcloud/talk/call/components/ParticipantGrid.kt @@ -27,6 +27,7 @@ import com.nextcloud.talk.call.ParticipantUiState import org.webrtc.EglBase import kotlin.math.ceil +@Suppress("MagicNumber", "TooManyFunctions") @Composable fun ParticipantGrid( modifier: Modifier = Modifier, @@ -101,6 +102,7 @@ fun ParticipantGrid( } } +@Suppress("MagicNumber") @Preview @Composable fun ParticipantGridPreview() { @@ -111,6 +113,7 @@ fun ParticipantGridPreview() { ) {} } +@Suppress("MagicNumber") @Preview @Composable fun TwoParticipants() { @@ -121,6 +124,7 @@ fun TwoParticipants() { ) {} } +@Suppress("MagicNumber") @Preview @Composable fun ThreeParticipants() { @@ -131,6 +135,7 @@ fun ThreeParticipants() { ) {} } +@Suppress("MagicNumber") @Preview @Composable fun FourParticipants() { @@ -141,6 +146,7 @@ fun FourParticipants() { ) {} } +@Suppress("MagicNumber") @Preview @Composable fun FiveParticipants() { @@ -151,6 +157,7 @@ fun FiveParticipants() { ) {} } +@Suppress("MagicNumber") @Preview @Composable fun SevenParticipants() { @@ -161,6 +168,7 @@ fun SevenParticipants() { ) {} } +@Suppress("MagicNumber") @Preview @Composable fun FiftyParticipants() { @@ -171,6 +179,7 @@ fun FiftyParticipants() { ) {} } +@Suppress("MagicNumber") @Preview( showBackground = false, heightDp = 360, @@ -185,6 +194,7 @@ fun OneParticipantLandscape() { ) {} } +@Suppress("MagicNumber") @Preview( showBackground = false, heightDp = 360, @@ -199,6 +209,7 @@ fun TwoParticipantsLandscape() { ) {} } +@Suppress("MagicNumber") @Preview( showBackground = false, heightDp = 360, @@ -213,6 +224,7 @@ fun ThreeParticipantsLandscape() { ) {} } +@Suppress("MagicNumber") @Preview( showBackground = false, heightDp = 360, @@ -227,6 +239,7 @@ fun FourParticipantsLandscape() { ) {} } +@Suppress("MagicNumber") @Preview( showBackground = false, heightDp = 360, @@ -241,6 +254,7 @@ fun SevenParticipantsLandscape() { ) {} } +@Suppress("MagicNumber") @Preview( showBackground = false, heightDp = 360, diff --git a/app/src/main/java/com/nextcloud/talk/call/components/ParticipantTile.kt b/app/src/main/java/com/nextcloud/talk/call/components/ParticipantTile.kt index e17403c0c..dc6828adf 100644 --- a/app/src/main/java/com/nextcloud/talk/call/components/ParticipantTile.kt +++ b/app/src/main/java/com/nextcloud/talk/call/components/ParticipantTile.kt @@ -33,6 +33,9 @@ import com.nextcloud.talk.call.ParticipantUiState import com.nextcloud.talk.utils.ColorGenerator import org.webrtc.EglBase +const val NICK_OFFSET = 4f +const val NICK_BLUR_RADIUS = 4f + @Composable fun ParticipantTile( participant: ParticipantUiState, @@ -89,8 +92,8 @@ fun ParticipantTile( style = MaterialTheme.typography.bodyMedium.copy( shadow = Shadow( color = Color.Black, - offset = Offset(4f, 4f), - blurRadius = 4f + offset = Offset(NICK_OFFSET, NICK_OFFSET), + blurRadius = NICK_BLUR_RADIUS ) ) ) diff --git a/app/src/main/java/com/nextcloud/talk/utils/ColorGenerator.kt b/app/src/main/java/com/nextcloud/talk/utils/ColorGenerator.kt index c8fa1e58e..468f72374 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/ColorGenerator.kt +++ b/app/src/main/java/com/nextcloud/talk/utils/ColorGenerator.kt @@ -15,6 +15,7 @@ import kotlin.math.abs // See https://github.com/nextcloud/nextcloud-vue/blob/56b79afae93f4701a0cb933bfeb7b4a2fbd590fb/src/functions/usernameToColor/usernameToColor.js // and https://github.com/nextcloud/nextcloud-vue/blob/56b79afae93f4701a0cb933bfeb7b4a2fbd590fb/src/utils/GenColors.js +@Suppress("MagicNumber") class ColorGenerator private constructor() { private val steps = 6