diff --git a/feature/unitslist/src/main/java/com/sadellie/unitto/feature/unitslist/SecondScreen.kt b/feature/unitslist/src/main/java/com/sadellie/unitto/feature/unitslist/SecondScreen.kt index f342875d..5eb1874b 100644 --- a/feature/unitslist/src/main/java/com/sadellie/unitto/feature/unitslist/SecondScreen.kt +++ b/feature/unitslist/src/main/java/com/sadellie/unitto/feature/unitslist/SecondScreen.kt @@ -24,7 +24,6 @@ import androidx.compose.animation.core.LinearOutSlowInEasing import androidx.compose.animation.core.tween import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn @@ -47,13 +46,13 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.sadellie.unitto.core.ui.Formatter -import com.sadellie.unitto.core.ui.common.Header import com.sadellie.unitto.data.units.AbstractUnit import com.sadellie.unitto.data.units.NumberBaseUnit import com.sadellie.unitto.data.units.UnitGroup import com.sadellie.unitto.feature.unitslist.components.ChipsRow import com.sadellie.unitto.feature.unitslist.components.SearchBar import com.sadellie.unitto.feature.unitslist.components.SearchPlaceholder +import com.sadellie.unitto.feature.unitslist.components.UnitGroupHeader import com.sadellie.unitto.feature.unitslist.components.UnitListItem import java.math.BigDecimal @@ -262,12 +261,3 @@ internal fun convertForSecondaryNumberBase(inputValue: String, unitFrom: NumberB "" } } - -@Composable -private fun UnitGroupHeader(modifier: Modifier, unitGroup: UnitGroup) { - Header( - text = stringResource(unitGroup.res), - modifier = modifier, - paddingValues = PaddingValues(start = 16.dp, end = 16.dp, top = 8.dp, bottom = 12.dp) - ) -} diff --git a/feature/unitslist/src/main/java/com/sadellie/unitto/feature/unitslist/components/UnitGroupHeader.kt b/feature/unitslist/src/main/java/com/sadellie/unitto/feature/unitslist/components/UnitGroupHeader.kt new file mode 100644 index 00000000..f142f193 --- /dev/null +++ b/feature/unitslist/src/main/java/com/sadellie/unitto/feature/unitslist/components/UnitGroupHeader.kt @@ -0,0 +1,36 @@ +/* + * Unitto is a unit converter for Android + * Copyright (c) 2023 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.feature.unitslist.components + +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import com.sadellie.unitto.core.ui.common.Header +import com.sadellie.unitto.data.units.UnitGroup + +@Composable +fun UnitGroupHeader(modifier: Modifier, unitGroup: UnitGroup) { + Header( + text = stringResource(unitGroup.res), + modifier = modifier, + paddingValues = PaddingValues(start = 16.dp, end = 16.dp, top = 8.dp, bottom = 12.dp) + ) +}