1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 08:30:44 +00:00

Use normal colors for empty state view

This commit is contained in:
Stypox 2024-11-21 12:07:03 +01:00
parent 46b9243661
commit 1abced992b
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
3 changed files with 14 additions and 43 deletions

View File

@ -7,12 +7,10 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
@ -23,7 +21,6 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import org.schabi.newpipe.R
import org.schabi.newpipe.ui.theme.AppTheme
import org.schabi.newpipe.ui.theme.errorHint
@Composable
fun EmptyStateComposable(
@ -49,26 +46,22 @@ private fun EmptyStateComposable(
descriptionText: String,
descriptionTextStyle: TextStyle,
) {
CompositionLocalProvider(
LocalContentColor provides MaterialTheme.colorScheme.errorHint
Column(
modifier = modifier,
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
Column(
modifier = modifier,
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
Text(
modifier = emojiModifier,
text = emojiText,
style = emojiTextStyle,
)
Text(
modifier = emojiModifier,
text = emojiText,
style = emojiTextStyle,
)
Text(
modifier = descriptionModifier,
text = descriptionText,
style = descriptionTextStyle,
)
}
Text(
modifier = descriptionModifier,
text = descriptionText,
style = descriptionTextStyle,
)
}
}

View File

@ -3,7 +3,6 @@
package org.schabi.newpipe.ui.emptystate
import androidx.annotation.StringRes
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.State
@ -11,7 +10,6 @@ import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.compose.ui.res.stringResource
import org.schabi.newpipe.ui.theme.AppTheme
import org.schabi.newpipe.ui.theme.errorHint
import androidx.compose.runtime.mutableStateOf as composeRuntimeMutableStateOf
@JvmOverloads
@ -24,7 +22,6 @@ fun ComposeView.setEmptyStateText(
AppTheme {
Text(
text = stringResource(id = stringRes),
color = MaterialTheme.colorScheme.errorHint,
)
}
}

View File

@ -1,19 +0,0 @@
package org.schabi.newpipe.ui.theme
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.ColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
/**
* Extended color for error hint.
*/
val md_theme_light_error_hint = Color(0xCC000000)
val md_theme_dark_error_hint = Color(0xCCFFFFFF)
val ColorScheme.errorHint: Color
@Composable get() = if (isSystemInDarkTheme()) {
md_theme_dark_error_hint
} else {
md_theme_light_error_hint
}