mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-06-19 00:35:26 +02:00
Fixed typos
This commit is contained in:
parent
66227f4ed7
commit
c50f221572
@ -124,7 +124,7 @@ fun UnittoApp(
|
||||
viewModel = secondViewModel,
|
||||
currentUnit = mainViewModel.unitFrom,
|
||||
navigateUp = { navController.navigateUp() },
|
||||
navigateToSettingsActtion = { navController.navigate(UNIT_GROUPS_SCREEN) },
|
||||
navigateToSettingsAction = { navController.navigate(UNIT_GROUPS_SCREEN) },
|
||||
selectAction = { mainViewModel.changeUnitFrom(it) }
|
||||
)
|
||||
}
|
||||
@ -134,7 +134,7 @@ fun UnittoApp(
|
||||
viewModel = secondViewModel,
|
||||
currentUnit = mainViewModel.unitTo,
|
||||
navigateUp = { navController.navigateUp() },
|
||||
navigateToSettingsActtion = { navController.navigate(UNIT_GROUPS_SCREEN) },
|
||||
navigateToSettingsAction = { navController.navigate(UNIT_GROUPS_SCREEN) },
|
||||
selectAction = { mainViewModel.changeUnitTo(it) },
|
||||
inputValue = mainViewModel.mainFlow.value.inputValue.toBigDecimal(),
|
||||
unitFrom = mainViewModel.unitFrom
|
||||
|
@ -18,8 +18,6 @@
|
||||
|
||||
package com.sadellie.unitto.data.preferences
|
||||
|
||||
import android.text.TextUtils.split
|
||||
import android.util.Log
|
||||
import androidx.datastore.core.DataStore
|
||||
import androidx.datastore.preferences.core.Preferences
|
||||
import androidx.datastore.preferences.core.booleanPreferencesKey
|
||||
|
@ -154,7 +154,7 @@ class AllUnitsRepository @Inject constructor() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Update [AbstractUnit.basicUnit] properties for currncies from [currencyCollection].
|
||||
* Update [AbstractUnit.basicUnit] properties for currencies from [currencyCollection].
|
||||
*
|
||||
* @param conversions Map: [AbstractUnit.unitId] and [BigDecimal] that will replace current
|
||||
* [AbstractUnit.basicUnit].
|
||||
|
@ -63,7 +63,7 @@ import java.math.BigDecimal
|
||||
* @param viewModel [SecondViewModel].
|
||||
* @param currentUnit Currently selected [AbstractUnit].
|
||||
* @param navigateUp Action to navigate up. Called when user click back button.
|
||||
* @param navigateToSettingsActtion Action to perform when clicking settings chip at the end.
|
||||
* @param navigateToSettingsAction Action to perform when clicking settings chip at the end.
|
||||
* @param selectAction Action to perform when user clicks on [UnitListItem].
|
||||
*/
|
||||
@Composable
|
||||
@ -71,7 +71,7 @@ fun LeftSideScreen(
|
||||
viewModel: SecondViewModel,
|
||||
currentUnit: AbstractUnit,
|
||||
navigateUp: () -> Unit,
|
||||
navigateToSettingsActtion: () -> Unit,
|
||||
navigateToSettingsAction: () -> Unit,
|
||||
selectAction: (AbstractUnit) -> Unit
|
||||
) {
|
||||
val uiState = viewModel.mainFlow.collectAsStateWithLifecycle()
|
||||
@ -119,7 +119,7 @@ fun LeftSideScreen(
|
||||
viewModel.loadUnitsToShow(true)
|
||||
},
|
||||
lazyListState = chipsRowLazyListState,
|
||||
navigateToSettingsActtion = navigateToSettingsActtion
|
||||
navigateToSettingsAction = navigateToSettingsAction
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -129,7 +129,7 @@ fun LeftSideScreen(
|
||||
modifier = Modifier.padding(paddingValues)
|
||||
) { noUnits ->
|
||||
if (noUnits) {
|
||||
SearchPlaceholder(navigateToSettingsActtion = navigateToSettingsActtion)
|
||||
SearchPlaceholder(navigateToSettingsAction = navigateToSettingsAction)
|
||||
} else {
|
||||
LazyColumn(Modifier.fillMaxSize()) {
|
||||
uiState.value.unitsToShow.forEach { (unitGroup, listOfUnits) ->
|
||||
@ -177,7 +177,7 @@ fun LeftSideScreen(
|
||||
* @param viewModel [SecondViewModel].
|
||||
* @param currentUnit Currently selected [AbstractUnit].
|
||||
* @param navigateUp Action to navigate up. Called when user click back button.
|
||||
* @param navigateToSettingsActtion Action to perform when clicking settings chip at the end.
|
||||
* @param navigateToSettingsAction Action to perform when clicking settings chip at the end.
|
||||
* @param selectAction Action to perform when user clicks on [UnitListItem].
|
||||
* @param inputValue Current input value (upper text field on MainScreen)
|
||||
* @param unitFrom Unit we are converting from. Need it for conversion.
|
||||
@ -187,7 +187,7 @@ fun RightSideScreen(
|
||||
viewModel: SecondViewModel,
|
||||
currentUnit: AbstractUnit,
|
||||
navigateUp: () -> Unit,
|
||||
navigateToSettingsActtion: () -> Unit,
|
||||
navigateToSettingsAction: () -> Unit,
|
||||
selectAction: (AbstractUnit) -> Unit,
|
||||
inputValue: BigDecimal,
|
||||
unitFrom: AbstractUnit
|
||||
@ -222,7 +222,7 @@ fun RightSideScreen(
|
||||
modifier = Modifier.padding(paddingValues)
|
||||
) { noUnits ->
|
||||
if (noUnits) {
|
||||
SearchPlaceholder(navigateToSettingsActtion = navigateToSettingsActtion)
|
||||
SearchPlaceholder(navigateToSettingsAction = navigateToSettingsAction)
|
||||
} else {
|
||||
LazyColumn(Modifier.fillMaxSize()) {
|
||||
uiState.value.unitsToShow.forEach { (unitGroup, listOfUnits) ->
|
||||
|
@ -56,7 +56,7 @@ import com.sadellie.unitto.data.units.UnitGroup
|
||||
* @param items All [UnitGroup]s
|
||||
* @param chosenUnitGroup Currently selected [UnitGroup]
|
||||
* @param selectAction Action to perform when a chip is clicked
|
||||
* @param navigateToSettingsActtion Action to perform when clicking settings chip at the end
|
||||
* @param navigateToSettingsAction Action to perform when clicking settings chip at the end
|
||||
* @param lazyListState Used for animated scroll when entering unit selection screen
|
||||
*/
|
||||
@Composable
|
||||
@ -64,7 +64,7 @@ fun ChipsRow(
|
||||
items: List<UnitGroup> = ALL_UNIT_GROUPS,
|
||||
chosenUnitGroup: UnitGroup?,
|
||||
selectAction: (UnitGroup) -> Unit,
|
||||
navigateToSettingsActtion: () -> Unit,
|
||||
navigateToSettingsAction: () -> Unit,
|
||||
lazyListState: LazyListState
|
||||
) {
|
||||
LazyRow(
|
||||
@ -105,7 +105,7 @@ fun ChipsRow(
|
||||
item("settings") {
|
||||
UnittoFilterChip(
|
||||
isSelected = false,
|
||||
selectAction = navigateToSettingsActtion,
|
||||
selectAction = navigateToSettingsAction,
|
||||
paddingValues = PaddingValues(horizontal = 8.dp)
|
||||
) {
|
||||
Icon(
|
||||
|
@ -40,10 +40,10 @@ import com.sadellie.unitto.R
|
||||
/**
|
||||
* Placeholder that can be seen when there are no units found
|
||||
*
|
||||
* @param navigateToSettingsActtion Action to perform when clicking open settings button.
|
||||
* @param navigateToSettingsAction Action to perform when clicking open settings button.
|
||||
*/
|
||||
@Composable
|
||||
fun SearchPlaceholder(navigateToSettingsActtion: () -> Unit) {
|
||||
fun SearchPlaceholder(navigateToSettingsAction: () -> Unit) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
@ -70,7 +70,7 @@ fun SearchPlaceholder(navigateToSettingsActtion: () -> Unit) {
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
)
|
||||
// Open settings button
|
||||
ElevatedButton(onClick = navigateToSettingsActtion) {
|
||||
ElevatedButton(onClick = navigateToSettingsAction) {
|
||||
Text(text = stringResource(R.string.search_placeholder_button_label))
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user