diff --git a/app/src/main/java/com/sadellie/unitto/App.kt b/app/src/main/java/com/sadellie/unitto/App.kt
index 7e2f4e3b..37b07fc6 100644
--- a/app/src/main/java/com/sadellie/unitto/App.kt
+++ b/app/src/main/java/com/sadellie/unitto/App.kt
@@ -67,61 +67,61 @@ internal fun App(prefs: AppPreferences?) {
}
}
- if (prefs != null) {
- val themmoController = remember(prefs) {
- ThemmoController(
- lightColorScheme = LightThemeColors,
- darkColorScheme = DarkThemeColors,
- themingMode = prefs.themingMode,
- dynamicThemeEnabled = prefs.enableDynamicTheme,
- amoledThemeEnabled = prefs.enableAmoledTheme,
- customColor = prefs.customColor.toColor(),
- monetMode = prefs.monetMode
- )
- }
+ if (prefs == null) return
- Themmo(
- themmoController = themmoController,
- typography = TypographySystem,
- animationSpec = tween(250)
- ) {
- val backgroundColor = MaterialTheme.colorScheme.background
- val useDarkIcons = remember(backgroundColor) { backgroundColor.luminance() > 0.5f }
-
- NavigationDrawer(
- modifier = Modifier,
- state = drawerState,
- gesturesEnabled = gesturesEnabled,
- tabs = DrawerItem.main,
- currentDestination = navBackStackEntry?.destination?.route,
- onItemClick = { destination ->
- drawerScope.launch { drawerState.close() }
-
- navController.navigate(destination.graph) {
- popUpTo(navController.graph.findStartDestination().id) {
- saveState = true
- }
- launchSingleTop = true
- restoreState = true
- }
+ val themmoController = remember(prefs) {
+ ThemmoController(
+ lightColorScheme = LightThemeColors,
+ darkColorScheme = DarkThemeColors,
+ themingMode = prefs.themingMode,
+ dynamicThemeEnabled = prefs.enableDynamicTheme,
+ amoledThemeEnabled = prefs.enableAmoledTheme,
+ customColor = prefs.customColor.toColor(),
+ monetMode = prefs.monetMode
+ )
+ }
+
+ Themmo(
+ themmoController = themmoController,
+ typography = TypographySystem,
+ animationSpec = tween(250)
+ ) {
+ val backgroundColor = MaterialTheme.colorScheme.background
+ val useDarkIcons = remember(backgroundColor) { backgroundColor.luminance() > 0.5f }
- shortcutsScope.launch { mContext.pushDynamicShortcut(destination) }
- },
- content = {
- UnittoNavigation(
- navController = navController,
- themmoController = it,
- startDestination = prefs.startingScreen,
- rpnMode = prefs.rpnMode,
- openDrawer = { drawerScope.launch { drawerState.open() } }
- )
+ NavigationDrawer(
+ modifier = Modifier,
+ state = drawerState,
+ gesturesEnabled = gesturesEnabled,
+ tabs = DrawerItem.main,
+ currentDestination = navBackStackEntry?.destination?.route,
+ onItemClick = { destination ->
+ drawerScope.launch { drawerState.close() }
+
+ navController.navigate(destination.graph) {
+ popUpTo(navController.graph.findStartDestination().id) {
+ saveState = true
+ }
+ launchSingleTop = true
+ restoreState = true
}
- )
- LaunchedEffect(useDarkIcons) {
- sysUiController.setNavigationBarColor(Color.Transparent, useDarkIcons)
- sysUiController.setStatusBarColor(Color.Transparent, useDarkIcons)
+ shortcutsScope.launch { mContext.pushDynamicShortcut(destination) }
+ },
+ content = {
+ UnittoNavigation(
+ navController = navController,
+ themmoController = it,
+ startDestination = prefs.startingScreen,
+ rpnMode = prefs.rpnMode,
+ openDrawer = { drawerScope.launch { drawerState.open() } }
+ )
}
+ )
+
+ LaunchedEffect(useDarkIcons) {
+ sysUiController.setNavigationBarColor(Color.Transparent, useDarkIcons)
+ sysUiController.setStatusBarColor(Color.Transparent, useDarkIcons)
}
}
diff --git a/app/src/main/java/com/sadellie/unitto/MainActivity.kt b/app/src/main/java/com/sadellie/unitto/MainActivity.kt
index d57edc32..b37348bb 100644
--- a/app/src/main/java/com/sadellie/unitto/MainActivity.kt
+++ b/app/src/main/java/com/sadellie/unitto/MainActivity.kt
@@ -32,6 +32,7 @@ import androidx.compose.ui.platform.LocalConfiguration
import androidx.core.os.ConfigurationCompat
import androidx.core.view.WindowCompat
import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import com.sadellie.unitto.core.ui.LocalHapticPreference
import com.sadellie.unitto.core.ui.LocalLocale
import com.sadellie.unitto.core.ui.LocalWindowSize
import com.sadellie.unitto.core.ui.calculateWindowSizeClass
@@ -69,7 +70,8 @@ internal class MainActivity : AppCompatActivity() {
CompositionLocalProvider(
LocalLocale provides locale,
LocalWindowSize provides calculateWindowSizeClass(this@MainActivity),
- LocalNumberTypography provides numbersTypography
+ LocalNumberTypography provides numbersTypography,
+ LocalHapticPreference provides (prefs?.enableVibrations ?: true)
) {
App(prefs)
}
diff --git a/core/ui/src/main/java/com/sadellie/unitto/core/ui/LocalHapticPreference.kt b/core/ui/src/main/java/com/sadellie/unitto/core/ui/LocalHapticPreference.kt
new file mode 100644
index 00000000..87b6e58b
--- /dev/null
+++ b/core/ui/src/main/java/com/sadellie/unitto/core/ui/LocalHapticPreference.kt
@@ -0,0 +1,25 @@
+/*
+ * Unitto is a unit converter for Android
+ * Copyright (c) 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.sadellie.unitto.core.ui
+
+import androidx.compose.runtime.compositionLocalOf
+
+val LocalHapticPreference = compositionLocalOf {
+ true
+}
diff --git a/core/ui/src/main/java/com/sadellie/unitto/core/ui/common/KeyboardButton.kt b/core/ui/src/main/java/com/sadellie/unitto/core/ui/common/KeyboardButton.kt
index 8567114c..c2e4af69 100644
--- a/core/ui/src/main/java/com/sadellie/unitto/core/ui/common/KeyboardButton.kt
+++ b/core/ui/src/main/java/com/sadellie/unitto/core/ui/common/KeyboardButton.kt
@@ -36,6 +36,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalView
+import com.sadellie.unitto.core.ui.LocalHapticPreference
import kotlinx.coroutines.launch
@Composable
@@ -48,10 +49,10 @@ fun BasicKeyboardButton(
icon: ImageVector,
contentDescription: String?,
iconColor: Color,
- allowVibration: Boolean,
) {
val view = LocalView.current
val coroutineScope = rememberCoroutineScope()
+ val allowVibration = LocalHapticPreference.current
fun vibrate() {
if (allowVibration) {
coroutineScope.launch {
@@ -93,7 +94,6 @@ fun KeyboardButtonLight(
modifier: Modifier,
icon: ImageVector,
contentDescription: String?,
- allowVibration: Boolean,
contentHeight: Float,
onLongClick: (() -> Unit)? = null,
onClick: () -> Unit,
@@ -107,7 +107,6 @@ fun KeyboardButtonLight(
icon = icon,
contentDescription = contentDescription,
iconColor = MaterialTheme.colorScheme.onSurfaceVariant,
- allowVibration = allowVibration,
)
}
@@ -116,7 +115,6 @@ fun KeyboardButtonFilled(
modifier: Modifier,
icon: ImageVector,
contentDescription: String?,
- allowVibration: Boolean,
contentHeight: Float,
onLongClick: (() -> Unit)? = null,
onClick: () -> Unit,
@@ -130,7 +128,6 @@ fun KeyboardButtonFilled(
icon = icon,
contentDescription = contentDescription,
iconColor = MaterialTheme.colorScheme.onPrimaryContainer,
- allowVibration = allowVibration,
)
}
@@ -139,7 +136,6 @@ fun KeyboardButtonAdditional(
modifier: Modifier,
icon: ImageVector,
contentDescription: String?,
- allowVibration: Boolean,
contentHeight: Float,
onLongClick: (() -> Unit)? = null,
onClick: () -> Unit,
@@ -153,7 +149,6 @@ fun KeyboardButtonAdditional(
icon = icon,
contentDescription = contentDescription,
iconColor = MaterialTheme.colorScheme.onSurfaceVariant,
- allowVibration = allowVibration,
)
}
@@ -162,7 +157,6 @@ fun KeyboardButtonTertiary(
modifier: Modifier,
icon: ImageVector,
contentDescription: String?,
- allowVibration: Boolean,
contentHeight: Float,
onLongClick: (() -> Unit)? = null,
onClick: () -> Unit,
@@ -176,7 +170,6 @@ fun KeyboardButtonTertiary(
icon = icon,
contentDescription = contentDescription,
iconColor = MaterialTheme.colorScheme.onTertiaryContainer,
- allowVibration = allowVibration,
)
}
diff --git a/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/AddSubtractPreferences.kt b/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/AddSubtractPreferences.kt
index f908f89b..eff24149 100644
--- a/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/AddSubtractPreferences.kt
+++ b/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/AddSubtractPreferences.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
@@ -20,5 +20,4 @@ package com.sadellie.unitto.data.model.userprefs
interface AddSubtractPreferences{
val separator: Int
- val enableVibrations: Boolean
}
diff --git a/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/AppPreferences.kt b/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/AppPreferences.kt
index 3890a93d..a39b7a39 100644
--- a/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/AppPreferences.kt
+++ b/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/AppPreferences.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,4 +31,5 @@ interface AppPreferences {
val enableToolsExperiment: Boolean
val systemFont: Boolean
val rpnMode: Boolean
+ val enableVibrations: Boolean
}
diff --git a/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/BodyMassPreferences.kt b/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/BodyMassPreferences.kt
index 54a07dd6..32f7c324 100644
--- a/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/BodyMassPreferences.kt
+++ b/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/BodyMassPreferences.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
@@ -20,5 +20,4 @@ package com.sadellie.unitto.data.model.userprefs
interface BodyMassPreferences{
val separator: Int
- val enableVibrations: Boolean
}
diff --git a/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/CalculatorPreferences.kt b/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/CalculatorPreferences.kt
index ac94e89a..b08c4a34 100644
--- a/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/CalculatorPreferences.kt
+++ b/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/CalculatorPreferences.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
@@ -20,7 +20,6 @@ package com.sadellie.unitto.data.model.userprefs
interface CalculatorPreferences {
val radianMode: Boolean
- val enableVibrations: Boolean
val separator: Int
val middleZero: Boolean
val acButton: Boolean
diff --git a/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/ConverterPreferences.kt b/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/ConverterPreferences.kt
index 1260351a..0963cd3f 100644
--- a/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/ConverterPreferences.kt
+++ b/data/model/src/main/java/com/sadellie/unitto/data/model/userprefs/ConverterPreferences.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
@@ -22,7 +22,6 @@ import com.sadellie.unitto.data.model.UnitGroup
import com.sadellie.unitto.data.model.UnitsListSorting
interface ConverterPreferences {
- val enableVibrations: Boolean
val separator: Int
val middleZero: Boolean
val acButton: Boolean
diff --git a/data/userprefs/src/main/java/com/sadellie/unitto/data/userprefs/PreferenceModels.kt b/data/userprefs/src/main/java/com/sadellie/unitto/data/userprefs/PreferenceModels.kt
index 7390b603..b5bd783c 100644
--- a/data/userprefs/src/main/java/com/sadellie/unitto/data/userprefs/PreferenceModels.kt
+++ b/data/userprefs/src/main/java/com/sadellie/unitto/data/userprefs/PreferenceModels.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
@@ -45,6 +45,7 @@ data class AppPreferencesImpl(
override val enableToolsExperiment: Boolean,
override val systemFont: Boolean,
override val rpnMode: Boolean,
+ override val enableVibrations: Boolean,
) : AppPreferences
data class GeneralPreferencesImpl(
@@ -54,7 +55,6 @@ data class GeneralPreferencesImpl(
data class CalculatorPreferencesImpl(
override val radianMode: Boolean,
- override val enableVibrations: Boolean,
override val separator: Int,
override val middleZero: Boolean,
override val acButton: Boolean,
@@ -64,7 +64,6 @@ data class CalculatorPreferencesImpl(
) : CalculatorPreferences
data class ConverterPreferencesImpl(
- override val enableVibrations: Boolean,
override val separator: Int,
override val middleZero: Boolean,
override val acButton: Boolean,
@@ -97,12 +96,10 @@ data class UnitGroupsPreferencesImpl(
data class AddSubtractPreferencesImpl(
override val separator: Int,
- override val enableVibrations: Boolean,
) : AddSubtractPreferences
data class BodyMassPreferencesImpl(
override val separator: Int,
- override val enableVibrations: Boolean,
) : BodyMassPreferences
data class AboutPreferencesImpl(
diff --git a/data/userprefs/src/main/java/com/sadellie/unitto/data/userprefs/UserPreferences.kt b/data/userprefs/src/main/java/com/sadellie/unitto/data/userprefs/UserPreferences.kt
index 047f0807..d73d1819 100644
--- a/data/userprefs/src/main/java/com/sadellie/unitto/data/userprefs/UserPreferences.kt
+++ b/data/userprefs/src/main/java/com/sadellie/unitto/data/userprefs/UserPreferences.kt
@@ -1,6 +1,6 @@
/*
* Unitto is a unit converter for Android
- * Copyright (c) 2022-2023 Elshan Agaev
+ * Copyright (c) 2022-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
@@ -63,6 +63,7 @@ class UserPreferencesRepositoryImpl @Inject constructor(
enableToolsExperiment = preferences.getEnableToolsExperiment(),
systemFont = preferences.getSystemFont(),
rpnMode = preferences.getRpnMode(),
+ enableVibrations = preferences.getEnableVibrations(),
)
}
@@ -78,7 +79,6 @@ class UserPreferencesRepositoryImpl @Inject constructor(
.map { preferences ->
CalculatorPreferencesImpl(
radianMode = preferences.getRadianMode(),
- enableVibrations = preferences.getEnableVibrations(),
separator = preferences.getSeparator(),
middleZero = preferences.getMiddleZero(),
partialHistoryView = preferences.getPartialHistoryView(),
@@ -91,7 +91,6 @@ class UserPreferencesRepositoryImpl @Inject constructor(
override val converterPrefs: Flow = data
.map { preferences ->
ConverterPreferencesImpl(
- enableVibrations = preferences.getEnableVibrations(),
separator = preferences.getSeparator(),
middleZero = preferences.getMiddleZero(),
precision = preferences.getDigitsPrecision(),
@@ -136,7 +135,6 @@ class UserPreferencesRepositoryImpl @Inject constructor(
.map { preferences ->
AddSubtractPreferencesImpl(
separator = preferences.getSeparator(),
- enableVibrations = preferences.getEnableVibrations(),
)
}
@@ -144,7 +142,6 @@ class UserPreferencesRepositoryImpl @Inject constructor(
.map { preferences ->
BodyMassPreferencesImpl(
separator = preferences.getSeparator(),
- enableVibrations = preferences.getEnableVibrations(),
)
}
diff --git a/feature/bodymass/src/main/java/com/sadellie/unitto/feature/bodymass/BodyMassScreen.kt b/feature/bodymass/src/main/java/com/sadellie/unitto/feature/bodymass/BodyMassScreen.kt
index c123062e..7138f045 100644
--- a/feature/bodymass/src/main/java/com/sadellie/unitto/feature/bodymass/BodyMassScreen.kt
+++ b/feature/bodymass/src/main/java/com/sadellie/unitto/feature/bodymass/BodyMassScreen.kt
@@ -50,12 +50,12 @@ import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.sadellie.unitto.core.base.R
+import com.sadellie.unitto.core.ui.common.EmptyScreen
import com.sadellie.unitto.core.ui.common.MenuButton
+import com.sadellie.unitto.core.ui.common.ScaffoldWithTopBar
import com.sadellie.unitto.core.ui.common.SegmentedButton
import com.sadellie.unitto.core.ui.common.SegmentedButtonsRow
import com.sadellie.unitto.core.ui.common.SettingsButton
-import com.sadellie.unitto.core.ui.common.EmptyScreen
-import com.sadellie.unitto.core.ui.common.ScaffoldWithTopBar
import com.sadellie.unitto.core.ui.common.textfield.ExpressionTransformer
import com.sadellie.unitto.core.ui.common.textfield.FormatterSymbols
import com.sadellie.unitto.core.ui.openLink
@@ -224,7 +224,6 @@ fun PreviewBodyMassScreen() {
weight = TextFieldValue(),
normalWeightRange = BigDecimal(30) to BigDecimal(50),
result = BigDecimal(18.5),
- allowVibration = false,
formatterSymbols = FormatterSymbols.Spaces
),
updateHeight1 = {},
diff --git a/feature/bodymass/src/main/java/com/sadellie/unitto/feature/bodymass/BodyMassViewModel.kt b/feature/bodymass/src/main/java/com/sadellie/unitto/feature/bodymass/BodyMassViewModel.kt
index 3058a9dd..427aac15 100644
--- a/feature/bodymass/src/main/java/com/sadellie/unitto/feature/bodymass/BodyMassViewModel.kt
+++ b/feature/bodymass/src/main/java/com/sadellie/unitto/feature/bodymass/BodyMassViewModel.kt
@@ -64,7 +64,6 @@ internal class BodyMassViewModel @Inject constructor(
weight = weight,
result = result,
normalWeightRange = normalWeightRange,
- allowVibration = userPrefs.enableVibrations,
formatterSymbols = AllFormatterSymbols.getById(userPrefs.separator)
)
}
diff --git a/feature/bodymass/src/main/java/com/sadellie/unitto/feature/bodymass/UIState.kt b/feature/bodymass/src/main/java/com/sadellie/unitto/feature/bodymass/UIState.kt
index 8d3153ea..12e316c7 100644
--- a/feature/bodymass/src/main/java/com/sadellie/unitto/feature/bodymass/UIState.kt
+++ b/feature/bodymass/src/main/java/com/sadellie/unitto/feature/bodymass/UIState.kt
@@ -32,7 +32,6 @@ internal sealed class UIState {
val weight: TextFieldValue,
val normalWeightRange: Pair,
val result: BigDecimal,
- val allowVibration: Boolean,
val formatterSymbols: FormatterSymbols,
) : UIState()
}
diff --git a/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/CalculatorScreen.kt b/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/CalculatorScreen.kt
index a097c23b..9af19d24 100644
--- a/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/CalculatorScreen.kt
+++ b/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/CalculatorScreen.kt
@@ -67,10 +67,10 @@ import com.sadellie.unitto.core.base.OutputFormat
import com.sadellie.unitto.core.base.R
import com.sadellie.unitto.core.ui.LocalWindowSize
import com.sadellie.unitto.core.ui.WindowHeightSizeClass
-import com.sadellie.unitto.core.ui.common.MenuButton
-import com.sadellie.unitto.core.ui.common.SettingsButton
import com.sadellie.unitto.core.ui.common.EmptyScreen
+import com.sadellie.unitto.core.ui.common.MenuButton
import com.sadellie.unitto.core.ui.common.ScaffoldWithTopBar
+import com.sadellie.unitto.core.ui.common.SettingsButton
import com.sadellie.unitto.core.ui.common.textfield.FormatterSymbols
import com.sadellie.unitto.data.model.HistoryItem
import com.sadellie.unitto.feature.calculator.components.CalculatorKeyboard
@@ -280,7 +280,6 @@ private fun Ready(
.padding(horizontal = 8.dp, vertical = 4.dp),
radianMode = uiState.radianMode,
fractional = uiState.formatterSymbols.fractional,
- allowVibration = uiState.allowVibration,
addSymbol = addSymbol,
clearSymbols = clearSymbols,
deleteSymbol = deleteSymbol,
@@ -363,7 +362,6 @@ private fun PreviewCalculatorScreen() {
outputFormat = OutputFormat.PLAIN,
formatterSymbols = FormatterSymbols.Spaces,
history = historyItems,
- allowVibration = false,
middleZero = false,
acButton = true,
partialHistoryView = true
diff --git a/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/CalculatorUIState.kt b/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/CalculatorUIState.kt
index 001f5ce9..c9a16b5c 100644
--- a/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/CalculatorUIState.kt
+++ b/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/CalculatorUIState.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
@@ -35,7 +35,6 @@ internal sealed class CalculatorUIState {
val outputFormat: Int,
val formatterSymbols: FormatterSymbols,
val history: List,
- val allowVibration: Boolean,
val middleZero: Boolean,
val acButton: Boolean,
val partialHistoryView: Boolean,
diff --git a/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/CalculatorViewModel.kt b/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/CalculatorViewModel.kt
index 2c2f5b7b..22c780e6 100644
--- a/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/CalculatorViewModel.kt
+++ b/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/CalculatorViewModel.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
@@ -80,7 +80,6 @@ internal class CalculatorViewModel @Inject constructor(
outputFormat = prefs.outputFormat,
formatterSymbols = AllFormatterSymbols.getById(prefs.separator),
history = history,
- allowVibration = prefs.enableVibrations,
middleZero = prefs.middleZero,
acButton = prefs.acButton,
partialHistoryView = prefs.partialHistoryView,
diff --git a/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/components/CalculatorKeyboard.kt b/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/components/CalculatorKeyboard.kt
index a0ca58c2..deaacae5 100644
--- a/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/components/CalculatorKeyboard.kt
+++ b/feature/calculator/src/main/java/com/sadellie/unitto/feature/calculator/components/CalculatorKeyboard.kt
@@ -80,8 +80,8 @@ import com.sadellie.unitto.core.ui.common.icons.iconpack.Deg
import com.sadellie.unitto.core.ui.common.icons.iconpack.Divide
import com.sadellie.unitto.core.ui.common.icons.iconpack.Dot
import com.sadellie.unitto.core.ui.common.icons.iconpack.Equal
-import com.sadellie.unitto.core.ui.common.icons.iconpack.Ex
import com.sadellie.unitto.core.ui.common.icons.iconpack.Euler
+import com.sadellie.unitto.core.ui.common.icons.iconpack.Ex
import com.sadellie.unitto.core.ui.common.icons.iconpack.Factorial
import com.sadellie.unitto.core.ui.common.icons.iconpack.Inv
import com.sadellie.unitto.core.ui.common.icons.iconpack.Key0
@@ -117,7 +117,6 @@ internal fun CalculatorKeyboard(
modifier: Modifier,
radianMode: Boolean,
fractional: String,
- allowVibration: Boolean,
middleZero: Boolean,
acButton: Boolean,
addSymbol: (String) -> Unit,
@@ -134,7 +133,6 @@ internal fun CalculatorKeyboard(
modifier = modifier,
radianMode = radianMode,
fractional = fractional,
- allowVibration = allowVibration,
middleZero = middleZero,
addSymbol = addSymbol,
toggleAngleMode = toggleAngleMode,
@@ -151,7 +149,6 @@ internal fun CalculatorKeyboard(
modifier = modifier,
radianMode = radianMode,
fractional = fractional,
- allowVibration = allowVibration,
middleZero = middleZero,
addSymbol = addSymbol,
toggleAngleMode = toggleAngleMode,
@@ -171,7 +168,6 @@ private fun PortraitKeyboard(
modifier: Modifier,
radianMode: Boolean,
fractional: String,
- allowVibration: Boolean,
middleZero: Boolean,
addSymbol: (String) -> Unit,
toggleAngleMode: () -> Unit,
@@ -222,21 +218,21 @@ private fun PortraitKeyboard(
showAdditional = showAdditional,
buttonHeight = additionalButtonHeight,
content1 = { buttonModifier ->
- KeyboardButtonAdditional(buttonModifier, IconPack.Modulo, stringResource(R.string.keyboard_modulo), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Operator.modulo) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Pi, stringResource(R.string.keyboard_pi), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Const.pi) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Power, stringResource(R.string.keyboard_power), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Operator.power) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Factorial, stringResource(R.string.keyboard_factorial), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Operator.factorial) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Modulo, stringResource(R.string.keyboard_modulo), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Operator.modulo) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Pi, stringResource(R.string.keyboard_pi), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Const.pi) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Power, stringResource(R.string.keyboard_power), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Operator.power) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Factorial, stringResource(R.string.keyboard_factorial), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Operator.factorial) }
},
content2 = { buttonModifier ->
- KeyboardButtonAdditional(buttonModifier, angleIcon, stringResource(angleIconDescription), allowVibration, KeyboardButtonContentHeightTallAdditional) { toggleAngleMode() }
- KeyboardButtonAdditional(buttonModifier, IconPack.ArSin, stringResource(R.string.keyboard_arsin), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.arsinBracket) }
- KeyboardButtonAdditional(buttonModifier, IconPack.ArCos, stringResource(R.string.keyboard_arcos), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.arcosBracket) }
- KeyboardButtonAdditional(buttonModifier, IconPack.AcTan, stringResource(R.string.keyboard_actan), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.actanBracket) }
-
- KeyboardButtonAdditional(buttonModifier, IconPack.Inv, stringResource(R.string.keyboard_inverse), allowVibration, KeyboardButtonContentHeightTallAdditional) { toggleInvMode() }
- KeyboardButtonAdditional(buttonModifier, IconPack.Euler, stringResource(R.string.keyboard_euler), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Const.e) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Ex, stringResource(R.string.keyboard_exp), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.expBracket) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Power10, stringResource(R.string.keyboard_power_10), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Digit._1 + Token.Digit._0 + Token.Operator.power) }
+ KeyboardButtonAdditional(buttonModifier, angleIcon, stringResource(angleIconDescription), KeyboardButtonContentHeightTallAdditional) { toggleAngleMode() }
+ KeyboardButtonAdditional(buttonModifier, IconPack.ArSin, stringResource(R.string.keyboard_arsin), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.arsinBracket) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.ArCos, stringResource(R.string.keyboard_arcos), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.arcosBracket) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.AcTan, stringResource(R.string.keyboard_actan), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.actanBracket) }
+
+ KeyboardButtonAdditional(buttonModifier, IconPack.Inv, stringResource(R.string.keyboard_inverse), KeyboardButtonContentHeightTallAdditional) { toggleInvMode() }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Euler, stringResource(R.string.keyboard_euler), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Const.e) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Ex, stringResource(R.string.keyboard_exp), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.expBracket) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Power10, stringResource(R.string.keyboard_power_10), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Digit._1 + Token.Digit._0 + Token.Operator.power) }
}
)
} else {
@@ -245,21 +241,21 @@ private fun PortraitKeyboard(
showAdditional = showAdditional,
buttonHeight = additionalButtonHeight,
content1 = { buttonModifier ->
- KeyboardButtonAdditional(buttonModifier, IconPack.Root, stringResource(R.string.keyboard_root), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Operator.sqrt) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Pi, stringResource(R.string.keyboard_pi), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Const.pi) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Power, stringResource(R.string.keyboard_power), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Operator.power) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Factorial, stringResource(R.string.keyboard_factorial), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Operator.factorial) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Root, stringResource(R.string.keyboard_root), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Operator.sqrt) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Pi, stringResource(R.string.keyboard_pi), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Const.pi) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Power, stringResource(R.string.keyboard_power), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Operator.power) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Factorial, stringResource(R.string.keyboard_factorial), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Operator.factorial) }
},
content2 = { buttonModifier ->
- KeyboardButtonAdditional(buttonModifier, angleIcon, stringResource(angleIconDescription), allowVibration, KeyboardButtonContentHeightTallAdditional) { toggleAngleMode() }
- KeyboardButtonAdditional(buttonModifier, IconPack.Sin, stringResource(R.string.keyboard_sin), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.sinBracket) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Cos, stringResource(R.string.keyboard_cos), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.cosBracket) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Tan, stringResource(R.string.keyboard_tan), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.tanBracket) }
-
- KeyboardButtonAdditional(buttonModifier, IconPack.Inv, stringResource(R.string.keyboard_inverse), allowVibration, KeyboardButtonContentHeightTallAdditional) { toggleInvMode() }
- KeyboardButtonAdditional(buttonModifier, IconPack.Euler, stringResource(R.string.keyboard_exp), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Const.e) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Ln, stringResource(R.string.keyboard_ln), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.lnBracket) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Log, stringResource(R.string.keyboard_log), allowVibration, KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.logBracket) }
+ KeyboardButtonAdditional(buttonModifier, angleIcon, stringResource(angleIconDescription), KeyboardButtonContentHeightTallAdditional) { toggleAngleMode() }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Sin, stringResource(R.string.keyboard_sin), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.sinBracket) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Cos, stringResource(R.string.keyboard_cos), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.cosBracket) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Tan, stringResource(R.string.keyboard_tan), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.tanBracket) }
+
+ KeyboardButtonAdditional(buttonModifier, IconPack.Inv, stringResource(R.string.keyboard_inverse), KeyboardButtonContentHeightTallAdditional) { toggleInvMode() }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Euler, stringResource(R.string.keyboard_exp), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Const.e) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Ln, stringResource(R.string.keyboard_ln), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.lnBracket) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Log, stringResource(R.string.keyboard_log), KeyboardButtonContentHeightTallAdditional) { addSymbol(Token.Func.logBracket) }
}
)
}
@@ -292,39 +288,39 @@ private fun PortraitKeyboard(
.fillMaxHeight(height)
if (acButton) {
- KeyboardButtonTertiary(mainButtonModifier, IconPack.Clear, stringResource(R.string.clear_label), allowVibration, KeyboardButtonContentHeightTall) { clearSymbols() }
- KeyboardButtonFilled(mainButtonModifier, IconPack.Brackets, stringResource(R.string.keyboard_brackets), allowVibration, KeyboardButtonContentHeightTall) { addBracket() }
+ KeyboardButtonTertiary(mainButtonModifier, IconPack.Clear, stringResource(R.string.clear_label), KeyboardButtonContentHeightTall) { clearSymbols() }
+ KeyboardButtonFilled(mainButtonModifier, IconPack.Brackets, stringResource(R.string.keyboard_brackets), KeyboardButtonContentHeightTall) { addBracket() }
} else {
- KeyboardButtonFilled(mainButtonModifier, IconPack.LeftBracket, stringResource(R.string.keyboard_left_bracket), allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Operator.leftBracket) }
- KeyboardButtonFilled(mainButtonModifier, IconPack.RightBracket, stringResource(R.string.keyboard_right_bracket), allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Operator.rightBracket) }
+ KeyboardButtonFilled(mainButtonModifier, IconPack.LeftBracket, stringResource(R.string.keyboard_left_bracket), KeyboardButtonContentHeightTall) { addSymbol(Token.Operator.leftBracket) }
+ KeyboardButtonFilled(mainButtonModifier, IconPack.RightBracket, stringResource(R.string.keyboard_right_bracket), KeyboardButtonContentHeightTall) { addSymbol(Token.Operator.rightBracket) }
}
- KeyboardButtonFilled(mainButtonModifier, IconPack.Percent, stringResource(R.string.keyboard_percent), allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Operator.percent) }
- KeyboardButtonFilled(mainButtonModifier, IconPack.Divide, stringResource(R.string.keyboard_divide), allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Operator.divide) }
+ KeyboardButtonFilled(mainButtonModifier, IconPack.Percent, stringResource(R.string.keyboard_percent), KeyboardButtonContentHeightTall) { addSymbol(Token.Operator.percent) }
+ KeyboardButtonFilled(mainButtonModifier, IconPack.Divide, stringResource(R.string.keyboard_divide), KeyboardButtonContentHeightTall) { addSymbol(Token.Operator.divide) }
- KeyboardButtonLight(mainButtonModifier, IconPack.Key7, Token.Digit._7, allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._7) }
- KeyboardButtonLight(mainButtonModifier, IconPack.Key8, Token.Digit._8, allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._8) }
- KeyboardButtonLight(mainButtonModifier, IconPack.Key9, Token.Digit._9, allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._9) }
- KeyboardButtonFilled(mainButtonModifier, IconPack.Multiply, stringResource(R.string.keyboard_multiply), allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Operator.multiply) }
+ KeyboardButtonLight(mainButtonModifier, IconPack.Key7, Token.Digit._7, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._7) }
+ KeyboardButtonLight(mainButtonModifier, IconPack.Key8, Token.Digit._8, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._8) }
+ KeyboardButtonLight(mainButtonModifier, IconPack.Key9, Token.Digit._9, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._9) }
+ KeyboardButtonFilled(mainButtonModifier, IconPack.Multiply, stringResource(R.string.keyboard_multiply), KeyboardButtonContentHeightTall) { addSymbol(Token.Operator.multiply) }
- KeyboardButtonLight(mainButtonModifier, IconPack.Key4, Token.Digit._4, allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._4) }
- KeyboardButtonLight(mainButtonModifier, IconPack.Key5, Token.Digit._5, allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._5) }
- KeyboardButtonLight(mainButtonModifier, IconPack.Key6, Token.Digit._6, allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._6) }
- KeyboardButtonFilled(mainButtonModifier, IconPack.Minus, stringResource(R.string.keyboard_minus), allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Operator.minus) }
+ KeyboardButtonLight(mainButtonModifier, IconPack.Key4, Token.Digit._4, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._4) }
+ KeyboardButtonLight(mainButtonModifier, IconPack.Key5, Token.Digit._5, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._5) }
+ KeyboardButtonLight(mainButtonModifier, IconPack.Key6, Token.Digit._6, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._6) }
+ KeyboardButtonFilled(mainButtonModifier, IconPack.Minus, stringResource(R.string.keyboard_minus), KeyboardButtonContentHeightTall) { addSymbol(Token.Operator.minus) }
- KeyboardButtonLight(mainButtonModifier, IconPack.Key1, Token.Digit._1, allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._1) }
- KeyboardButtonLight(mainButtonModifier, IconPack.Key2, Token.Digit._2, allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._2) }
- KeyboardButtonLight(mainButtonModifier, IconPack.Key3, Token.Digit._3, allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._3) }
- KeyboardButtonFilled(mainButtonModifier, IconPack.Plus, stringResource(R.string.keyboard_plus), allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Operator.plus) }
+ KeyboardButtonLight(mainButtonModifier, IconPack.Key1, Token.Digit._1, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._1) }
+ KeyboardButtonLight(mainButtonModifier, IconPack.Key2, Token.Digit._2, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._2) }
+ KeyboardButtonLight(mainButtonModifier, IconPack.Key3, Token.Digit._3, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._3) }
+ KeyboardButtonFilled(mainButtonModifier, IconPack.Plus, stringResource(R.string.keyboard_plus), KeyboardButtonContentHeightTall) { addSymbol(Token.Operator.plus) }
if (middleZero) {
- KeyboardButtonLight(mainButtonModifier, fractionalIcon, stringResource(fractionalIconDescription), allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit.dot) }
- KeyboardButtonLight(mainButtonModifier, IconPack.Key0, Token.Digit._0, allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._0) }
+ KeyboardButtonLight(mainButtonModifier, fractionalIcon, stringResource(fractionalIconDescription), KeyboardButtonContentHeightTall) { addSymbol(Token.Digit.dot) }
+ KeyboardButtonLight(mainButtonModifier, IconPack.Key0, Token.Digit._0, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._0) }
} else {
- KeyboardButtonLight(mainButtonModifier, IconPack.Key0, Token.Digit._0, allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._0) }
- KeyboardButtonLight(mainButtonModifier, fractionalIcon, stringResource(fractionalIconDescription), allowVibration, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit.dot) }
+ KeyboardButtonLight(mainButtonModifier, IconPack.Key0, Token.Digit._0, KeyboardButtonContentHeightTall) { addSymbol(Token.Digit._0) }
+ KeyboardButtonLight(mainButtonModifier, fractionalIcon, stringResource(fractionalIconDescription), KeyboardButtonContentHeightTall) { addSymbol(Token.Digit.dot) }
}
- KeyboardButtonLight(mainButtonModifier, IconPack.Backspace, stringResource(R.string.delete_label), allowVibration, KeyboardButtonContentHeightTall, clearSymbols) { deleteSymbol() }
- KeyboardButtonFilled(mainButtonModifier, IconPack.Equal, stringResource(R.string.keyboard_equal), allowVibration, KeyboardButtonContentHeightTall) { equal() }
+ KeyboardButtonLight(mainButtonModifier, IconPack.Backspace, stringResource(R.string.delete_label), KeyboardButtonContentHeightTall, clearSymbols) { deleteSymbol() }
+ KeyboardButtonFilled(mainButtonModifier, IconPack.Equal, stringResource(R.string.keyboard_equal), KeyboardButtonContentHeightTall) { equal() }
}
Spacer(modifier = Modifier.height(spacerHeight))
@@ -404,7 +400,6 @@ private fun LandscapeKeyboard(
modifier: Modifier,
radianMode: Boolean,
fractional: String,
- allowVibration: Boolean,
middleZero: Boolean,
addSymbol: (String) -> Unit,
toggleAngleMode: () -> Unit,
@@ -437,51 +432,51 @@ private fun LandscapeKeyboard(
.fillMaxWidth(width)
.fillMaxHeight(height)
- KeyboardButtonAdditional(buttonModifier, angleIcon, stringResource(angleIconDescription), allowVibration, KeyboardButtonContentHeightShortAdditional) { toggleAngleMode() }
- KeyboardButtonAdditional(buttonModifier, IconPack.Modulo, stringResource(R.string.keyboard_modulo), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Operator.modulo) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Pi, stringResource(R.string.keyboard_pi), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Const.pi) }
- KeyboardButtonLight(buttonModifier, IconPack.Key7, Token.Digit._7, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._7) }
- KeyboardButtonLight(buttonModifier, IconPack.Key8, Token.Digit._8, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._8) }
- KeyboardButtonLight(buttonModifier, IconPack.Key9, Token.Digit._9, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._9) }
+ KeyboardButtonAdditional(buttonModifier, angleIcon, stringResource(angleIconDescription), KeyboardButtonContentHeightShortAdditional) { toggleAngleMode() }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Modulo, stringResource(R.string.keyboard_modulo), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Operator.modulo) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Pi, stringResource(R.string.keyboard_pi), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Const.pi) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key7, Token.Digit._7, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._7) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key8, Token.Digit._8, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._8) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key9, Token.Digit._9, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._9) }
if (acButton) {
- KeyboardButtonTertiary(buttonModifier, IconPack.Clear, stringResource(R.string.clear_label), allowVibration, KeyboardButtonContentHeightShort) { clearSymbols() }
- KeyboardButtonFilled(buttonModifier, IconPack.Brackets, stringResource(R.string.keyboard_brackets), allowVibration, KeyboardButtonContentHeightShort) { addBracket() }
+ KeyboardButtonTertiary(buttonModifier, IconPack.Clear, stringResource(R.string.clear_label), KeyboardButtonContentHeightShort) { clearSymbols() }
+ KeyboardButtonFilled(buttonModifier, IconPack.Brackets, stringResource(R.string.keyboard_brackets), KeyboardButtonContentHeightShort) { addBracket() }
} else {
- KeyboardButtonFilled(buttonModifier, IconPack.LeftBracket, stringResource(R.string.keyboard_left_bracket), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.leftBracket) }
- KeyboardButtonFilled(buttonModifier, IconPack.RightBracket, stringResource(R.string.keyboard_right_bracket), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.rightBracket) }
+ KeyboardButtonFilled(buttonModifier, IconPack.LeftBracket, stringResource(R.string.keyboard_left_bracket), KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.leftBracket) }
+ KeyboardButtonFilled(buttonModifier, IconPack.RightBracket, stringResource(R.string.keyboard_right_bracket), KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.rightBracket) }
}
- KeyboardButtonAdditional(buttonModifier, IconPack.Inv, stringResource(R.string.keyboard_inverse), allowVibration, KeyboardButtonContentHeightShortAdditional) { toggleInvMode() }
- KeyboardButtonAdditional(buttonModifier, IconPack.Power, stringResource(R.string.keyboard_power), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Operator.power) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Factorial, stringResource(R.string.keyboard_factorial), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Operator.factorial) }
- KeyboardButtonLight(buttonModifier, IconPack.Key4, Token.Digit._4, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._4) }
- KeyboardButtonLight(buttonModifier, IconPack.Key5, Token.Digit._5, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._5) }
- KeyboardButtonLight(buttonModifier, IconPack.Key6, Token.Digit._6, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._6) }
- KeyboardButtonFilled(buttonModifier, IconPack.Multiply, stringResource(R.string.keyboard_multiply), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.multiply) }
- KeyboardButtonFilled(buttonModifier, IconPack.Divide, stringResource(R.string.keyboard_divide), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.divide) }
-
- KeyboardButtonAdditional(buttonModifier, IconPack.ArSin, stringResource(R.string.keyboard_arsin), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.arsinBracket) }
- KeyboardButtonAdditional(buttonModifier, IconPack.ArCos, stringResource(R.string.keyboard_arcos), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.arcosBracket) }
- KeyboardButtonAdditional(buttonModifier, IconPack.AcTan, stringResource(R.string.keyboard_actan), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.actanBracket) }
- KeyboardButtonLight(buttonModifier, IconPack.Key1, Token.Digit._1, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._1) }
- KeyboardButtonLight(buttonModifier, IconPack.Key2, Token.Digit._2, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._2) }
- KeyboardButtonLight(buttonModifier, IconPack.Key3, Token.Digit._3, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._3) }
- KeyboardButtonFilled(buttonModifier, IconPack.Minus, stringResource(R.string.keyboard_minus), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.minus) }
- KeyboardButtonFilled(buttonModifier, IconPack.Percent, stringResource(R.string.keyboard_percent), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.percent) }
-
- KeyboardButtonAdditional(buttonModifier, IconPack.Euler, stringResource(R.string.keyboard_euler), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Const.e) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Ex, stringResource(R.string.keyboard_exp), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.expBracket) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Power10, stringResource(R.string.keyboard_power_10), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Digit._1 + Token.Digit._0 + Token.Operator.power) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Inv, stringResource(R.string.keyboard_inverse), KeyboardButtonContentHeightShortAdditional) { toggleInvMode() }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Power, stringResource(R.string.keyboard_power), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Operator.power) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Factorial, stringResource(R.string.keyboard_factorial), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Operator.factorial) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key4, Token.Digit._4, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._4) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key5, Token.Digit._5, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._5) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key6, Token.Digit._6, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._6) }
+ KeyboardButtonFilled(buttonModifier, IconPack.Multiply, stringResource(R.string.keyboard_multiply), KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.multiply) }
+ KeyboardButtonFilled(buttonModifier, IconPack.Divide, stringResource(R.string.keyboard_divide), KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.divide) }
+
+ KeyboardButtonAdditional(buttonModifier, IconPack.ArSin, stringResource(R.string.keyboard_arsin), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.arsinBracket) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.ArCos, stringResource(R.string.keyboard_arcos), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.arcosBracket) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.AcTan, stringResource(R.string.keyboard_actan), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.actanBracket) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key1, Token.Digit._1, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._1) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key2, Token.Digit._2, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._2) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key3, Token.Digit._3, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._3) }
+ KeyboardButtonFilled(buttonModifier, IconPack.Minus, stringResource(R.string.keyboard_minus), KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.minus) }
+ KeyboardButtonFilled(buttonModifier, IconPack.Percent, stringResource(R.string.keyboard_percent), KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.percent) }
+
+ KeyboardButtonAdditional(buttonModifier, IconPack.Euler, stringResource(R.string.keyboard_euler), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Const.e) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Ex, stringResource(R.string.keyboard_exp), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.expBracket) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Power10, stringResource(R.string.keyboard_power_10), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Digit._1 + Token.Digit._0 + Token.Operator.power) }
if (middleZero) {
- KeyboardButtonLight(buttonModifier, fractionalIcon, stringResource(fractionalIconDescription), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit.dot) }
- KeyboardButtonLight(buttonModifier, IconPack.Key0, Token.Digit._0, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._0) }
+ KeyboardButtonLight(buttonModifier, fractionalIcon, stringResource(fractionalIconDescription), KeyboardButtonContentHeightShort) { addSymbol(Token.Digit.dot) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key0, Token.Digit._0, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._0) }
} else {
- KeyboardButtonLight(buttonModifier, IconPack.Key0, Token.Digit._0, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._0) }
- KeyboardButtonLight(buttonModifier, fractionalIcon, stringResource(fractionalIconDescription), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit.dot) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key0, Token.Digit._0, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._0) }
+ KeyboardButtonLight(buttonModifier, fractionalIcon, stringResource(fractionalIconDescription), KeyboardButtonContentHeightShort) { addSymbol(Token.Digit.dot) }
}
- KeyboardButtonLight(buttonModifier, IconPack.Backspace, stringResource(R.string.delete_label), allowVibration, KeyboardButtonContentHeightShort, clearSymbols) { deleteSymbol() }
- KeyboardButtonFilled(buttonModifier, IconPack.Plus, stringResource(R.string.keyboard_plus), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.plus) }
- KeyboardButtonFilled(buttonModifier, IconPack.Equal, stringResource(R.string.keyboard_equal), allowVibration, KeyboardButtonContentHeightShort) { equal() }
+ KeyboardButtonLight(buttonModifier, IconPack.Backspace, stringResource(R.string.delete_label), KeyboardButtonContentHeightShort, clearSymbols) { deleteSymbol() }
+ KeyboardButtonFilled(buttonModifier, IconPack.Plus, stringResource(R.string.keyboard_plus), KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.plus) }
+ KeyboardButtonFilled(buttonModifier, IconPack.Equal, stringResource(R.string.keyboard_equal), KeyboardButtonContentHeightShort) { equal() }
}
} else {
KeypadFlow(
@@ -493,51 +488,51 @@ private fun LandscapeKeyboard(
.fillMaxWidth(width)
.fillMaxHeight(height)
- KeyboardButtonAdditional(buttonModifier, angleIcon, stringResource(angleIconDescription), allowVibration, KeyboardButtonContentHeightShortAdditional) { toggleAngleMode() }
- KeyboardButtonAdditional(buttonModifier, IconPack.Root, stringResource(R.string.keyboard_root), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Operator.sqrt) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Pi, stringResource(R.string.keyboard_pi), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Const.pi) }
- KeyboardButtonLight(buttonModifier, IconPack.Key7, Token.Digit._7, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._7) }
- KeyboardButtonLight(buttonModifier, IconPack.Key8, Token.Digit._8, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._8) }
- KeyboardButtonLight(buttonModifier, IconPack.Key9, Token.Digit._9, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._9) }
+ KeyboardButtonAdditional(buttonModifier, angleIcon, stringResource(angleIconDescription), KeyboardButtonContentHeightShortAdditional) { toggleAngleMode() }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Root, stringResource(R.string.keyboard_root), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Operator.sqrt) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Pi, stringResource(R.string.keyboard_pi), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Const.pi) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key7, Token.Digit._7, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._7) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key8, Token.Digit._8, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._8) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key9, Token.Digit._9, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._9) }
if (acButton) {
- KeyboardButtonTertiary(buttonModifier, IconPack.Clear, stringResource(R.string.clear_label), allowVibration, KeyboardButtonContentHeightShort) { clearSymbols() }
- KeyboardButtonFilled(buttonModifier, IconPack.Brackets, stringResource(R.string.keyboard_brackets), allowVibration, KeyboardButtonContentHeightShort) { addBracket() }
+ KeyboardButtonTertiary(buttonModifier, IconPack.Clear, stringResource(R.string.clear_label), KeyboardButtonContentHeightShort) { clearSymbols() }
+ KeyboardButtonFilled(buttonModifier, IconPack.Brackets, stringResource(R.string.keyboard_brackets), KeyboardButtonContentHeightShort) { addBracket() }
} else {
- KeyboardButtonFilled(buttonModifier, IconPack.LeftBracket, stringResource(R.string.keyboard_left_bracket), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.leftBracket) }
- KeyboardButtonFilled(buttonModifier, IconPack.RightBracket, stringResource(R.string.keyboard_right_bracket), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.rightBracket) }
+ KeyboardButtonFilled(buttonModifier, IconPack.LeftBracket, stringResource(R.string.keyboard_left_bracket), KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.leftBracket) }
+ KeyboardButtonFilled(buttonModifier, IconPack.RightBracket, stringResource(R.string.keyboard_right_bracket), KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.rightBracket) }
}
- KeyboardButtonAdditional(buttonModifier, IconPack.Inv, stringResource(R.string.keyboard_inverse), allowVibration, KeyboardButtonContentHeightShortAdditional) { toggleInvMode() }
- KeyboardButtonAdditional(buttonModifier, IconPack.Power, stringResource(R.string.keyboard_power), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Operator.power) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Factorial, stringResource(R.string.keyboard_factorial), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Operator.factorial) }
- KeyboardButtonLight(buttonModifier, IconPack.Key4, Token.Digit._4, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._4) }
- KeyboardButtonLight(buttonModifier, IconPack.Key5, Token.Digit._5, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._5) }
- KeyboardButtonLight(buttonModifier, IconPack.Key6, Token.Digit._6, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._6) }
- KeyboardButtonFilled(buttonModifier, IconPack.Multiply, stringResource(R.string.keyboard_multiply), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.multiply) }
- KeyboardButtonFilled(buttonModifier, IconPack.Divide, stringResource(R.string.keyboard_divide), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.divide) }
-
- KeyboardButtonAdditional(buttonModifier, IconPack.Sin, stringResource(R.string.keyboard_sin), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.sinBracket) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Cos, stringResource(R.string.keyboard_cos), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.cosBracket) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Tan, stringResource(R.string.keyboard_tan), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.tanBracket) }
- KeyboardButtonLight(buttonModifier, IconPack.Key1, Token.Digit._1, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._1) }
- KeyboardButtonLight(buttonModifier, IconPack.Key2, Token.Digit._2, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._2) }
- KeyboardButtonLight(buttonModifier, IconPack.Key3, Token.Digit._3, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._3) }
- KeyboardButtonFilled(buttonModifier, IconPack.Minus, stringResource(R.string.keyboard_minus), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.minus) }
- KeyboardButtonFilled(buttonModifier, IconPack.Percent, stringResource(R.string.keyboard_percent), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.percent) }
-
- KeyboardButtonAdditional(buttonModifier, IconPack.Euler, stringResource(R.string.keyboard_euler), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Const.e) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Ln, stringResource(R.string.keyboard_ln), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.lnBracket) }
- KeyboardButtonAdditional(buttonModifier, IconPack.Log, stringResource(R.string.keyboard_log), allowVibration, KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.logBracket) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Inv, stringResource(R.string.keyboard_inverse), KeyboardButtonContentHeightShortAdditional) { toggleInvMode() }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Power, stringResource(R.string.keyboard_power), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Operator.power) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Factorial, stringResource(R.string.keyboard_factorial), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Operator.factorial) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key4, Token.Digit._4, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._4) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key5, Token.Digit._5, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._5) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key6, Token.Digit._6, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._6) }
+ KeyboardButtonFilled(buttonModifier, IconPack.Multiply, stringResource(R.string.keyboard_multiply), KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.multiply) }
+ KeyboardButtonFilled(buttonModifier, IconPack.Divide, stringResource(R.string.keyboard_divide), KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.divide) }
+
+ KeyboardButtonAdditional(buttonModifier, IconPack.Sin, stringResource(R.string.keyboard_sin), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.sinBracket) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Cos, stringResource(R.string.keyboard_cos), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.cosBracket) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Tan, stringResource(R.string.keyboard_tan), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.tanBracket) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key1, Token.Digit._1, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._1) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key2, Token.Digit._2, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._2) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key3, Token.Digit._3, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._3) }
+ KeyboardButtonFilled(buttonModifier, IconPack.Minus, stringResource(R.string.keyboard_minus), KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.minus) }
+ KeyboardButtonFilled(buttonModifier, IconPack.Percent, stringResource(R.string.keyboard_percent), KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.percent) }
+
+ KeyboardButtonAdditional(buttonModifier, IconPack.Euler, stringResource(R.string.keyboard_euler), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Const.e) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Ln, stringResource(R.string.keyboard_ln), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.lnBracket) }
+ KeyboardButtonAdditional(buttonModifier, IconPack.Log, stringResource(R.string.keyboard_log), KeyboardButtonContentHeightShortAdditional) { addSymbol(Token.Func.logBracket) }
if (middleZero) {
- KeyboardButtonLight(buttonModifier, fractionalIcon, stringResource(fractionalIconDescription), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit.dot) }
- KeyboardButtonLight(buttonModifier, IconPack.Key0, Token.Digit._0, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._0) }
+ KeyboardButtonLight(buttonModifier, fractionalIcon, stringResource(fractionalIconDescription), KeyboardButtonContentHeightShort) { addSymbol(Token.Digit.dot) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key0, Token.Digit._0, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._0) }
} else {
- KeyboardButtonLight(buttonModifier, IconPack.Key0, Token.Digit._0, allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._0) }
- KeyboardButtonLight(buttonModifier, fractionalIcon, stringResource(fractionalIconDescription), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit.dot) }
+ KeyboardButtonLight(buttonModifier, IconPack.Key0, Token.Digit._0, KeyboardButtonContentHeightShort) { addSymbol(Token.Digit._0) }
+ KeyboardButtonLight(buttonModifier, fractionalIcon, stringResource(fractionalIconDescription), KeyboardButtonContentHeightShort) { addSymbol(Token.Digit.dot) }
}
- KeyboardButtonLight(buttonModifier, IconPack.Backspace, stringResource(R.string.delete_label), allowVibration, KeyboardButtonContentHeightShort, clearSymbols) { deleteSymbol() }
- KeyboardButtonFilled(buttonModifier, IconPack.Plus, stringResource(R.string.keyboard_plus), allowVibration, KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.plus) }
- KeyboardButtonFilled(buttonModifier, IconPack.Equal, stringResource(R.string.keyboard_equal), allowVibration, KeyboardButtonContentHeightShort) { equal() }
+ KeyboardButtonLight(buttonModifier, IconPack.Backspace, stringResource(R.string.delete_label), KeyboardButtonContentHeightShort, clearSymbols) { deleteSymbol() }
+ KeyboardButtonFilled(buttonModifier, IconPack.Plus, stringResource(R.string.keyboard_plus), KeyboardButtonContentHeightShort) { addSymbol(Token.Operator.plus) }
+ KeyboardButtonFilled(buttonModifier, IconPack.Equal, stringResource(R.string.keyboard_equal), KeyboardButtonContentHeightShort) { equal() }
}
}
}
@@ -555,7 +550,6 @@ private fun PreviewPortraitKeyboard() {
deleteSymbol = {},
toggleAngleMode = {},
equal = {},
- allowVibration = false,
middleZero = false,
acButton = true,
addBracket = {},
@@ -576,7 +570,6 @@ private fun PreviewLandscapeKeyboard() {
deleteSymbol = {},
toggleAngleMode = {},
equal = {},
- allowVibration = false,
middleZero = false,
acButton = true,
addBracket = {},
diff --git a/feature/converter/src/main/java/com/sadellie/unitto/feature/converter/ConverterScreen.kt b/feature/converter/src/main/java/com/sadellie/unitto/feature/converter/ConverterScreen.kt
index 83094d75..7ffbaa88 100644
--- a/feature/converter/src/main/java/com/sadellie/unitto/feature/converter/ConverterScreen.kt
+++ b/feature/converter/src/main/java/com/sadellie/unitto/feature/converter/ConverterScreen.kt
@@ -252,7 +252,6 @@ private fun NumberBase(
addDigit = processInput,
deleteDigit = deleteDigit,
clearInput = clearInput,
- allowVibration = uiState.enableHaptic,
)
}
)
@@ -425,7 +424,6 @@ private fun Default(
addDigit = processInput,
deleteDigit = deleteDigit,
clearInput = clearInput,
- allowVibration = uiState.enableHaptic,
fractional = uiState.formatterSymbols.fractional,
middleZero = uiState.middleZero,
acButton = uiState.acButton,
diff --git a/feature/converter/src/main/java/com/sadellie/unitto/feature/converter/ConverterUIState.kt b/feature/converter/src/main/java/com/sadellie/unitto/feature/converter/ConverterUIState.kt
index 7d0dcc8c..3ecee5f4 100644
--- a/feature/converter/src/main/java/com/sadellie/unitto/feature/converter/ConverterUIState.kt
+++ b/feature/converter/src/main/java/com/sadellie/unitto/feature/converter/ConverterUIState.kt
@@ -1,6 +1,6 @@
/*
* Unitto is a unit converter for Android
- * Copyright (c) 2022-2023 Elshan Agaev
+ * Copyright (c) 2022-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
@@ -44,7 +44,6 @@ internal sealed class UnitConverterUIState {
val result: ConverterResult,
val unitFrom: DefaultUnit,
val unitTo: DefaultUnit,
- val enableHaptic: Boolean,
val middleZero: Boolean,
val formatterSymbols: FormatterSymbols,
val scale: Int,
@@ -59,7 +58,6 @@ internal sealed class UnitConverterUIState {
val result: ConverterResult,
val unitFrom: NumberBaseUnit,
val unitTo: NumberBaseUnit,
- val enableHaptic: Boolean,
) : UnitConverterUIState()
}
diff --git a/feature/converter/src/main/java/com/sadellie/unitto/feature/converter/ConverterViewModel.kt b/feature/converter/src/main/java/com/sadellie/unitto/feature/converter/ConverterViewModel.kt
index e5d19d16..c65c149e 100644
--- a/feature/converter/src/main/java/com/sadellie/unitto/feature/converter/ConverterViewModel.kt
+++ b/feature/converter/src/main/java/com/sadellie/unitto/feature/converter/ConverterViewModel.kt
@@ -104,7 +104,6 @@ internal class ConverterViewModel @Inject constructor(
result = result,
unitFrom = unitFrom as DefaultUnit,
unitTo = unitTo as DefaultUnit,
- enableHaptic = prefs.enableVibrations,
middleZero = prefs.middleZero,
formatterSymbols = AllFormatterSymbols.getById(prefs.separator),
scale = prefs.precision,
@@ -120,7 +119,6 @@ internal class ConverterViewModel @Inject constructor(
result = result,
unitFrom = unitFrom as NumberBaseUnit,
unitTo = unitTo as NumberBaseUnit,
- enableHaptic = prefs.enableVibrations,
)
}
else -> UnitConverterUIState.Loading
diff --git a/feature/converter/src/main/java/com/sadellie/unitto/feature/converter/components/ConverterKeyboard.kt b/feature/converter/src/main/java/com/sadellie/unitto/feature/converter/components/ConverterKeyboard.kt
index e61a68e7..8a6add59 100644
--- a/feature/converter/src/main/java/com/sadellie/unitto/feature/converter/components/ConverterKeyboard.kt
+++ b/feature/converter/src/main/java/com/sadellie/unitto/feature/converter/components/ConverterKeyboard.kt
@@ -74,7 +74,6 @@ internal fun DefaultKeyboard(
addDigit: (String) -> Unit,
clearInput: () -> Unit,
deleteDigit: () -> Unit,
- allowVibration: Boolean,
fractional: String,
middleZero: Boolean,
acButton: Boolean,
@@ -92,39 +91,39 @@ internal fun DefaultKeyboard(
val bModifier = Modifier.fillMaxWidth(width).fillMaxHeight(height)
if (acButton) {
- KeyboardButtonTertiary(bModifier, IconPack.Clear, stringResource(R.string.delete_label), allowVibration, contentHeight) { clearInput() }
- KeyboardButtonFilled(bModifier, IconPack.Brackets, stringResource(R.string.keyboard_brackets), allowVibration, contentHeight) { addBracket() }
+ KeyboardButtonTertiary(bModifier, IconPack.Clear, stringResource(R.string.delete_label), contentHeight) { clearInput() }
+ KeyboardButtonFilled(bModifier, IconPack.Brackets, stringResource(R.string.keyboard_brackets), contentHeight) { addBracket() }
} else {
- KeyboardButtonFilled(bModifier, IconPack.LeftBracket, stringResource(R.string.keyboard_left_bracket), allowVibration, contentHeight) { addDigit(Token.Operator.leftBracket) }
- KeyboardButtonFilled(bModifier, IconPack.RightBracket, stringResource(R.string.keyboard_right_bracket), allowVibration, contentHeight) { addDigit(Token.Operator.rightBracket) }
+ KeyboardButtonFilled(bModifier, IconPack.LeftBracket, stringResource(R.string.keyboard_left_bracket), contentHeight) { addDigit(Token.Operator.leftBracket) }
+ KeyboardButtonFilled(bModifier, IconPack.RightBracket, stringResource(R.string.keyboard_right_bracket), contentHeight) { addDigit(Token.Operator.rightBracket) }
}
- KeyboardButtonFilled(bModifier, IconPack.Power, stringResource(R.string.keyboard_power), allowVibration, contentHeight) { addDigit(Token.Operator.power) }
- KeyboardButtonFilled(bModifier, IconPack.Root, stringResource(R.string.keyboard_root), allowVibration, contentHeight) { addDigit(Token.Operator.sqrt) }
+ KeyboardButtonFilled(bModifier, IconPack.Power, stringResource(R.string.keyboard_power), contentHeight) { addDigit(Token.Operator.power) }
+ KeyboardButtonFilled(bModifier, IconPack.Root, stringResource(R.string.keyboard_root), contentHeight) { addDigit(Token.Operator.sqrt) }
- KeyboardButtonLight(bModifier, IconPack.Key7, Token.Digit._7, allowVibration, contentHeight) { addDigit(Token.Digit._7) }
- KeyboardButtonLight(bModifier, IconPack.Key8, Token.Digit._8, allowVibration, contentHeight) { addDigit(Token.Digit._8) }
- KeyboardButtonLight(bModifier, IconPack.Key9, Token.Digit._9, allowVibration, contentHeight) { addDigit(Token.Digit._9) }
- KeyboardButtonFilled(bModifier, IconPack.Divide, stringResource(R.string.keyboard_divide), allowVibration, contentHeight) { addDigit(Token.Operator.divide) }
+ KeyboardButtonLight(bModifier, IconPack.Key7, Token.Digit._7, contentHeight) { addDigit(Token.Digit._7) }
+ KeyboardButtonLight(bModifier, IconPack.Key8, Token.Digit._8, contentHeight) { addDigit(Token.Digit._8) }
+ KeyboardButtonLight(bModifier, IconPack.Key9, Token.Digit._9, contentHeight) { addDigit(Token.Digit._9) }
+ KeyboardButtonFilled(bModifier, IconPack.Divide, stringResource(R.string.keyboard_divide), contentHeight) { addDigit(Token.Operator.divide) }
- KeyboardButtonLight(bModifier, IconPack.Key4, Token.Digit._4, allowVibration, contentHeight) { addDigit(Token.Digit._4) }
- KeyboardButtonLight(bModifier, IconPack.Key5, Token.Digit._5, allowVibration, contentHeight) { addDigit(Token.Digit._5) }
- KeyboardButtonLight(bModifier, IconPack.Key6, Token.Digit._6, allowVibration, contentHeight) { addDigit(Token.Digit._6) }
- KeyboardButtonFilled(bModifier, IconPack.Multiply, stringResource(R.string.keyboard_multiply), allowVibration, contentHeight) { addDigit(Token.Operator.multiply) }
+ KeyboardButtonLight(bModifier, IconPack.Key4, Token.Digit._4, contentHeight) { addDigit(Token.Digit._4) }
+ KeyboardButtonLight(bModifier, IconPack.Key5, Token.Digit._5, contentHeight) { addDigit(Token.Digit._5) }
+ KeyboardButtonLight(bModifier, IconPack.Key6, Token.Digit._6, contentHeight) { addDigit(Token.Digit._6) }
+ KeyboardButtonFilled(bModifier, IconPack.Multiply, stringResource(R.string.keyboard_multiply), contentHeight) { addDigit(Token.Operator.multiply) }
- KeyboardButtonLight(bModifier, IconPack.Key1, Token.Digit._1, allowVibration, contentHeight) { addDigit(Token.Digit._1) }
- KeyboardButtonLight(bModifier, IconPack.Key2, Token.Digit._2, allowVibration, contentHeight) { addDigit(Token.Digit._2) }
- KeyboardButtonLight(bModifier, IconPack.Key3, Token.Digit._3, allowVibration, contentHeight) { addDigit(Token.Digit._3) }
- KeyboardButtonFilled(bModifier, IconPack.Minus, stringResource(R.string.keyboard_minus), allowVibration, contentHeight) { addDigit(Token.Operator.minus) }
+ KeyboardButtonLight(bModifier, IconPack.Key1, Token.Digit._1, contentHeight) { addDigit(Token.Digit._1) }
+ KeyboardButtonLight(bModifier, IconPack.Key2, Token.Digit._2, contentHeight) { addDigit(Token.Digit._2) }
+ KeyboardButtonLight(bModifier, IconPack.Key3, Token.Digit._3, contentHeight) { addDigit(Token.Digit._3) }
+ KeyboardButtonFilled(bModifier, IconPack.Minus, stringResource(R.string.keyboard_minus), contentHeight) { addDigit(Token.Operator.minus) }
if (middleZero) {
- KeyboardButtonLight(bModifier, fractionalIcon, stringResource(fractionalIconDescription), allowVibration, contentHeight) { addDigit(Token.Digit.dot) }
- KeyboardButtonLight(bModifier, IconPack.Key0, Token.Digit._0, allowVibration, contentHeight) { addDigit(Token.Digit._0) }
+ KeyboardButtonLight(bModifier, fractionalIcon, stringResource(fractionalIconDescription), contentHeight) { addDigit(Token.Digit.dot) }
+ KeyboardButtonLight(bModifier, IconPack.Key0, Token.Digit._0, contentHeight) { addDigit(Token.Digit._0) }
} else {
- KeyboardButtonLight(bModifier, IconPack.Key0, Token.Digit._0, allowVibration, contentHeight) { addDigit(Token.Digit._0) }
- KeyboardButtonLight(bModifier, fractionalIcon, stringResource(fractionalIconDescription), allowVibration, contentHeight) { addDigit(Token.Digit.dot) }
+ KeyboardButtonLight(bModifier, IconPack.Key0, Token.Digit._0, contentHeight) { addDigit(Token.Digit._0) }
+ KeyboardButtonLight(bModifier, fractionalIcon, stringResource(fractionalIconDescription), contentHeight) { addDigit(Token.Digit.dot) }
}
- KeyboardButtonLight(bModifier, IconPack.Backspace, stringResource(R.string.delete_label), allowVibration, contentHeight, onLongClick = clearInput) { deleteDigit() }
- KeyboardButtonFilled(bModifier, IconPack.Plus, stringResource(R.string.keyboard_plus), allowVibration, contentHeight) { addDigit(Token.Operator.plus) }
+ KeyboardButtonLight(bModifier, IconPack.Backspace, stringResource(R.string.delete_label), contentHeight, onLongClick = clearInput) { deleteDigit() }
+ KeyboardButtonFilled(bModifier, IconPack.Plus, stringResource(R.string.keyboard_plus), contentHeight) { addDigit(Token.Operator.plus) }
}
}
@@ -134,7 +133,6 @@ internal fun NumberBaseKeyboard(
addDigit: (String) -> Unit,
clearInput: () -> Unit,
deleteDigit: () -> Unit,
- allowVibration: Boolean
) {
val contentHeight: Float = if (LocalWindowSize.current.heightSizeClass < WindowHeightSizeClass.Medium) KeyboardButtonContentHeightShort else KeyboardButtonContentHeightTall
@@ -146,29 +144,29 @@ internal fun NumberBaseKeyboard(
val bModifier = Modifier.fillMaxWidth(width).fillMaxHeight(height)
val wideButtonModifier = Modifier.fillMaxHeight(height).fillMaxWidth(width * 2)
- KeyboardButtonFilled(bModifier, IconPack.KeyA, Token.Letter._A, allowVibration, contentHeight) { addDigit(Token.Letter._A) }
- KeyboardButtonFilled(bModifier, IconPack.KeyB, Token.Letter._B, allowVibration, contentHeight) { addDigit(Token.Letter._B) }
- KeyboardButtonFilled(bModifier, IconPack.KeyC, Token.Letter._C, allowVibration, contentHeight) { addDigit(Token.Letter._C) }
+ KeyboardButtonFilled(bModifier, IconPack.KeyA, Token.Letter._A, contentHeight) { addDigit(Token.Letter._A) }
+ KeyboardButtonFilled(bModifier, IconPack.KeyB, Token.Letter._B, contentHeight) { addDigit(Token.Letter._B) }
+ KeyboardButtonFilled(bModifier, IconPack.KeyC, Token.Letter._C, contentHeight) { addDigit(Token.Letter._C) }
- KeyboardButtonFilled(bModifier, IconPack.KeyD, Token.Letter._D, allowVibration, contentHeight) { addDigit(Token.Letter._D) }
- KeyboardButtonFilled(bModifier, IconPack.KeyE, Token.Letter._E, allowVibration, contentHeight) { addDigit(Token.Letter._E) }
- KeyboardButtonFilled(bModifier, IconPack.KeyF, Token.Letter._F, allowVibration, contentHeight) { addDigit(Token.Letter._F) }
+ KeyboardButtonFilled(bModifier, IconPack.KeyD, Token.Letter._D, contentHeight) { addDigit(Token.Letter._D) }
+ KeyboardButtonFilled(bModifier, IconPack.KeyE, Token.Letter._E, contentHeight) { addDigit(Token.Letter._E) }
+ KeyboardButtonFilled(bModifier, IconPack.KeyF, Token.Letter._F, contentHeight) { addDigit(Token.Letter._F) }
- KeyboardButtonLight(bModifier, IconPack.Key7, Token.Digit._7, allowVibration, contentHeight) { addDigit(Token.Digit._7) }
- KeyboardButtonLight(bModifier, IconPack.Key8, Token.Digit._8, allowVibration, contentHeight) { addDigit(Token.Digit._8) }
- KeyboardButtonLight(bModifier, IconPack.Key9, Token.Digit._9, allowVibration, contentHeight) { addDigit(Token.Digit._9) }
+ KeyboardButtonLight(bModifier, IconPack.Key7, Token.Digit._7, contentHeight) { addDigit(Token.Digit._7) }
+ KeyboardButtonLight(bModifier, IconPack.Key8, Token.Digit._8, contentHeight) { addDigit(Token.Digit._8) }
+ KeyboardButtonLight(bModifier, IconPack.Key9, Token.Digit._9, contentHeight) { addDigit(Token.Digit._9) }
- KeyboardButtonLight(bModifier, IconPack.Key4, Token.Digit._4, allowVibration, contentHeight) { addDigit(Token.Digit._4) }
- KeyboardButtonLight(bModifier, IconPack.Key5, Token.Digit._5, allowVibration, contentHeight) { addDigit(Token.Digit._5) }
- KeyboardButtonLight(bModifier, IconPack.Key6, Token.Digit._6, allowVibration, contentHeight) { addDigit(Token.Digit._6) }
+ KeyboardButtonLight(bModifier, IconPack.Key4, Token.Digit._4, contentHeight) { addDigit(Token.Digit._4) }
+ KeyboardButtonLight(bModifier, IconPack.Key5, Token.Digit._5, contentHeight) { addDigit(Token.Digit._5) }
+ KeyboardButtonLight(bModifier, IconPack.Key6, Token.Digit._6, contentHeight) { addDigit(Token.Digit._6) }
- KeyboardButtonLight(bModifier, IconPack.Key1, Token.Digit._1, allowVibration, contentHeight) { addDigit(Token.Digit._1) }
- KeyboardButtonLight(bModifier, IconPack.Key2, Token.Digit._2, allowVibration, contentHeight) { addDigit(Token.Digit._2) }
- KeyboardButtonLight(bModifier, IconPack.Key3, Token.Digit._3, allowVibration, contentHeight) { addDigit(Token.Digit._3) }
+ KeyboardButtonLight(bModifier, IconPack.Key1, Token.Digit._1, contentHeight) { addDigit(Token.Digit._1) }
+ KeyboardButtonLight(bModifier, IconPack.Key2, Token.Digit._2, contentHeight) { addDigit(Token.Digit._2) }
+ KeyboardButtonLight(bModifier, IconPack.Key3, Token.Digit._3, contentHeight) { addDigit(Token.Digit._3) }
// TODO Should be a separate o use custom widthFillFactors and heightFillFactors
- KeyboardButtonLight(bModifier, IconPack.Key0, Token.Digit._0, allowVibration, contentHeight) { addDigit(Token.Digit._0) }
- KeyboardButtonLight(wideButtonModifier, IconPack.Backspace, stringResource(R.string.delete_label), allowVibration, contentHeight, clearInput) { deleteDigit() }
+ KeyboardButtonLight(bModifier, IconPack.Key0, Token.Digit._0, contentHeight) { addDigit(Token.Digit._0) }
+ KeyboardButtonLight(wideButtonModifier, IconPack.Backspace, stringResource(R.string.delete_label), contentHeight, clearInput) { deleteDigit() }
}
}
@@ -180,7 +178,6 @@ private fun PreviewConverterKeyboard() {
addDigit = {},
clearInput = {},
deleteDigit = {},
- allowVibration = false,
fractional = FormatterSymbols.Spaces.fractional,
middleZero = false,
acButton = true,
@@ -196,6 +193,5 @@ private fun PreviewConverterKeyboardNumberBase() {
addDigit = {},
clearInput = {},
deleteDigit = {},
- allowVibration = false,
)
}
diff --git a/feature/datecalculator/src/main/java/com/sadellie/unitto/feature/datecalculator/addsubtract/AddSubtractViewModel.kt b/feature/datecalculator/src/main/java/com/sadellie/unitto/feature/datecalculator/addsubtract/AddSubtractViewModel.kt
index 6d4bd512..aadf0262 100644
--- a/feature/datecalculator/src/main/java/com/sadellie/unitto/feature/datecalculator/addsubtract/AddSubtractViewModel.kt
+++ b/feature/datecalculator/src/main/java/com/sadellie/unitto/feature/datecalculator/addsubtract/AddSubtractViewModel.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
@@ -47,7 +47,6 @@ internal class AddSubtractViewModel @Inject constructor(
.combine(userPreferencesRepository.addSubtractPrefs) { uiState, userPrefs ->
return@combine uiState.copy(
formatterSymbols = AllFormatterSymbols.getById(userPrefs.separator),
- allowVibration = userPrefs.enableVibrations,
)
}
.onEach { updateResult() }