mirror of
https://github.com/mihonapp/mihon.git
synced 2025-01-06 08:17:12 +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.animation.fadeOut
|
||||||
import androidx.compose.foundation.layout.WindowInsets
|
import androidx.compose.foundation.layout.WindowInsets
|
||||||
import androidx.compose.foundation.layout.WindowInsetsSides
|
import androidx.compose.foundation.layout.WindowInsetsSides
|
||||||
import androidx.compose.foundation.layout.consumeWindowInsets
|
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.imePadding
|
import androidx.compose.foundation.layout.imePadding
|
||||||
import androidx.compose.foundation.layout.navigationBars
|
import androidx.compose.foundation.layout.navigationBars
|
||||||
|
@ -22,7 +22,7 @@ import androidx.compose.ui.text.TextRange
|
|||||||
import androidx.compose.ui.text.input.TextFieldValue
|
import androidx.compose.ui.text.input.TextFieldValue
|
||||||
import eu.kanade.tachiyomi.ui.manga.notes.MangaNotesScreenState
|
import eu.kanade.tachiyomi.ui.manga.notes.MangaNotesScreenState
|
||||||
|
|
||||||
private const val MAX_LENGTH = 10_000
|
private const val MaxLength = 10_000
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun MangaNotesTextArea(
|
fun MangaNotesTextArea(
|
||||||
@ -41,12 +41,12 @@ fun MangaNotesTextArea(
|
|||||||
) {
|
) {
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
value = text,
|
value = text,
|
||||||
onValueChange = { if (it.text.length <= MAX_LENGTH) text = it },
|
onValueChange = { if (it.text.length <= MaxLength) text = it },
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.focusRequester(focusRequester),
|
.focusRequester(focusRequester),
|
||||||
supportingText = {
|
supportingText = {
|
||||||
val displayWarning = text.text.length > MAX_LENGTH / 10 * 9
|
val displayWarning = text.text.length > MaxLength / 10 * 9
|
||||||
if (!displayWarning) {
|
if (!displayWarning) {
|
||||||
Text(
|
Text(
|
||||||
text = "0",
|
text = "0",
|
||||||
@ -59,7 +59,7 @@ fun MangaNotesTextArea(
|
|||||||
exit = fadeOut(),
|
exit = fadeOut(),
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = "${text.text.length} / $MAX_LENGTH",
|
text = "${text.text.length} / $MaxLength",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user