Minor UI fixes

- Remove M3 styling from search toolbar
- Use secondary alpha for subtitles for Sources and Migrate items
- Update some content descriptions
This commit is contained in:
arkon 2022-10-09 15:49:32 -04:00
parent b4f2da12ea
commit 23bfa1f18f
6 changed files with 14 additions and 7 deletions

View file

@ -315,6 +315,7 @@ tasks {
kotlinOptions.freeCompilerArgs += listOf(
"-opt-in=coil.annotation.ExperimentalCoilApi",
"-opt-in=com.google.accompanist.pager.ExperimentalPagerApi",
"-opt-in=androidx.compose.material.ExperimentalMaterialApi",
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
"-opt-in=androidx.compose.ui.ExperimentalComposeUiApi",
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
@ -327,8 +328,6 @@ tasks {
)
}
preBuild {
val ktlintTask = if (System.getenv("GITHUB_BASE_REF") == null) formatKotlin else lintKotlin
dependsOn(ktlintTask)

View file

@ -37,6 +37,7 @@ import eu.kanade.presentation.components.ScrollbarLazyColumn
import eu.kanade.presentation.theme.header
import eu.kanade.presentation.util.horizontalPadding
import eu.kanade.presentation.util.plus
import eu.kanade.presentation.util.secondaryItemAlpha
import eu.kanade.presentation.util.topPaddingValues
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.browse.migration.sources.MigrationSourcesPresenter
@ -162,6 +163,7 @@ private fun MigrateSourceItem(
) {
if (sourceLangString != null) {
Text(
modifier = Modifier.secondaryItemAlpha(),
text = sourceLangString,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
@ -170,6 +172,7 @@ private fun MigrateSourceItem(
}
if (source.isStub) {
Text(
modifier = Modifier.secondaryItemAlpha(),
text = stringResource(R.string.not_installed),
maxLines = 1,
overflow = TextOverflow.Ellipsis,

View file

@ -187,11 +187,12 @@ private fun SourcePinButton(
) {
val icon = if (isPinned) Icons.Filled.PushPin else Icons.Outlined.PushPin
val tint = if (isPinned) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onBackground
val description = if (isPinned) R.string.action_unpin else R.string.action_pin
IconButton(onClick = onClick) {
Icon(
imageVector = icon,
contentDescription = "",
tint = tint,
contentDescription = stringResource(description),
)
}
}

View file

@ -11,6 +11,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.style.TextOverflow
import eu.kanade.domain.source.model.Source
import eu.kanade.presentation.util.horizontalPadding
import eu.kanade.presentation.util.secondaryItemAlpha
import eu.kanade.tachiyomi.util.system.LocaleHelper
@Composable
@ -53,6 +54,7 @@ private val defaultContent: @Composable RowScope.(Source, String?) -> Unit = { s
)
if (sourceLangString != null) {
Text(
modifier = Modifier.secondaryItemAlpha(),
text = sourceLangString,
maxLines = 1,
overflow = TextOverflow.Ellipsis,

View file

@ -49,7 +49,7 @@ fun SourceIcon(
source.isStub && icon == null -> {
Image(
imageVector = Icons.Default.Warning,
contentDescription = "",
contentDescription = null,
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.error),
modifier = modifier.then(defaultModifier),
)
@ -57,14 +57,14 @@ fun SourceIcon(
icon != null -> {
Image(
bitmap = icon,
contentDescription = "",
contentDescription = null,
modifier = modifier.then(defaultModifier),
)
}
else -> {
Image(
painter = painterResource(id = R.mipmap.ic_local_source),
contentDescription = "",
contentDescription = null,
modifier = modifier.then(defaultModifier),
)
}

View file

@ -10,6 +10,7 @@ import androidx.compose.foundation.layout.statusBars
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.TextFieldDefaults
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.Close
@ -21,7 +22,6 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TextFieldDefaults
import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.TopAppBarScrollBehavior
@ -44,6 +44,7 @@ import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import eu.kanade.presentation.util.secondaryItemAlpha
import eu.kanade.tachiyomi.R
@Composable
@ -266,6 +267,7 @@ fun SearchToolbar(
placeholder = {
if (!placeholderText.isNullOrEmpty()) {
Text(
modifier = Modifier.secondaryItemAlpha(),
text = placeholderText,
maxLines = 1,
overflow = TextOverflow.Ellipsis,