fix: server banner text colour in light mode

Signed-off-by: Infi <wingit@geist.ga>
This commit is contained in:
Infi 2023-06-17 14:27:26 +02:00
parent df35bf979e
commit d49ced35ad
2 changed files with 15 additions and 0 deletions

View File

@ -12,6 +12,7 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.IntOffset
import androidx.core.view.WindowCompat
@ -63,6 +64,7 @@ class MainActivity : FragmentActivity() {
val RevoltTweenInt: FiniteAnimationSpec<IntOffset> = tween(400, easing = EaseInOutExpo)
val RevoltTweenFloat: FiniteAnimationSpec<Float> = tween(400, easing = EaseInOutExpo)
val RevoltTweenDp: FiniteAnimationSpec<Dp> = tween(400, easing = EaseInOutExpo)
val RevoltTweenColour: FiniteAnimationSpec<Color> = tween(400, easing = EaseInOutExpo)
@Composable
fun AppEntrypoint() {

View File

@ -1,5 +1,6 @@
package chat.revolt.components.screens.chat.drawer.channel
import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.ExperimentalFoundationApi
@ -21,6 +22,7 @@ import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.Surface
@ -45,6 +47,7 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import chat.revolt.R
import chat.revolt.activities.RevoltTweenColour
import chat.revolt.activities.RevoltTweenDp
import chat.revolt.activities.RevoltTweenFloat
import chat.revolt.api.REVOLT_FILES
@ -89,6 +92,11 @@ fun RowScope.ChannelList(
animationSpec = RevoltTweenFloat,
label = "Banner Image Opacity"
)
val bannerTextColour by animateColorAsState(
targetValue = if (enableSmallBanner) LocalContentColor.current else Color.White,
animationSpec = RevoltTweenColour,
label = "Banner Text Colour"
)
var channelContextSheetShown by remember { mutableStateOf(false) }
var channelContextSheetTarget by remember { mutableStateOf("") }
@ -317,6 +325,11 @@ fun RowScope.ChannelList(
text = (server?.name
?: stringResource(R.string.unknown)),
style = MaterialTheme.typography.labelLarge,
color = if (server?.banner != null) {
bannerTextColour
} else {
LocalContentColor.current
},
fontSize = 16.sp,
modifier = Modifier
.then(