From 50f0be9e2042838da5a15e1fc6bd38172239439e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Mon, 2 Oct 2023 16:59:32 +0200 Subject: [PATCH] Use `rememberMutableInteractionSource` --- .../flashlight/screens/MainScreen.kt | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/screens/MainScreen.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/screens/MainScreen.kt index 039f3bd..03b6eaa 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/screens/MainScreen.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/screens/MainScreen.kt @@ -22,6 +22,7 @@ import androidx.compose.ui.unit.TextUnit import androidx.compose.ui.unit.TextUnitType import com.simplemobiletools.commons.compose.extensions.AdjustNavigationBarColors import com.simplemobiletools.commons.compose.extensions.MyDevices +import com.simplemobiletools.commons.compose.extensions.rememberMutableInteractionSource import com.simplemobiletools.commons.compose.menus.ActionItem import com.simplemobiletools.commons.compose.menus.ActionMenu import com.simplemobiletools.commons.compose.menus.OverflowMode @@ -104,9 +105,7 @@ internal fun MainScreen( .padding(vertical = dimensionResource(id = R.dimen.normal_margin)) .clickable( indication = null, - interactionSource = remember { - MutableInteractionSource() - }, + interactionSource = rememberMutableInteractionSource(), onClick = onFlashlightPress ), painter = painterResource(id = R.drawable.ic_flashlight_vector), @@ -121,9 +120,7 @@ internal fun MainScreen( .padding(vertical = dimensionResource(id = R.dimen.normal_margin)) .clickable( indication = null, - interactionSource = remember { - MutableInteractionSource() - }, + interactionSource = rememberMutableInteractionSource(), onClick = onBrightDisplayPress ), painter = painterResource(id = R.drawable.ic_bright_display_vector), @@ -138,9 +135,7 @@ internal fun MainScreen( .padding(vertical = dimensionResource(id = R.dimen.normal_margin)) .clickable( indication = null, - interactionSource = remember { - MutableInteractionSource() - }, + interactionSource = rememberMutableInteractionSource(), onClick = onSosButtonPress ), text = "SOS", @@ -157,9 +152,7 @@ internal fun MainScreen( .padding(vertical = dimensionResource(id = R.dimen.normal_margin)) .clickable( indication = null, - interactionSource = remember { - MutableInteractionSource() - }, + interactionSource = rememberMutableInteractionSource(), onClick = onStroboscopeButtonPress ), painter = painterResource(id = R.drawable.ic_stroboscope_vector),