mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-06-19 00:35:26 +02:00
One style for group headers
This commit is contained in:
parent
3c28016836
commit
5e82e3f9c5
@ -16,7 +16,7 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.sadellie.unitto.screens.second.components
|
package com.sadellie.unitto.screens.common
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
@ -28,20 +28,23 @@ import androidx.compose.ui.Modifier
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit group header.
|
* Basic list header.
|
||||||
*
|
*
|
||||||
* @param text Unit group name.
|
* @param text Group label.
|
||||||
* @param modifier Modifier that will be applied to Text composable.
|
* @param modifier Modifier that will be applied to Text composable.
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun Header(text: String, modifier: Modifier = Modifier) {
|
fun Header(
|
||||||
|
text: String,
|
||||||
|
modifier: Modifier = Modifier
|
||||||
|
) {
|
||||||
Text(
|
Text(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.background(MaterialTheme.colorScheme.background)
|
.background(MaterialTheme.colorScheme.background)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(vertical = 12.dp, horizontal = 8.dp),
|
.padding(start = 16.dp, end = 16.dp, top = 24.dp, bottom = 12.dp),
|
||||||
text = text,
|
text = text,
|
||||||
style = MaterialTheme.typography.titleMedium,
|
style = MaterialTheme.typography.titleSmall,
|
||||||
color = MaterialTheme.colorScheme.primary
|
color = MaterialTheme.colorScheme.primary
|
||||||
)
|
)
|
||||||
}
|
}
|
@ -33,12 +33,11 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
|
|||||||
import androidx.compose.ui.platform.LocalFocusManager
|
import androidx.compose.ui.platform.LocalFocusManager
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import com.sadellie.unitto.R
|
import com.sadellie.unitto.R
|
||||||
import com.sadellie.unitto.data.units.ALL_UNIT_GROUPS
|
|
||||||
import com.sadellie.unitto.data.units.AbstractUnit
|
import com.sadellie.unitto.data.units.AbstractUnit
|
||||||
import com.sadellie.unitto.data.units.UnitGroup
|
import com.sadellie.unitto.data.units.UnitGroup
|
||||||
import com.sadellie.unitto.screens.Formatter
|
import com.sadellie.unitto.screens.Formatter
|
||||||
import com.sadellie.unitto.screens.second.components.ChipsRow
|
import com.sadellie.unitto.screens.second.components.ChipsRow
|
||||||
import com.sadellie.unitto.screens.second.components.Header
|
import com.sadellie.unitto.screens.common.Header
|
||||||
import com.sadellie.unitto.screens.second.components.SearchBar
|
import com.sadellie.unitto.screens.second.components.SearchBar
|
||||||
import com.sadellie.unitto.screens.second.components.SearchPlaceholder
|
import com.sadellie.unitto.screens.second.components.SearchPlaceholder
|
||||||
import com.sadellie.unitto.screens.second.components.UnitListItem
|
import com.sadellie.unitto.screens.second.components.UnitListItem
|
||||||
|
@ -34,10 +34,10 @@ import com.sadellie.unitto.data.NavRoutes.UNIT_GROUPS_SCREEN
|
|||||||
import com.sadellie.unitto.data.preferences.OUTPUT_FORMAT
|
import com.sadellie.unitto.data.preferences.OUTPUT_FORMAT
|
||||||
import com.sadellie.unitto.data.preferences.PRECISIONS
|
import com.sadellie.unitto.data.preferences.PRECISIONS
|
||||||
import com.sadellie.unitto.data.preferences.SEPARATORS
|
import com.sadellie.unitto.data.preferences.SEPARATORS
|
||||||
|
import com.sadellie.unitto.screens.common.Header
|
||||||
import com.sadellie.unitto.screens.common.UnittoLargeTopAppBar
|
import com.sadellie.unitto.screens.common.UnittoLargeTopAppBar
|
||||||
import com.sadellie.unitto.screens.openLink
|
import com.sadellie.unitto.screens.openLink
|
||||||
import com.sadellie.unitto.screens.setttings.components.AlertDialogWithList
|
import com.sadellie.unitto.screens.setttings.components.AlertDialogWithList
|
||||||
import com.sadellie.unitto.screens.setttings.components.SettingsHeader
|
|
||||||
import com.sadellie.unitto.screens.setttings.components.SettingsListItem
|
import com.sadellie.unitto.screens.setttings.components.SettingsListItem
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@ -58,7 +58,7 @@ fun SettingsScreen(
|
|||||||
LazyColumn(contentPadding = padding) {
|
LazyColumn(contentPadding = padding) {
|
||||||
|
|
||||||
// GENERAL GROUP
|
// GENERAL GROUP
|
||||||
item { SettingsHeader(stringResource(R.string.general_settings_group)) }
|
item { Header(stringResource(R.string.general_settings_group)) }
|
||||||
|
|
||||||
// THEME
|
// THEME
|
||||||
item {
|
item {
|
||||||
@ -109,7 +109,7 @@ fun SettingsScreen(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ADDITIONAL GROUP
|
// ADDITIONAL GROUP
|
||||||
item { SettingsHeader(stringResource(R.string.additional_settings_group)) }
|
item { Header(stringResource(R.string.additional_settings_group)) }
|
||||||
|
|
||||||
// TERMS AND CONDITIONS
|
// TERMS AND CONDITIONS
|
||||||
item {
|
item {
|
||||||
|
@ -43,7 +43,7 @@ import androidx.compose.ui.res.stringResource
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.sadellie.unitto.R
|
import com.sadellie.unitto.R
|
||||||
import com.sadellie.unitto.screens.common.UnittoLargeTopAppBar
|
import com.sadellie.unitto.screens.common.UnittoLargeTopAppBar
|
||||||
import com.sadellie.unitto.screens.second.components.Header
|
import com.sadellie.unitto.screens.common.Header
|
||||||
import com.sadellie.unitto.screens.setttings.components.SettingsListItem
|
import com.sadellie.unitto.screens.setttings.components.SettingsListItem
|
||||||
import org.burnoutcrew.reorderable.ReorderableItem
|
import org.burnoutcrew.reorderable.ReorderableItem
|
||||||
import org.burnoutcrew.reorderable.detectReorder
|
import org.burnoutcrew.reorderable.detectReorder
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
/*
|
|
||||||
* Unitto is a unit converter for Android
|
|
||||||
* Copyright (c) 2022 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 <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.sadellie.unitto.screens.setttings.components
|
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
|
||||||
import androidx.compose.foundation.layout.padding
|
|
||||||
import androidx.compose.material3.MaterialTheme
|
|
||||||
import androidx.compose.material3.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.unit.dp
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun SettingsHeader(text: String) =
|
|
||||||
Text(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(start = 16.dp, end = 16.dp, top = 24.dp, bottom = 12.dp),
|
|
||||||
text = text,
|
|
||||||
style = MaterialTheme.typography.titleSmall,
|
|
||||||
color = MaterialTheme.colorScheme.primary
|
|
||||||
)
|
|
Loading…
x
Reference in New Issue
Block a user