mirror of
https://github.com/mihonapp/mihon.git
synced 2025-01-03 23:07:13 +01:00
Fixes to pass relevant testing
This commit is contained in:
parent
05fc1d7b4f
commit
5c690cc6c2
@ -5,7 +5,6 @@ import androidx.compose.animation.fadeIn
|
||||
import androidx.compose.animation.fadeOut
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.WindowInsetsSides
|
||||
import androidx.compose.foundation.layout.consumeWindowInsets
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.imePadding
|
||||
import androidx.compose.foundation.layout.navigationBars
|
||||
|
@ -22,7 +22,7 @@ import androidx.compose.ui.text.TextRange
|
||||
import androidx.compose.ui.text.input.TextFieldValue
|
||||
import eu.kanade.tachiyomi.ui.manga.notes.MangaNotesScreenState
|
||||
|
||||
private const val MAX_LENGTH = 10_000
|
||||
private const val MaxLength = 10_000
|
||||
|
||||
@Composable
|
||||
fun MangaNotesTextArea(
|
||||
@ -41,12 +41,12 @@ fun MangaNotesTextArea(
|
||||
) {
|
||||
OutlinedTextField(
|
||||
value = text,
|
||||
onValueChange = { if (it.text.length <= MAX_LENGTH) text = it },
|
||||
onValueChange = { if (it.text.length <= MaxLength) text = it },
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.focusRequester(focusRequester),
|
||||
supportingText = {
|
||||
val displayWarning = text.text.length > MAX_LENGTH / 10 * 9
|
||||
val displayWarning = text.text.length > MaxLength / 10 * 9
|
||||
if (!displayWarning) {
|
||||
Text(
|
||||
text = "0",
|
||||
@ -59,7 +59,7 @@ fun MangaNotesTextArea(
|
||||
exit = fadeOut(),
|
||||
) {
|
||||
Text(
|
||||
text = "${text.text.length} / $MAX_LENGTH",
|
||||
text = "${text.text.length} / $MaxLength",
|
||||
)
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user