From 13bb808455388261b2c611c55a54081ff97bd9e9 Mon Sep 17 00:00:00 2001 From: Sad Ellie Date: Sun, 21 Jan 2024 21:52:09 +0300 Subject: [PATCH] fixup! Refactor haptic preference --- .../calculator/RPNCalculatorKeyboard.kt | 116 +++++++++--------- .../feature/calculator/RPNCalculatorScreen.kt | 2 - .../calculator/RPNCalculatorUIState.kt | 3 +- .../calculator/RPNCalculatorViewModel.kt | 3 +- .../converter/ConverterSettingsScreen.kt | 3 +- 5 files changed, 58 insertions(+), 69 deletions(-) diff --git a/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/RPNCalculatorKeyboard.kt b/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/RPNCalculatorKeyboard.kt index f2d9b153..c6903f9d 100644 --- a/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/RPNCalculatorKeyboard.kt +++ b/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/RPNCalculatorKeyboard.kt @@ -71,7 +71,6 @@ internal fun RPNCalculatorKeyboard( modifier: Modifier, fractional: String, middleZero: Boolean, - allowVibration: Boolean, onCalculationClick: (RPNCalculation) -> Unit, onInputEditClick: (RPNInputEdit) -> Unit, ) { @@ -82,7 +81,6 @@ internal fun RPNCalculatorKeyboard( modifier = modifier, fractionalIcon = fractionalIcon, middleZero = middleZero, - allowVibration = allowVibration, onCalculationClick = onCalculationClick, onInputEditClick = onInputEditClick ) @@ -91,7 +89,6 @@ internal fun RPNCalculatorKeyboard( modifier = modifier, fractionalIcon = fractionalIcon, middleZero = middleZero, - allowVibration = allowVibration, onCalculationClick = onCalculationClick, onInputEditClick = onInputEditClick ) @@ -103,7 +100,6 @@ private fun RPNCalculatorKeyboardPortrait( modifier: Modifier, fractionalIcon: ImageVector, middleZero: Boolean, - allowVibration: Boolean, onCalculationClick: (RPNCalculation) -> Unit, onInputEditClick: (RPNInputEdit) -> Unit, ) { @@ -119,10 +115,10 @@ private fun RPNCalculatorKeyboardPortrait( .fillMaxWidth(width) .fillMaxHeight(height) - KeyboardButtonAdditional(aModifier, IconPack.Swap, null, allowVibration, KeyboardButtonContentHeightTallAdditional) { onCalculationClick(RPNCalculation.Swap) } - KeyboardButtonAdditional(aModifier, IconPack.Up, null, allowVibration, KeyboardButtonContentHeightTallAdditional) { onCalculationClick(RPNCalculation.RotateUp) } - KeyboardButtonAdditional(aModifier, IconPack.Down, null, allowVibration, KeyboardButtonContentHeightTallAdditional) { onCalculationClick(RPNCalculation.RotateDown) } - KeyboardButtonAdditional(aModifier, IconPack.Pop, null, allowVibration, KeyboardButtonContentHeightTallAdditional) { onCalculationClick(RPNCalculation.Pop) } + KeyboardButtonAdditional(aModifier, IconPack.Swap, null, KeyboardButtonContentHeightTallAdditional) { onCalculationClick(RPNCalculation.Swap) } + KeyboardButtonAdditional(aModifier, IconPack.Up, null, KeyboardButtonContentHeightTallAdditional) { onCalculationClick(RPNCalculation.RotateUp) } + KeyboardButtonAdditional(aModifier, IconPack.Down, null, KeyboardButtonContentHeightTallAdditional) { onCalculationClick(RPNCalculation.RotateDown) } + KeyboardButtonAdditional(aModifier, IconPack.Pop, null, KeyboardButtonContentHeightTallAdditional) { onCalculationClick(RPNCalculation.Pop) } } KeypadFlow( @@ -134,35 +130,35 @@ private fun RPNCalculatorKeyboardPortrait( .fillMaxWidth(width) .fillMaxHeight(height) - KeyboardButtonTertiary(bModifier, IconPack.Clear, null, allowVibration, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Clear) } - KeyboardButtonFilled(bModifier, IconPack.Unary, null, allowVibration, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Negate) } - KeyboardButtonFilled(bModifier, IconPack.Percent, null, allowVibration, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Percent) } - KeyboardButtonFilled(bModifier, IconPack.Divide, null, allowVibration, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Divide) } + KeyboardButtonTertiary(bModifier, IconPack.Clear, null, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Clear) } + KeyboardButtonFilled(bModifier, IconPack.Unary, null, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Negate) } + KeyboardButtonFilled(bModifier, IconPack.Percent, null, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Percent) } + KeyboardButtonFilled(bModifier, IconPack.Divide, null, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Divide) } - KeyboardButtonLight(bModifier, IconPack.Key7, null, allowVibration, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._7)) } - KeyboardButtonLight(bModifier, IconPack.Key8, null, allowVibration, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._8)) } - KeyboardButtonLight(bModifier, IconPack.Key9, null, allowVibration, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._9)) } - KeyboardButtonFilled(bModifier, IconPack.Multiply, null, allowVibration, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Multiply) } + KeyboardButtonLight(bModifier, IconPack.Key7, null, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._7)) } + KeyboardButtonLight(bModifier, IconPack.Key8, null, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._8)) } + KeyboardButtonLight(bModifier, IconPack.Key9, null, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._9)) } + KeyboardButtonFilled(bModifier, IconPack.Multiply, null, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Multiply) } - KeyboardButtonLight(bModifier, IconPack.Key4, null, allowVibration, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._4)) } - KeyboardButtonLight(bModifier, IconPack.Key5, null, allowVibration, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._5)) } - KeyboardButtonLight(bModifier, IconPack.Key6, null, allowVibration, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._6)) } - KeyboardButtonFilled(bModifier, IconPack.Minus, null, allowVibration, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Minus) } + KeyboardButtonLight(bModifier, IconPack.Key4, null, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._4)) } + KeyboardButtonLight(bModifier, IconPack.Key5, null, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._5)) } + KeyboardButtonLight(bModifier, IconPack.Key6, null, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._6)) } + KeyboardButtonFilled(bModifier, IconPack.Minus, null, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Minus) } - KeyboardButtonLight(bModifier, IconPack.Key1, null, allowVibration, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._1)) } - KeyboardButtonLight(bModifier, IconPack.Key2, null, allowVibration, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._2)) } - KeyboardButtonLight(bModifier, IconPack.Key3, null, allowVibration, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._3)) } - KeyboardButtonFilled(bModifier, IconPack.Plus, null, allowVibration, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Plus) } + KeyboardButtonLight(bModifier, IconPack.Key1, null, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._1)) } + KeyboardButtonLight(bModifier, IconPack.Key2, null, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._2)) } + KeyboardButtonLight(bModifier, IconPack.Key3, null, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._3)) } + KeyboardButtonFilled(bModifier, IconPack.Plus, null, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Plus) } if (middleZero) { - KeyboardButtonLight(bModifier, fractionalIcon, null, allowVibration, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Dot) } - KeyboardButtonLight(bModifier, IconPack.Key0, null, allowVibration, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._0)) } + KeyboardButtonLight(bModifier, fractionalIcon, null, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Dot) } + KeyboardButtonLight(bModifier, IconPack.Key0, null, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._0)) } } else { - KeyboardButtonLight(bModifier, IconPack.Key0, null, allowVibration, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._0)) } - KeyboardButtonLight(bModifier, fractionalIcon, null, allowVibration, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Dot) } + KeyboardButtonLight(bModifier, IconPack.Key0, null, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._0)) } + KeyboardButtonLight(bModifier, fractionalIcon, null, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Dot) } } - KeyboardButtonLight(bModifier, IconPack.Backspace, null, allowVibration, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Delete) } - KeyboardButtonFilled(bModifier, IconPack.Enter, null, allowVibration, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Enter) } + KeyboardButtonLight(bModifier, IconPack.Backspace, null, KeyboardButtonContentHeightTall) { onInputEditClick(RPNInputEdit.Delete) } + KeyboardButtonFilled(bModifier, IconPack.Enter, null, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Enter) } } } } @@ -172,7 +168,6 @@ private fun RPNCalculatorKeyboardLandscape( modifier: Modifier, fractionalIcon: ImageVector, middleZero: Boolean, - allowVibration: Boolean, onCalculationClick: (RPNCalculation) -> Unit, onInputEditClick: (RPNInputEdit) -> Unit, ) { @@ -185,38 +180,38 @@ private fun RPNCalculatorKeyboardLandscape( .fillMaxHeight(height) .fillMaxWidth(width) - KeyboardButtonAdditional(bModifier, IconPack.Swap, null, allowVibration, KeyboardButtonContentHeightTallAdditional) { onCalculationClick(RPNCalculation.Swap) } - KeyboardButtonLight(bModifier, IconPack.Key7, null, allowVibration, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._7)) } - KeyboardButtonLight(bModifier, IconPack.Key8, null, allowVibration, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._8)) } - KeyboardButtonLight(bModifier, IconPack.Key9, null, allowVibration, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._9)) } - KeyboardButtonTertiary(bModifier, IconPack.Clear, null, allowVibration, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Clear) } - KeyboardButtonFilled(bModifier, IconPack.Unary, null, allowVibration, KeyboardButtonContentHeightShort) { onCalculationClick(RPNCalculation.Negate) } - - KeyboardButtonAdditional(bModifier, IconPack.Up, null, allowVibration, KeyboardButtonContentHeightTallAdditional) { onCalculationClick(RPNCalculation.RotateUp) } - KeyboardButtonLight(bModifier, IconPack.Key4, null, allowVibration, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._4)) } - KeyboardButtonLight(bModifier, IconPack.Key5, null, allowVibration, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._5)) } - KeyboardButtonLight(bModifier, IconPack.Key6, null, allowVibration, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._6)) } - KeyboardButtonFilled(bModifier, IconPack.Multiply, null, allowVibration, KeyboardButtonContentHeightShort) { onCalculationClick(RPNCalculation.Multiply) } - KeyboardButtonFilled(bModifier, IconPack.Divide, null, allowVibration, KeyboardButtonContentHeightShort) { onCalculationClick(RPNCalculation.Divide) } - - KeyboardButtonAdditional(bModifier, IconPack.Down, null, allowVibration, KeyboardButtonContentHeightTallAdditional) { onCalculationClick(RPNCalculation.RotateDown) } - KeyboardButtonLight(bModifier, IconPack.Key1, null, allowVibration, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._1)) } - KeyboardButtonLight(bModifier, IconPack.Key2, null, allowVibration, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._2)) } - KeyboardButtonLight(bModifier, IconPack.Key3, null, allowVibration, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._3)) } - KeyboardButtonFilled(bModifier, IconPack.Plus, null, allowVibration, KeyboardButtonContentHeightShort) { onCalculationClick(RPNCalculation.Plus) } - KeyboardButtonFilled(bModifier, IconPack.Minus, null, allowVibration, KeyboardButtonContentHeightShort) { onCalculationClick(RPNCalculation.Minus) } - - KeyboardButtonAdditional(bModifier, IconPack.Pop, null, allowVibration, KeyboardButtonContentHeightTallAdditional) { onCalculationClick(RPNCalculation.Pop) } + KeyboardButtonAdditional(bModifier, IconPack.Swap, null, KeyboardButtonContentHeightTallAdditional) { onCalculationClick(RPNCalculation.Swap) } + KeyboardButtonLight(bModifier, IconPack.Key7, null, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._7)) } + KeyboardButtonLight(bModifier, IconPack.Key8, null, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._8)) } + KeyboardButtonLight(bModifier, IconPack.Key9, null, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._9)) } + KeyboardButtonTertiary(bModifier, IconPack.Clear, null, KeyboardButtonContentHeightTall) { onCalculationClick(RPNCalculation.Clear) } + KeyboardButtonFilled(bModifier, IconPack.Unary, null, KeyboardButtonContentHeightShort) { onCalculationClick(RPNCalculation.Negate) } + + KeyboardButtonAdditional(bModifier, IconPack.Up, null, KeyboardButtonContentHeightTallAdditional) { onCalculationClick(RPNCalculation.RotateUp) } + KeyboardButtonLight(bModifier, IconPack.Key4, null, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._4)) } + KeyboardButtonLight(bModifier, IconPack.Key5, null, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._5)) } + KeyboardButtonLight(bModifier, IconPack.Key6, null, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._6)) } + KeyboardButtonFilled(bModifier, IconPack.Multiply, null, KeyboardButtonContentHeightShort) { onCalculationClick(RPNCalculation.Multiply) } + KeyboardButtonFilled(bModifier, IconPack.Divide, null, KeyboardButtonContentHeightShort) { onCalculationClick(RPNCalculation.Divide) } + + KeyboardButtonAdditional(bModifier, IconPack.Down, null, KeyboardButtonContentHeightTallAdditional) { onCalculationClick(RPNCalculation.RotateDown) } + KeyboardButtonLight(bModifier, IconPack.Key1, null, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._1)) } + KeyboardButtonLight(bModifier, IconPack.Key2, null, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._2)) } + KeyboardButtonLight(bModifier, IconPack.Key3, null, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._3)) } + KeyboardButtonFilled(bModifier, IconPack.Plus, null, KeyboardButtonContentHeightShort) { onCalculationClick(RPNCalculation.Plus) } + KeyboardButtonFilled(bModifier, IconPack.Minus, null, KeyboardButtonContentHeightShort) { onCalculationClick(RPNCalculation.Minus) } + + KeyboardButtonAdditional(bModifier, IconPack.Pop, null, KeyboardButtonContentHeightTallAdditional) { onCalculationClick(RPNCalculation.Pop) } if (middleZero) { - KeyboardButtonLight(bModifier, fractionalIcon, null, allowVibration, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Dot) } - KeyboardButtonLight(bModifier, IconPack.Key0, null, allowVibration, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._0)) } + KeyboardButtonLight(bModifier, fractionalIcon, null, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Dot) } + KeyboardButtonLight(bModifier, IconPack.Key0, null, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._0)) } } else { - KeyboardButtonLight(bModifier, IconPack.Key0, null, allowVibration, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._0)) } - KeyboardButtonLight(bModifier, fractionalIcon, null, allowVibration, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Dot) } + KeyboardButtonLight(bModifier, IconPack.Key0, null, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Digit(Token.Digit._0)) } + KeyboardButtonLight(bModifier, fractionalIcon, null, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Dot) } } - KeyboardButtonLight(bModifier, IconPack.Backspace, null, allowVibration, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Delete) } - KeyboardButtonFilled(bModifier, IconPack.Percent, null, allowVibration, KeyboardButtonContentHeightShort) { onCalculationClick(RPNCalculation.Percent) } - KeyboardButtonFilled(bModifier, IconPack.Enter, null, allowVibration, KeyboardButtonContentHeightShort) { onCalculationClick(RPNCalculation.Enter) } + KeyboardButtonLight(bModifier, IconPack.Backspace, null, KeyboardButtonContentHeightShort) { onInputEditClick(RPNInputEdit.Delete) } + KeyboardButtonFilled(bModifier, IconPack.Percent, null, KeyboardButtonContentHeightShort) { onCalculationClick(RPNCalculation.Percent) } + KeyboardButtonFilled(bModifier, IconPack.Enter, null, KeyboardButtonContentHeightShort) { onCalculationClick(RPNCalculation.Enter) } } } @@ -228,7 +223,6 @@ private fun PreviewKeyboard() { modifier = Modifier.fillMaxSize(), fractional = Token.Digit.dot, middleZero = false, - allowVibration = false, onCalculationClick = {}, onInputEditClick = {} ) diff --git a/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/RPNCalculatorScreen.kt b/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/RPNCalculatorScreen.kt index b297bb05..c099592f 100644 --- a/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/RPNCalculatorScreen.kt +++ b/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/RPNCalculatorScreen.kt @@ -97,7 +97,6 @@ internal fun RPNCalculatorScreen( .fillMaxSize(), fractional = uiState.formatterSymbols.fractional, middleZero = uiState.middleZero, - allowVibration = uiState.allowVibration, onCalculationClick = onCalculationClick, onInputEditClick = onInputEditClick ) @@ -124,7 +123,6 @@ private fun RPNCalculatorScreenPreview() { precision = 3, outputFormat = OutputFormat.PLAIN, formatterSymbols = FormatterSymbols.Spaces, - allowVibration = true, middleZero = true, ), openDrawer = {}, diff --git a/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/RPNCalculatorUIState.kt b/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/RPNCalculatorUIState.kt index 18b6e21b..9508d604 100644 --- a/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/RPNCalculatorUIState.kt +++ b/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/RPNCalculatorUIState.kt @@ -1,6 +1,6 @@ /* * Unitto is a unit converter for Android - * Copyright (c) 2023 Elshan Agaev + * Copyright (c) 2023-2024 Elshan Agaev * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,7 +31,6 @@ internal sealed class RPNCalculatorUIState { val precision: Int, val outputFormat: Int, val formatterSymbols: FormatterSymbols, - val allowVibration: Boolean, val middleZero: Boolean, ) : RPNCalculatorUIState() } diff --git a/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/RPNCalculatorViewModel.kt b/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/RPNCalculatorViewModel.kt index 1a20c7ae..484e589a 100644 --- a/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/RPNCalculatorViewModel.kt +++ b/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/RPNCalculatorViewModel.kt @@ -1,6 +1,6 @@ /* * Unitto is a unit converter for Android - * Copyright (c) 2023 Elshan Agaev + * Copyright (c) 2023-2024 Elshan Agaev * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -68,7 +68,6 @@ internal class RPNCalculatorViewModel @Inject constructor( precision = prefs.precision, outputFormat = prefs.outputFormat, formatterSymbols = AllFormatterSymbols.getById(prefs.separator), - allowVibration = prefs.enableVibrations, middleZero = prefs.middleZero ) } diff --git a/feature/settings/src/main/java/com/sadellie/unitto/feature/settings/converter/ConverterSettingsScreen.kt b/feature/settings/src/main/java/com/sadellie/unitto/feature/settings/converter/ConverterSettingsScreen.kt index afb237f0..86216d25 100644 --- a/feature/settings/src/main/java/com/sadellie/unitto/feature/settings/converter/ConverterSettingsScreen.kt +++ b/feature/settings/src/main/java/com/sadellie/unitto/feature/settings/converter/ConverterSettingsScreen.kt @@ -37,9 +37,9 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.sadellie.unitto.core.base.OutputFormat import com.sadellie.unitto.core.base.R import com.sadellie.unitto.core.base.Separator -import com.sadellie.unitto.core.ui.common.NavigateUpButton import com.sadellie.unitto.core.ui.common.EmptyScreen import com.sadellie.unitto.core.ui.common.ListItem +import com.sadellie.unitto.core.ui.common.NavigateUpButton import com.sadellie.unitto.core.ui.common.ScaffoldWithLargeTopBar import com.sadellie.unitto.data.model.ALL_UNIT_GROUPS import com.sadellie.unitto.data.model.UnitsListSorting @@ -133,7 +133,6 @@ private fun ConverterSettingsScreen( private fun PreviewConverterSettingsScreen() { ConverterSettingsScreen( prefs = ConverterPreferencesImpl( - enableVibrations = true, separator = Separator.SPACE, middleZero = false, precision = 3,