fix: Update background color in SwipeableDialogItem and RequestsScreen for improved UI consistency
This commit is contained in:
@@ -857,7 +857,7 @@ fun ChatsListScreen(
|
|||||||
containerColor = backgroundColor
|
containerColor = backgroundColor
|
||||||
) { paddingValues ->
|
) { paddingValues ->
|
||||||
// Main content
|
// Main content
|
||||||
Box(modifier = Modifier.fillMaxSize().padding(paddingValues)) {
|
Box(modifier = Modifier.fillMaxSize().background(backgroundColor).padding(paddingValues)) {
|
||||||
// <20> Используем комбинированное состояние для атомарного
|
// <20> Используем комбинированное состояние для атомарного
|
||||||
// обновления
|
// обновления
|
||||||
// Это предотвращает "дергание" UI когда dialogs и requests
|
// Это предотвращает "дергание" UI когда dialogs и requests
|
||||||
@@ -925,12 +925,13 @@ fun ChatsListScreen(
|
|||||||
val dividerColor =
|
val dividerColor =
|
||||||
if (isDarkTheme) Color(0xFF3A3A3A)
|
if (isDarkTheme) Color(0xFF3A3A3A)
|
||||||
else Color(0xFFE8E8E8)
|
else Color(0xFFE8E8E8)
|
||||||
|
val listBackgroundColor = if (isDarkTheme) Color(0xFF1A1A1A) else Color(0xFFF2F2F7)
|
||||||
// 🔥 Берем dialogs из chatsState для
|
// 🔥 Берем dialogs из chatsState для
|
||||||
// консистентности
|
// консистентности
|
||||||
val currentDialogs = chatsState.dialogs
|
val currentDialogs = chatsState.dialogs
|
||||||
|
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = Modifier.fillMaxSize()
|
modifier = Modifier.fillMaxSize().background(listBackgroundColor)
|
||||||
) {
|
) {
|
||||||
if (requestsCount > 0) {
|
if (requestsCount > 0) {
|
||||||
item(
|
item(
|
||||||
@@ -1173,13 +1174,14 @@ fun ChatsListScreen(
|
|||||||
@Composable
|
@Composable
|
||||||
private fun EmptyChatsState(isDarkTheme: Boolean, modifier: Modifier = Modifier) {
|
private fun EmptyChatsState(isDarkTheme: Boolean, modifier: Modifier = Modifier) {
|
||||||
val secondaryTextColor = if (isDarkTheme) Color(0xFF8E8E93) else Color(0xFF666666)
|
val secondaryTextColor = if (isDarkTheme) Color(0xFF8E8E93) else Color(0xFF666666)
|
||||||
|
val backgroundColor = if (isDarkTheme) Color(0xFF1A1A1A) else Color(0xFFF2F2F7)
|
||||||
|
|
||||||
// Lottie animation
|
// Lottie animation
|
||||||
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.letter))
|
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.letter))
|
||||||
val progress by animateLottieCompositionAsState(composition = composition, iterations = 1)
|
val progress by animateLottieCompositionAsState(composition = composition, iterations = 1)
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
modifier = modifier.fillMaxSize(),
|
modifier = modifier.fillMaxSize().background(backgroundColor),
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
verticalArrangement = Arrangement.Center
|
verticalArrangement = Arrangement.Center
|
||||||
) {
|
) {
|
||||||
@@ -1472,7 +1474,7 @@ fun SwipeableDialogItem(
|
|||||||
onBlock: () -> Unit = {},
|
onBlock: () -> Unit = {},
|
||||||
onUnblock: () -> Unit = {}
|
onUnblock: () -> Unit = {}
|
||||||
) {
|
) {
|
||||||
val backgroundColor = if (isDarkTheme) Color(0xFF1A1A1A) else Color(0xFFFFFFFF)
|
val backgroundColor = if (isDarkTheme) Color(0xFF1A1A1A) else Color(0xFFF2F2F7)
|
||||||
var offsetX by remember { mutableStateOf(0f) }
|
var offsetX by remember { mutableStateOf(0f) }
|
||||||
val swipeWidthDp = if (isSavedMessages) 80.dp else 160.dp
|
val swipeWidthDp = if (isSavedMessages) 80.dp else 160.dp
|
||||||
val density = androidx.compose.ui.platform.LocalDensity.current
|
val density = androidx.compose.ui.platform.LocalDensity.current
|
||||||
@@ -1489,7 +1491,7 @@ fun SwipeableDialogItem(
|
|||||||
label = "swipeOffset"
|
label = "swipeOffset"
|
||||||
)
|
)
|
||||||
|
|
||||||
Box(modifier = Modifier.fillMaxWidth().height(itemHeight).clipToBounds()) {
|
Box(modifier = Modifier.fillMaxWidth().height(itemHeight).background(backgroundColor).clipToBounds()) {
|
||||||
// 1. КНОПКИ - позиционированы справа, всегда видны при свайпе
|
// 1. КНОПКИ - позиционированы справа, всегда видны при свайпе
|
||||||
Row(
|
Row(
|
||||||
modifier =
|
modifier =
|
||||||
@@ -2036,7 +2038,7 @@ fun RequestsScreen(
|
|||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
onRequestClick: (DialogUiModel) -> Unit
|
onRequestClick: (DialogUiModel) -> Unit
|
||||||
) {
|
) {
|
||||||
val backgroundColor = if (isDarkTheme) Color(0xFF1A1A1A) else Color(0xFFFFFFFF)
|
val backgroundColor = if (isDarkTheme) Color(0xFF1A1A1A) else Color(0xFFF2F2F7)
|
||||||
val dividerColor = if (isDarkTheme) Color(0xFF3A3A3A) else Color(0xFFE8E8E8)
|
val dividerColor = if (isDarkTheme) Color(0xFF3A3A3A) else Color(0xFFE8E8E8)
|
||||||
|
|
||||||
Column(modifier = Modifier.fillMaxSize().background(backgroundColor)) {
|
Column(modifier = Modifier.fillMaxSize().background(backgroundColor)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user