Fix background color on startup

This commit is contained in:
Ash 2022-06-01 18:53:10 +08:00
parent 1be4779df2
commit fc82363196
5 changed files with 18 additions and 22 deletions

View File

@ -15,6 +15,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.RectangleShape import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.platform.LocalView import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
@ -46,10 +47,8 @@ fun FeedItem(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.background( .clip(if (isEnded()) ShapeBottom32 else RectangleShape)
color = MaterialTheme.colorScheme.secondary.copy(alpha = alpha), .background(MaterialTheme.colorScheme.secondary.copy(alpha = alpha))
shape = if (isEnded()) ShapeBottom32 else RectangleShape,
)
.combinedClickable( .combinedClickable(
onClick = { onClick = {
onClick() onClick()

View File

@ -50,9 +50,7 @@ fun GroupItem(
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.clip(if (isExpanded() && !isEnded()) ShapeTop32 else Shape32) .clip(if (isExpanded() && !isEnded()) ShapeTop32 else Shape32)
.background( .background(MaterialTheme.colorScheme.secondary.copy(alpha = alpha))
MaterialTheme.colorScheme.secondary.copy(alpha = alpha)
)
.combinedClickable( .combinedClickable(
onClick = { onClick = {
groupOnClick() groupOnClick()
@ -84,12 +82,8 @@ fun GroupItem(
.padding(end = 20.dp) .padding(end = 20.dp)
.size(24.dp) .size(24.dp)
.clip(CircleShape) .clip(CircleShape)
.background( .background(MaterialTheme.colorScheme.surfaceTint.copy(alpha = indicatorAlpha))
MaterialTheme.colorScheme.surfaceTint.copy(alpha = indicatorAlpha) .clickable { onExpanded() },
)
.clickable {
onExpanded()
},
horizontalArrangement = Arrangement.Center, horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="windowBackground">#FF000000</color>
</resources>

View File

@ -1,10 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="purple_200">#FFBB86FC</color> <color name="windowBackground">#FFFFFFFF</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources> </resources>

View File

@ -1,7 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="Theme.Reader" parent="android:Theme.Material.Light.NoActionBar"> <style name="Theme.Reader" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:statusBarColor">@color/purple_700</item> <item name="windowActionModeOverlay">true</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowActionModeOverlay">true</item>
<item name="android:windowContentOverlay">@color/windowBackground</item>
<item name="android:windowBackground">@color/windowBackground</item>
</style> </style>
</resources> </resources>