fix: server banner text colour in light mode
Signed-off-by: Infi <wingit@geist.ga>
This commit is contained in:
parent
df35bf979e
commit
d49ced35ad
|
|
@ -12,6 +12,7 @@ import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Surface
|
import androidx.compose.material3.Surface
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.unit.Dp
|
import androidx.compose.ui.unit.Dp
|
||||||
import androidx.compose.ui.unit.IntOffset
|
import androidx.compose.ui.unit.IntOffset
|
||||||
import androidx.core.view.WindowCompat
|
import androidx.core.view.WindowCompat
|
||||||
|
|
@ -63,6 +64,7 @@ class MainActivity : FragmentActivity() {
|
||||||
val RevoltTweenInt: FiniteAnimationSpec<IntOffset> = tween(400, easing = EaseInOutExpo)
|
val RevoltTweenInt: FiniteAnimationSpec<IntOffset> = tween(400, easing = EaseInOutExpo)
|
||||||
val RevoltTweenFloat: FiniteAnimationSpec<Float> = tween(400, easing = EaseInOutExpo)
|
val RevoltTweenFloat: FiniteAnimationSpec<Float> = tween(400, easing = EaseInOutExpo)
|
||||||
val RevoltTweenDp: FiniteAnimationSpec<Dp> = tween(400, easing = EaseInOutExpo)
|
val RevoltTweenDp: FiniteAnimationSpec<Dp> = tween(400, easing = EaseInOutExpo)
|
||||||
|
val RevoltTweenColour: FiniteAnimationSpec<Color> = tween(400, easing = EaseInOutExpo)
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AppEntrypoint() {
|
fun AppEntrypoint() {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package chat.revolt.components.screens.chat.drawer.channel
|
package chat.revolt.components.screens.chat.drawer.channel
|
||||||
|
|
||||||
|
import androidx.compose.animation.animateColorAsState
|
||||||
import androidx.compose.animation.core.animateDpAsState
|
import androidx.compose.animation.core.animateDpAsState
|
||||||
import androidx.compose.animation.core.animateFloatAsState
|
import androidx.compose.animation.core.animateFloatAsState
|
||||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
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.ExperimentalMaterial3Api
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.material3.LocalContentColor
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.ModalBottomSheet
|
import androidx.compose.material3.ModalBottomSheet
|
||||||
import androidx.compose.material3.Surface
|
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.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import chat.revolt.R
|
import chat.revolt.R
|
||||||
|
import chat.revolt.activities.RevoltTweenColour
|
||||||
import chat.revolt.activities.RevoltTweenDp
|
import chat.revolt.activities.RevoltTweenDp
|
||||||
import chat.revolt.activities.RevoltTweenFloat
|
import chat.revolt.activities.RevoltTweenFloat
|
||||||
import chat.revolt.api.REVOLT_FILES
|
import chat.revolt.api.REVOLT_FILES
|
||||||
|
|
@ -89,6 +92,11 @@ fun RowScope.ChannelList(
|
||||||
animationSpec = RevoltTweenFloat,
|
animationSpec = RevoltTweenFloat,
|
||||||
label = "Banner Image Opacity"
|
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 channelContextSheetShown by remember { mutableStateOf(false) }
|
||||||
var channelContextSheetTarget by remember { mutableStateOf("") }
|
var channelContextSheetTarget by remember { mutableStateOf("") }
|
||||||
|
|
@ -317,6 +325,11 @@ fun RowScope.ChannelList(
|
||||||
text = (server?.name
|
text = (server?.name
|
||||||
?: stringResource(R.string.unknown)),
|
?: stringResource(R.string.unknown)),
|
||||||
style = MaterialTheme.typography.labelLarge,
|
style = MaterialTheme.typography.labelLarge,
|
||||||
|
color = if (server?.banner != null) {
|
||||||
|
bannerTextColour
|
||||||
|
} else {
|
||||||
|
LocalContentColor.current
|
||||||
|
},
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.then(
|
.then(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue