mirror of
https://github.com/openflocon/Flocon.git
synced 2026-05-06 05:18:41 +00:00
fix: Use FloconSurface (#60)
* fix: Use FloconSurface * fix: Discussion --------- Co-authored-by: TEYSSANDIER Raphael <rteyssandier@sephora.fr>
This commit is contained in:
parent
84391942ff
commit
46da1787cb
11 changed files with 24 additions and 25 deletions
|
|
@ -13,7 +13,6 @@ import androidx.compose.foundation.layout.padding
|
|||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.itemsIndexed
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
|
|
@ -34,6 +33,7 @@ import io.github.openflocon.flocondesktop.features.analytics.ui.model.items
|
|||
import io.github.openflocon.flocondesktop.features.analytics.ui.model.previewAnalyticsContentStateUiModel
|
||||
import io.github.openflocon.flocondesktop.features.analytics.ui.model.previewAnalyticsStateUiModel
|
||||
import io.github.openflocon.library.designsystem.FloconTheme
|
||||
import io.github.openflocon.library.designsystem.components.FloconSurface
|
||||
import org.jetbrains.compose.ui.tooling.preview.Preview
|
||||
import org.koin.compose.viewmodel.koinViewModel
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ fun AnalyticsScreen(
|
|||
) {
|
||||
var analyticsItems by remember { mutableStateOf<List<AnalyticsRowUiModel>>(emptyList()) }
|
||||
|
||||
Surface(modifier = modifier) {
|
||||
FloconSurface(modifier = modifier) {
|
||||
Box(modifier = Modifier.fillMaxSize()) {
|
||||
Column(modifier = Modifier.fillMaxSize()) {
|
||||
Column(
|
||||
|
|
@ -103,7 +103,7 @@ fun AnalyticsScreen(
|
|||
)
|
||||
}
|
||||
|
||||
Surface(
|
||||
FloconSurface(
|
||||
modifier = Modifier.fillMaxSize()
|
||||
.clickable(
|
||||
interactionSource = null,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import androidx.compose.foundation.layout.Column
|
|||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
|
|
@ -18,6 +17,7 @@ import io.github.openflocon.flocondesktop.features.dashboard.ui.model.DashboardV
|
|||
import io.github.openflocon.flocondesktop.features.dashboard.ui.model.DashboardsStateUiModel
|
||||
import io.github.openflocon.flocondesktop.features.dashboard.ui.model.DeviceDashboardUiModel
|
||||
import io.github.openflocon.library.designsystem.FloconTheme
|
||||
import io.github.openflocon.library.designsystem.components.FloconSurface
|
||||
import org.koin.compose.viewmodel.koinViewModel
|
||||
|
||||
@Composable
|
||||
|
|
@ -53,7 +53,7 @@ fun DashboardScreen(
|
|||
onUpdateCheckBox: (checkBoxId: String, value: Boolean) -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Surface(modifier = modifier) {
|
||||
FloconSurface(modifier = modifier) {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import androidx.compose.foundation.layout.Column
|
|||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
|
|
@ -24,6 +23,7 @@ import io.github.openflocon.flocondesktop.features.database.ui.model.DeviceDataB
|
|||
import io.github.openflocon.flocondesktop.features.database.ui.model.previewDatabaseScreenStateQueries
|
||||
import io.github.openflocon.flocondesktop.features.database.ui.model.previewDatabasesStateUiModel
|
||||
import io.github.openflocon.library.designsystem.FloconTheme
|
||||
import io.github.openflocon.library.designsystem.components.FloconSurface
|
||||
import org.jetbrains.compose.ui.tooling.preview.Preview
|
||||
import org.koin.compose.viewmodel.koinViewModel
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ fun DatabaseScreen(
|
|||
) {
|
||||
var query by remember { mutableStateOf("") }
|
||||
|
||||
Surface(modifier = modifier) {
|
||||
FloconSurface(modifier = modifier) {
|
||||
Column(modifier = Modifier.fillMaxSize()) {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
|
|
@ -22,6 +20,7 @@ import io.github.openflocon.flocondesktop.features.deeplinks.ui.model.DeeplinkPa
|
|||
import io.github.openflocon.flocondesktop.features.deeplinks.ui.model.DeeplinkViewState
|
||||
import io.github.openflocon.flocondesktop.features.deeplinks.ui.model.previewDeeplinkViewState
|
||||
import io.github.openflocon.library.designsystem.FloconTheme
|
||||
import io.github.openflocon.library.designsystem.components.FloconSurface
|
||||
import org.jetbrains.compose.ui.tooling.preview.Preview
|
||||
import org.koin.compose.viewmodel.koinViewModel
|
||||
|
||||
|
|
@ -43,7 +42,7 @@ private fun DeeplinkScreen(
|
|||
submit: (DeeplinkViewState, values: Map<DeeplinkPart.TextField, String>) -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Surface(modifier = modifier) {
|
||||
FloconSurface(modifier = modifier) {
|
||||
Column(modifier = Modifier.fillMaxSize()) {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.itemsIndexed
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
|
|
@ -19,6 +18,7 @@ import io.github.openflocon.flocondesktop.features.files.ui.model.FileUiModel
|
|||
import io.github.openflocon.flocondesktop.features.files.ui.model.FilesStateUiModel
|
||||
import io.github.openflocon.flocondesktop.features.files.ui.model.previewFilesStateUiModel
|
||||
import io.github.openflocon.library.designsystem.FloconTheme
|
||||
import io.github.openflocon.library.designsystem.components.FloconSurface
|
||||
import org.jetbrains.compose.ui.tooling.preview.Preview
|
||||
import org.koin.compose.viewmodel.koinViewModel
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ private fun FilesScreen(
|
|||
onContextualAction: (FileUiModel, FileUiModel.ContextualAction.Action) -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Surface(modifier = modifier) {
|
||||
FloconSurface(modifier = modifier) {
|
||||
Column(modifier = Modifier.fillMaxSize()) {
|
||||
FilesTopBar(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import androidx.compose.foundation.lazy.grid.items
|
|||
import androidx.compose.foundation.text.selection.SelectionContainer
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.outlined.Delete
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
|
|
@ -37,6 +36,7 @@ import io.github.openflocon.flocondesktop.features.images.ui.model.ImagesUiModel
|
|||
import io.github.openflocon.flocondesktop.features.images.ui.model.previewImagesStateUiModel
|
||||
import io.github.openflocon.library.designsystem.FloconTheme
|
||||
import io.github.openflocon.library.designsystem.components.FloconIconButton
|
||||
import io.github.openflocon.library.designsystem.components.FloconSurface
|
||||
import org.jetbrains.compose.ui.tooling.preview.Preview
|
||||
import org.koin.compose.viewmodel.koinViewModel
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ private fun ImagesScreen(
|
|||
clickedImage: ImagesUiModel?,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Surface(modifier = modifier) {
|
||||
FloconSurface(modifier = modifier) {
|
||||
Column(modifier = Modifier.fillMaxSize()) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import androidx.compose.foundation.layout.padding
|
|||
import androidx.compose.foundation.layout.requiredWidth
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
|
|
@ -33,6 +32,7 @@ import io.github.openflocon.flocondesktop.features.network.ui.previewNetworkUiSt
|
|||
import io.github.openflocon.flocondesktop.features.network.ui.view.components.NetworkItemHeaderView
|
||||
import io.github.openflocon.flocondesktop.features.network.ui.view.header.NetworkFilter
|
||||
import io.github.openflocon.library.designsystem.FloconTheme
|
||||
import io.github.openflocon.library.designsystem.components.FloconSurface
|
||||
import org.jetbrains.compose.ui.tooling.preview.Preview
|
||||
import org.koin.compose.viewmodel.koinViewModel
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ fun NetworkScreen(
|
|||
val columnWidths: NetworkItemColumnWidths =
|
||||
remember { NetworkItemColumnWidths() } // Default widths provided
|
||||
|
||||
Surface(modifier = modifier) {
|
||||
FloconSurface(modifier = modifier) {
|
||||
Box(modifier = Modifier.fillMaxSize()) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import androidx.compose.foundation.layout.padding
|
|||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.foundation.text.selection.SelectionContainer
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
|
|
@ -26,6 +25,7 @@ import io.github.openflocon.flocondesktop.features.sharedpreferences.ui.model.Sh
|
|||
import io.github.openflocon.flocondesktop.features.sharedpreferences.ui.model.previewSharedPreferencesRowsStateUiModel
|
||||
import io.github.openflocon.flocondesktop.features.sharedpreferences.ui.model.previewSharedPrefsStateUiModel
|
||||
import io.github.openflocon.library.designsystem.FloconTheme
|
||||
import io.github.openflocon.library.designsystem.components.FloconSurface
|
||||
import org.jetbrains.compose.ui.tooling.preview.Preview
|
||||
import org.koin.compose.viewmodel.koinViewModel
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ fun SharedPrefScreen(
|
|||
rows: SharedPreferencesRowsStateUiModel,
|
||||
changeValue: (SharedPreferencesRowUiModel, String) -> Unit,
|
||||
) {
|
||||
Surface(modifier = modifier) {
|
||||
FloconSurface(modifier = modifier) {
|
||||
Column(modifier = Modifier.fillMaxSize()) {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import androidx.compose.foundation.rememberScrollState
|
|||
import androidx.compose.foundation.text.selection.SelectionContainer
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
|
|
@ -41,6 +40,7 @@ import io.github.openflocon.flocondesktop.features.table.ui.model.items
|
|||
import io.github.openflocon.flocondesktop.features.table.ui.model.previewTableContentStateUiModel
|
||||
import io.github.openflocon.flocondesktop.features.table.ui.model.previewTablesStateUiModel
|
||||
import io.github.openflocon.library.designsystem.FloconTheme
|
||||
import io.github.openflocon.library.designsystem.components.FloconSurface
|
||||
import org.jetbrains.compose.ui.tooling.preview.Preview
|
||||
import org.koin.compose.viewmodel.koinViewModel
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ fun TableScreen(
|
|||
val columnsWidth = 150.dp
|
||||
var tableItems by remember { mutableStateOf<List<TableRowUiModel>>(emptyList()) }
|
||||
|
||||
Surface(modifier = modifier) {
|
||||
FloconSurface(modifier = modifier) {
|
||||
Box(modifier = Modifier.fillMaxSize()) {
|
||||
Column(modifier = Modifier.fillMaxSize()) {
|
||||
Column(
|
||||
|
|
@ -111,7 +111,7 @@ fun TableScreen(
|
|||
)
|
||||
}
|
||||
|
||||
Surface(
|
||||
FloconSurface(
|
||||
modifier = Modifier.fillMaxSize()
|
||||
.clickable(
|
||||
interactionSource = null,
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.text.BasicTextField
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.collectAsState
|
||||
|
|
@ -28,6 +27,7 @@ import androidx.compose.ui.graphics.SolidColor
|
|||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import io.github.openflocon.library.designsystem.FloconTheme
|
||||
import io.github.openflocon.library.designsystem.components.FloconSurface
|
||||
import org.jetbrains.compose.ui.tooling.preview.Preview
|
||||
import org.koin.compose.viewmodel.koinViewModel
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ private fun SettingsScreen(
|
|||
needsAdbSetup: Boolean,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Surface(modifier = modifier) {
|
||||
FloconSurface(modifier = modifier) {
|
||||
Column(modifier = Modifier.fillMaxSize()) {
|
||||
Box(
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
|
|
|
|||
|
|
@ -3,16 +3,16 @@ package io.github.openflocon.library.designsystem.components
|
|||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import io.github.openflocon.library.designsystem.FloconTheme
|
||||
import io.github.openflocon.library.designsystem.theme.contentColorFor
|
||||
|
||||
@Composable
|
||||
fun FloconSurface(
|
||||
modifier: Modifier = Modifier,
|
||||
color: Color = FloconTheme.colorPalette.surface,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
val color = FloconTheme.colorPalette.surface
|
||||
|
||||
Surface(
|
||||
color = color,
|
||||
contentColor = FloconTheme.colorPalette.contentColorFor(color),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue