refactor: Clean up imports and improve code formatting in OtherProfileScreen
This commit is contained in:
@@ -1,32 +1,21 @@
|
|||||||
package com.rosetta.messenger.ui.settings
|
package com.rosetta.messenger.ui.settings
|
||||||
|
|
||||||
import androidx.activity.compose.BackHandler
|
import androidx.activity.compose.BackHandler
|
||||||
import androidx.compose.animation.core.Spring
|
|
||||||
import androidx.compose.animation.core.spring
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.ArrowBack
|
import androidx.compose.material.icons.filled.ArrowBack
|
||||||
import androidx.compose.material.icons.filled.MoreVert
|
import androidx.compose.material.icons.filled.MoreVert
|
||||||
import androidx.compose.material.icons.outlined.Block
|
import androidx.compose.material.icons.outlined.Block
|
||||||
import androidx.compose.material3.*
|
import androidx.compose.material3.*
|
||||||
import androidx.compose.runtime.*
|
import androidx.compose.runtime.*
|
||||||
import androidx.compose.ui.ExperimentalComposeUiApi
|
|
||||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
|
||||||
import com.rosetta.messenger.data.MessageRepository
|
|
||||||
import com.rosetta.messenger.database.RosettaDatabase
|
|
||||||
import com.rosetta.messenger.ui.chats.ChatViewModel
|
|
||||||
import com.rosetta.messenger.ui.chats.ChatsListViewModel
|
|
||||||
import com.rosetta.messenger.ui.onboarding.PrimaryBlue
|
|
||||||
import com.rosetta.messenger.ui.components.VerifiedBadge
|
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.ExperimentalComposeUiApi
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.draw.drawBehind
|
|
||||||
import androidx.compose.ui.geometry.Offset
|
import androidx.compose.ui.geometry.Offset
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.graphicsLayer
|
import androidx.compose.ui.graphics.graphicsLayer
|
||||||
@@ -41,17 +30,22 @@ import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
|||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.IntOffset
|
|
||||||
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 androidx.lifecycle.viewmodel.compose.viewModel
|
||||||
|
import com.rosetta.messenger.data.MessageRepository
|
||||||
|
import com.rosetta.messenger.database.RosettaDatabase
|
||||||
import com.rosetta.messenger.network.SearchUser
|
import com.rosetta.messenger.network.SearchUser
|
||||||
import com.rosetta.messenger.repository.AvatarRepository
|
import com.rosetta.messenger.repository.AvatarRepository
|
||||||
|
import com.rosetta.messenger.ui.chats.ChatViewModel
|
||||||
|
import com.rosetta.messenger.ui.chats.ChatsListViewModel
|
||||||
import com.rosetta.messenger.ui.components.AvatarImage
|
import com.rosetta.messenger.ui.components.AvatarImage
|
||||||
import com.rosetta.messenger.ui.components.BlurredAvatarBackground
|
import com.rosetta.messenger.ui.components.BlurredAvatarBackground
|
||||||
|
import com.rosetta.messenger.ui.components.VerifiedBadge
|
||||||
|
import com.rosetta.messenger.ui.onboarding.PrimaryBlue
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlin.math.roundToInt
|
|
||||||
|
|
||||||
// Collapsing header constants
|
// Collapsing header constants
|
||||||
private val EXPANDED_HEADER_HEIGHT_OTHER = 280.dp
|
private val EXPANDED_HEADER_HEIGHT_OTHER = 280.dp
|
||||||
@@ -84,9 +78,7 @@ fun OtherProfileScreen(
|
|||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
|
|
||||||
// 🔥 Загружаем статус блокировки при открытии экрана
|
// 🔥 Загружаем статус блокировки при открытии экрана
|
||||||
LaunchedEffect(user.publicKey) {
|
LaunchedEffect(user.publicKey) { isBlocked = chatsListViewModel.isUserBlocked(user.publicKey) }
|
||||||
isBlocked = chatsListViewModel.isUserBlocked(user.publicKey)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 🎹 Для закрытия клавиатуры
|
// 🎹 Для закрытия клавиатуры
|
||||||
val keyboardController = LocalSoftwareKeyboardController.current
|
val keyboardController = LocalSoftwareKeyboardController.current
|
||||||
@@ -103,7 +95,9 @@ fun OtherProfileScreen(
|
|||||||
|
|
||||||
// <20>🟢 Наблюдаем за онлайн статусом пользователя в реальном времени
|
// <20>🟢 Наблюдаем за онлайн статусом пользователя в реальном времени
|
||||||
val messageRepository = remember { MessageRepository.getInstance(context) }
|
val messageRepository = remember { MessageRepository.getInstance(context) }
|
||||||
val onlineStatus by messageRepository.observeUserOnlineStatus(user.publicKey)
|
val onlineStatus by
|
||||||
|
messageRepository
|
||||||
|
.observeUserOnlineStatus(user.publicKey)
|
||||||
.collectAsState(initial = false to 0L)
|
.collectAsState(initial = false to 0L)
|
||||||
val isOnline = onlineStatus.first
|
val isOnline = onlineStatus.first
|
||||||
val lastSeen = onlineStatus.second
|
val lastSeen = onlineStatus.second
|
||||||
@@ -112,15 +106,14 @@ fun OtherProfileScreen(
|
|||||||
val density = LocalDensity.current
|
val density = LocalDensity.current
|
||||||
val statusBarHeight = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()
|
val statusBarHeight = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()
|
||||||
val expandedHeightPx = with(density) { (EXPANDED_HEADER_HEIGHT_OTHER + statusBarHeight).toPx() }
|
val expandedHeightPx = with(density) { (EXPANDED_HEADER_HEIGHT_OTHER + statusBarHeight).toPx() }
|
||||||
val collapsedHeightPx = with(density) { (COLLAPSED_HEADER_HEIGHT_OTHER + statusBarHeight).toPx() }
|
val collapsedHeightPx =
|
||||||
|
with(density) { (COLLAPSED_HEADER_HEIGHT_OTHER + statusBarHeight).toPx() }
|
||||||
|
|
||||||
var scrollOffset by remember { mutableFloatStateOf(0f) }
|
var scrollOffset by remember { mutableFloatStateOf(0f) }
|
||||||
val maxScrollOffset = expandedHeightPx - collapsedHeightPx
|
val maxScrollOffset = expandedHeightPx - collapsedHeightPx
|
||||||
|
|
||||||
val collapseProgress by remember {
|
val collapseProgress by remember {
|
||||||
derivedStateOf {
|
derivedStateOf { (scrollOffset / maxScrollOffset).coerceIn(0f, 1f) }
|
||||||
(scrollOffset / maxScrollOffset).coerceIn(0f, 1f)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val nestedScrollConnection = remember {
|
val nestedScrollConnection = remember {
|
||||||
@@ -128,14 +121,17 @@ fun OtherProfileScreen(
|
|||||||
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
|
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
|
||||||
val delta = available.y
|
val delta = available.y
|
||||||
val newOffset = scrollOffset - delta
|
val newOffset = scrollOffset - delta
|
||||||
val consumed = when {
|
val consumed =
|
||||||
|
when {
|
||||||
delta < 0 && scrollOffset < maxScrollOffset -> {
|
delta < 0 && scrollOffset < maxScrollOffset -> {
|
||||||
val consumed = (newOffset.coerceIn(0f, maxScrollOffset) - scrollOffset)
|
val consumed =
|
||||||
|
(newOffset.coerceIn(0f, maxScrollOffset) - scrollOffset)
|
||||||
scrollOffset = newOffset.coerceIn(0f, maxScrollOffset)
|
scrollOffset = newOffset.coerceIn(0f, maxScrollOffset)
|
||||||
-consumed
|
-consumed
|
||||||
}
|
}
|
||||||
delta > 0 && scrollOffset > 0 -> {
|
delta > 0 && scrollOffset > 0 -> {
|
||||||
val consumed = scrollOffset - newOffset.coerceIn(0f, maxScrollOffset)
|
val consumed =
|
||||||
|
scrollOffset - newOffset.coerceIn(0f, maxScrollOffset)
|
||||||
scrollOffset = newOffset.coerceIn(0f, maxScrollOffset)
|
scrollOffset = newOffset.coerceIn(0f, maxScrollOffset)
|
||||||
consumed
|
consumed
|
||||||
}
|
}
|
||||||
@@ -150,16 +146,21 @@ fun OtherProfileScreen(
|
|||||||
BackHandler { onBack() }
|
BackHandler { onBack() }
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier =
|
||||||
.fillMaxSize()
|
Modifier.fillMaxSize()
|
||||||
.background(backgroundColor)
|
.background(backgroundColor)
|
||||||
.nestedScroll(nestedScrollConnection)
|
.nestedScroll(nestedScrollConnection)
|
||||||
) {
|
) {
|
||||||
// Scrollable content
|
// Scrollable content
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = Modifier
|
modifier =
|
||||||
.fillMaxSize()
|
Modifier.fillMaxSize()
|
||||||
.padding(top = with(density) { (expandedHeightPx - scrollOffset).toDp() })
|
.padding(
|
||||||
|
top =
|
||||||
|
with(density) {
|
||||||
|
(expandedHeightPx - scrollOffset).toDp()
|
||||||
|
}
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
item {
|
item {
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
@@ -269,14 +270,16 @@ private fun CollapsingOtherProfileHeader(
|
|||||||
val expandedHeight = EXPANDED_HEADER_HEIGHT_OTHER + statusBarHeight
|
val expandedHeight = EXPANDED_HEADER_HEIGHT_OTHER + statusBarHeight
|
||||||
val collapsedHeight = COLLAPSED_HEADER_HEIGHT_OTHER + statusBarHeight
|
val collapsedHeight = COLLAPSED_HEADER_HEIGHT_OTHER + statusBarHeight
|
||||||
|
|
||||||
val headerHeight = androidx.compose.ui.unit.lerp(expandedHeight, collapsedHeight, collapseProgress)
|
val headerHeight =
|
||||||
|
androidx.compose.ui.unit.lerp(expandedHeight, collapsedHeight, collapseProgress)
|
||||||
|
|
||||||
// Avatar animation
|
// Avatar animation
|
||||||
val avatarCenterX = (screenWidthDp - AVATAR_SIZE_EXPANDED_OTHER) / 2
|
val avatarCenterX = (screenWidthDp - AVATAR_SIZE_EXPANDED_OTHER) / 2
|
||||||
val avatarStartY = statusBarHeight + 32.dp
|
val avatarStartY = statusBarHeight + 32.dp
|
||||||
val avatarEndY = statusBarHeight - 60.dp
|
val avatarEndY = statusBarHeight - 60.dp
|
||||||
val avatarY = androidx.compose.ui.unit.lerp(avatarStartY, avatarEndY, collapseProgress)
|
val avatarY = androidx.compose.ui.unit.lerp(avatarStartY, avatarEndY, collapseProgress)
|
||||||
val avatarSize = androidx.compose.ui.unit.lerp(AVATAR_SIZE_EXPANDED_OTHER, 0.dp, collapseProgress)
|
val avatarSize =
|
||||||
|
androidx.compose.ui.unit.lerp(AVATAR_SIZE_EXPANDED_OTHER, 0.dp, collapseProgress)
|
||||||
val avatarFontSize = androidx.compose.ui.unit.lerp(40.sp, 0.sp, collapseProgress)
|
val avatarFontSize = androidx.compose.ui.unit.lerp(40.sp, 0.sp, collapseProgress)
|
||||||
|
|
||||||
// Text animation - always centered
|
// Text animation - always centered
|
||||||
@@ -287,11 +290,7 @@ private fun CollapsingOtherProfileHeader(
|
|||||||
val nameFontSize = androidx.compose.ui.unit.lerp(24.sp, 18.sp, collapseProgress)
|
val nameFontSize = androidx.compose.ui.unit.lerp(24.sp, 18.sp, collapseProgress)
|
||||||
val onlineFontSize = androidx.compose.ui.unit.lerp(14.sp, 13.sp, collapseProgress)
|
val onlineFontSize = androidx.compose.ui.unit.lerp(14.sp, 13.sp, collapseProgress)
|
||||||
|
|
||||||
Box(
|
Box(modifier = Modifier.fillMaxWidth().height(headerHeight)) {
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.height(headerHeight)
|
|
||||||
) {
|
|
||||||
// ═══════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════
|
||||||
// 🎨 BLURRED AVATAR BACKGROUND
|
// 🎨 BLURRED AVATAR BACKGROUND
|
||||||
// ═══════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════
|
||||||
@@ -307,20 +306,17 @@ private fun CollapsingOtherProfileHeader(
|
|||||||
// 🔙 BACK BUTTON
|
// 🔙 BACK BUTTON
|
||||||
// ═══════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier =
|
||||||
.padding(top = statusBarHeight)
|
Modifier.padding(top = statusBarHeight)
|
||||||
.padding(start = 4.dp, top = 4.dp)
|
.padding(start = 4.dp, top = 4.dp)
|
||||||
.size(48.dp),
|
.size(48.dp),
|
||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
IconButton(
|
IconButton(onClick = onBack, modifier = Modifier.size(48.dp)) {
|
||||||
onClick = onBack,
|
|
||||||
modifier = Modifier.size(48.dp)
|
|
||||||
) {
|
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Filled.ArrowBack,
|
imageVector = Icons.Filled.ArrowBack,
|
||||||
contentDescription = "Back",
|
contentDescription = "Back",
|
||||||
tint = if (isColorLight(avatarColors.backgroundColor)) Color.Black else Color.White,
|
tint = if (isDarkTheme) Color.White else Color(0xFF007AFF),
|
||||||
modifier = Modifier.size(24.dp)
|
modifier = Modifier.size(24.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -330,21 +326,20 @@ private fun CollapsingOtherProfileHeader(
|
|||||||
// ⋮ MENU BUTTON (top right corner)
|
// ⋮ MENU BUTTON (top right corner)
|
||||||
// ═══════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier =
|
||||||
.align(Alignment.TopEnd)
|
Modifier.align(Alignment.TopEnd)
|
||||||
.padding(top = statusBarHeight)
|
.padding(top = statusBarHeight)
|
||||||
.padding(end = 4.dp, top = 4.dp)
|
.padding(end = 4.dp, top = 4.dp)
|
||||||
.size(48.dp),
|
.size(48.dp),
|
||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
IconButton(
|
IconButton(onClick = { onAvatarMenuChange(true) }, modifier = Modifier.size(48.dp)) {
|
||||||
onClick = { onAvatarMenuChange(true) },
|
|
||||||
modifier = Modifier.size(48.dp)
|
|
||||||
) {
|
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Default.MoreVert,
|
imageVector = Icons.Default.MoreVert,
|
||||||
contentDescription = "Profile menu",
|
contentDescription = "Profile menu",
|
||||||
tint = if (isColorLight(avatarColors.backgroundColor)) Color.Black else Color.White,
|
tint =
|
||||||
|
if (isColorLight(avatarColors.backgroundColor)) Color.Black
|
||||||
|
else Color.White,
|
||||||
modifier = Modifier.size(24.dp)
|
modifier = Modifier.size(24.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -371,9 +366,12 @@ private fun CollapsingOtherProfileHeader(
|
|||||||
// ═══════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════
|
||||||
if (avatarSize > 1.dp) {
|
if (avatarSize > 1.dp) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier =
|
||||||
.offset(
|
Modifier.offset(
|
||||||
x = avatarCenterX + (AVATAR_SIZE_EXPANDED_OTHER - avatarSize) / 2,
|
x =
|
||||||
|
avatarCenterX +
|
||||||
|
(AVATAR_SIZE_EXPANDED_OTHER -
|
||||||
|
avatarSize) / 2,
|
||||||
y = avatarY
|
y = avatarY
|
||||||
)
|
)
|
||||||
.size(avatarSize)
|
.size(avatarSize)
|
||||||
@@ -396,12 +394,15 @@ private fun CollapsingOtherProfileHeader(
|
|||||||
// 📝 TEXT BLOCK - Name + Verified + Online, always centered
|
// 📝 TEXT BLOCK - Name + Verified + Online, always centered
|
||||||
// ═══════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier =
|
||||||
.align(Alignment.TopCenter)
|
Modifier.align(Alignment.TopCenter).offset(y = textY).graphicsLayer {
|
||||||
.offset(y = textY)
|
val centerOffsetY =
|
||||||
.graphicsLayer {
|
with(density) {
|
||||||
val centerOffsetY = with(density) {
|
androidx.compose
|
||||||
androidx.compose.ui.unit.lerp(24.dp, 18.dp, collapseProgress).toPx()
|
.ui
|
||||||
|
.unit
|
||||||
|
.lerp(24.dp, 18.dp, collapseProgress)
|
||||||
|
.toPx()
|
||||||
}
|
}
|
||||||
translationY = -centerOffsetY
|
translationY = -centerOffsetY
|
||||||
},
|
},
|
||||||
@@ -416,7 +417,9 @@ private fun CollapsingOtherProfileHeader(
|
|||||||
text = name,
|
text = name,
|
||||||
fontSize = nameFontSize,
|
fontSize = nameFontSize,
|
||||||
fontWeight = FontWeight.SemiBold,
|
fontWeight = FontWeight.SemiBold,
|
||||||
color = if (isColorLight(avatarColors.backgroundColor)) Color.Black else Color.White,
|
color =
|
||||||
|
if (isColorLight(avatarColors.backgroundColor)) Color.Black
|
||||||
|
else Color.White,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis,
|
||||||
textAlign = TextAlign.Center
|
textAlign = TextAlign.Center
|
||||||
@@ -424,10 +427,7 @@ private fun CollapsingOtherProfileHeader(
|
|||||||
|
|
||||||
if (verified > 0) {
|
if (verified > 0) {
|
||||||
Spacer(modifier = Modifier.width(4.dp))
|
Spacer(modifier = Modifier.width(4.dp))
|
||||||
VerifiedBadge(
|
VerifiedBadge(verified = verified, size = (nameFontSize.value * 0.8f).toInt())
|
||||||
verified = verified,
|
|
||||||
size = (nameFontSize.value * 0.8f).toInt()
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,10 +437,13 @@ private fun CollapsingOtherProfileHeader(
|
|||||||
Text(
|
Text(
|
||||||
text = if (isOnline) "online" else "offline",
|
text = if (isOnline) "online" else "offline",
|
||||||
fontSize = onlineFontSize,
|
fontSize = onlineFontSize,
|
||||||
color = if (isOnline) {
|
color =
|
||||||
|
if (isOnline) {
|
||||||
Color(0xFF4CAF50)
|
Color(0xFF4CAF50)
|
||||||
} else {
|
} else {
|
||||||
if (isColorLight(avatarColors.backgroundColor)) Color.Black.copy(alpha = 0.6f) else Color.White.copy(alpha = 0.6f)
|
if (isColorLight(avatarColors.backgroundColor))
|
||||||
|
Color.Black.copy(alpha = 0.6f)
|
||||||
|
else Color.White.copy(alpha = 0.6f)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -451,17 +454,13 @@ private fun CollapsingOtherProfileHeader(
|
|||||||
// 🚫 BLOCK/UNBLOCK ITEM
|
// 🚫 BLOCK/UNBLOCK ITEM
|
||||||
// ═══════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════
|
||||||
@Composable
|
@Composable
|
||||||
private fun TelegramBlockItem(
|
private fun TelegramBlockItem(isBlocked: Boolean, onToggle: () -> Unit, isDarkTheme: Boolean) {
|
||||||
isBlocked: Boolean,
|
|
||||||
onToggle: () -> Unit,
|
|
||||||
isDarkTheme: Boolean
|
|
||||||
) {
|
|
||||||
val textColor = if (isDarkTheme) Color.White else Color.Black
|
val textColor = if (isDarkTheme) Color.White else Color.Black
|
||||||
val iconColor = PrimaryBlue
|
val iconColor = PrimaryBlue
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier =
|
||||||
.fillMaxWidth()
|
Modifier.fillMaxWidth()
|
||||||
.clickable(onClick = onToggle)
|
.clickable(onClick = onToggle)
|
||||||
.padding(horizontal = 16.dp, vertical = 14.dp),
|
.padding(horizontal = 16.dp, vertical = 14.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
@@ -484,7 +483,9 @@ private fun TelegramBlockItem(
|
|||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(2.dp))
|
Spacer(modifier = Modifier.height(2.dp))
|
||||||
Text(
|
Text(
|
||||||
text = if (isBlocked) "Allow this user to message you" else "Prevent this user from messaging you",
|
text =
|
||||||
|
if (isBlocked) "Allow this user to message you"
|
||||||
|
else "Prevent this user from messaging you",
|
||||||
fontSize = 13.sp,
|
fontSize = 13.sp,
|
||||||
color = if (isDarkTheme) Color(0xFF8E8E93) else Color(0xFF666666),
|
color = if (isDarkTheme) Color(0xFF8E8E93) else Color(0xFF666666),
|
||||||
lineHeight = 16.sp
|
lineHeight = 16.sp
|
||||||
|
|||||||
Reference in New Issue
Block a user