From 8ea675a74309c43512dde45b5f423704081fd9d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Thu, 5 Oct 2023 13:34:15 +0200 Subject: [PATCH] Use method references in `WidgetTorchConfigureActivity` --- .../activities/WidgetTorchConfigureActivity.kt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/WidgetTorchConfigureActivity.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/WidgetTorchConfigureActivity.kt index 9b9f5bb..d930501 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/WidgetTorchConfigureActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/WidgetTorchConfigureActivity.kt @@ -48,15 +48,9 @@ class WidgetTorchConfigureActivity : ComponentActivity() { widgetDrawable = R.drawable.ic_flashlight_vector, widgetColor = widgetColor, widgetAlpha = widgetAlpha, - onSliderChanged = { - viewModel.changeAlpha(it) - }, - onColorPressed = { - pickBackgroundColor() - }, - onSavePressed = { - saveConfig() - } + onSliderChanged = viewModel::changeAlpha, + onColorPressed = ::pickBackgroundColor, + onSavePressed = ::saveConfig ) } }