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