Timeline: update bubble style
This commit is contained in:
parent
ff61a46e94
commit
fe49572b60
3 changed files with 27 additions and 15 deletions
|
|
@ -40,6 +40,7 @@ import com.airbnb.mvrx.compose.collectAsState
|
||||||
import com.airbnb.mvrx.compose.mavericksViewModel
|
import com.airbnb.mvrx.compose.mavericksViewModel
|
||||||
import io.element.android.x.core.compose.LogCompositions
|
import io.element.android.x.core.compose.LogCompositions
|
||||||
import io.element.android.x.core.data.StableCharSequence
|
import io.element.android.x.core.data.StableCharSequence
|
||||||
|
import io.element.android.x.designsystem.*
|
||||||
import io.element.android.x.designsystem.components.avatar.AvatarData
|
import io.element.android.x.designsystem.components.avatar.AvatarData
|
||||||
import io.element.android.x.features.messages.components.*
|
import io.element.android.x.features.messages.components.*
|
||||||
import io.element.android.x.features.messages.model.MessagesItemGroupPosition
|
import io.element.android.x.features.messages.model.MessagesItemGroupPosition
|
||||||
|
|
@ -477,13 +478,18 @@ fun MessageEventBubble(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val (backgroundBubbleColor, border) = if (isMine) {
|
val backgroundBubbleColor = if (isMine) {
|
||||||
Pair(MaterialTheme.colorScheme.surfaceVariant, null)
|
if(LocalIsDarkTheme.current){
|
||||||
|
SystemGrey5Dark
|
||||||
|
}else {
|
||||||
|
SystemGrey5Light
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Pair(
|
if(LocalIsDarkTheme.current){
|
||||||
Color.Transparent,
|
SystemGrey6Dark
|
||||||
BorderStroke(1.dp, MaterialTheme.colorScheme.surfaceVariant)
|
}else {
|
||||||
)
|
SystemGrey6Light
|
||||||
|
}
|
||||||
}
|
}
|
||||||
val bubbleShape = bubbleShape()
|
val bubbleShape = bubbleShape()
|
||||||
Surface(
|
Surface(
|
||||||
|
|
@ -499,7 +505,6 @@ fun MessageEventBubble(
|
||||||
),
|
),
|
||||||
color = backgroundBubbleColor,
|
color = backgroundBubbleColor,
|
||||||
shape = bubbleShape,
|
shape = bubbleShape,
|
||||||
border = border,
|
|
||||||
content = content
|
content = content
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ val SystemGrey3Dark = Color(0xFF48484A)
|
||||||
val SystemGrey4Light = Color(0xFFD1D1D6)
|
val SystemGrey4Light = Color(0xFFD1D1D6)
|
||||||
val SystemGrey4Dark = Color(0xFF3A3A3C)
|
val SystemGrey4Dark = Color(0xFF3A3A3C)
|
||||||
val SystemGrey5Light = Color(0xFFE5E5EA)
|
val SystemGrey5Light = Color(0xFFE5E5EA)
|
||||||
val SystemGrey5Dark = Color(0xFF1C1C1E)
|
val SystemGrey5Dark = Color(0xFF2C2C2E)
|
||||||
val SystemGrey6Light = Color(0xFFF2F2F7)
|
val SystemGrey6Light = Color(0xFFF2F2F7)
|
||||||
val SystemGrey6Dark = Color(0xFF1C1C1E)
|
val SystemGrey6Dark = Color(0xFF1C1C1E)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ import android.os.Build
|
||||||
import androidx.compose.foundation.isSystemInDarkTheme
|
import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
import androidx.compose.material3.*
|
import androidx.compose.material3.*
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.CompositionLocalProvider
|
||||||
import androidx.compose.runtime.SideEffect
|
import androidx.compose.runtime.SideEffect
|
||||||
|
import androidx.compose.runtime.compositionLocalOf
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
||||||
|
|
@ -42,7 +44,7 @@ private val LightColorScheme = lightColorScheme(
|
||||||
onSurface = Color(0xFF1C1B1F),
|
onSurface = Color(0xFF1C1B1F),
|
||||||
*/
|
*/
|
||||||
)
|
)
|
||||||
|
val LocalIsDarkTheme = compositionLocalOf<Boolean> { error("Not defined") }
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ElementXTheme(
|
fun ElementXTheme(
|
||||||
|
|
@ -72,9 +74,14 @@ fun ElementXTheme(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialTheme(
|
CompositionLocalProvider(LocalIsDarkTheme provides darkTheme) {
|
||||||
colorScheme = colorScheme,
|
MaterialTheme(
|
||||||
typography = Typography,
|
colorScheme = colorScheme,
|
||||||
content = content
|
typography = Typography,
|
||||||
)
|
content = content
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue