fix! solve syllabe(lyrics) collision with adaptive padding

This commit is contained in:
hasinarak3@gmail.com 2026-01-23 15:19:13 +03:00
parent dd0590f9fd
commit b7dea7e16c

View file

@ -1,34 +1,52 @@
package mg.dot.feufaro.solfa package mg.dot.feufaro.solfa
import SharedScreenModel
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.combinedClickable import androidx.compose.runtime.Composable
import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.*
import androidx.compose.material3.LocalTextStyle import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.material3.Text import androidx.compose.foundation.lazy.grid.LazyGridState
import androidx.compose.runtime.* import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.material3.Text
import androidx.compose.material3.LocalTextStyle
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.draw.drawBehind import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.draw.drawWithContent import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size import androidx.compose.foundation.Canvas
import androidx.compose.foundation.border
import androidx.compose.foundation.combinedClickable
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.text.* import androidx.compose.ui.text.TextLayoutResult
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontStyle import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.BaselineShift import androidx.compose.ui.text.rememberTextMeasurer
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.TextUnit import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import mg.dot.feufaro.data.GridTUOData import mg.dot.feufaro.data.GridTUOData
import kotlin.math.min import kotlin.math.min
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.style.BaselineShift
import androidx.compose.ui.text.withStyle
import SharedScreenModel
import androidx.compose.runtime.collectAsState
import androidx.compose.ui.Alignment
import androidx.compose.ui.text.TextMeasurer
import kotlinx.coroutines.delay
val FEUFAROO_TRIOLET_COLOR = Color.DarkGray val FEUFAROO_TRIOLET_COLOR = Color.DarkGray
val FEUFAROO_KEY_CHANGE_COLOR = Color.Blue val FEUFAROO_KEY_CHANGE_COLOR = Color.Blue
@ -638,7 +656,7 @@ fun LazyVerticalGridTUO(
overflow = TextOverflow.Visible, overflow = TextOverflow.Visible,
style = TextStyle( style = TextStyle(
color = when { color = when {
(isTooLong) -> Color(0XFFBFAC00) (isTooLong) -> Color(0XFF121212)
(index == 0) -> Color.Black (index == 0) -> Color.Black
else -> Color(0XFF3B3A39) else -> Color(0XFF3B3A39)
}, },