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