forked from melod1n/fast-messenger
some updates
This commit is contained in:
+2
-8
@@ -311,10 +311,7 @@ fun ChatMaterialsScreen(
|
||||
modifier = Modifier
|
||||
.then(
|
||||
if (currentTheme.enableBlur) {
|
||||
Modifier.haze(
|
||||
state = hazeState,
|
||||
style = hazeStyle
|
||||
)
|
||||
Modifier.haze(state = hazeState)
|
||||
} else {
|
||||
Modifier
|
||||
}
|
||||
@@ -349,10 +346,7 @@ fun ChatMaterialsScreen(
|
||||
modifier = Modifier
|
||||
.then(
|
||||
if (currentTheme.enableBlur) {
|
||||
Modifier.haze(
|
||||
state = hazeState,
|
||||
style = hazeStyle
|
||||
)
|
||||
Modifier.haze(state = hazeState)
|
||||
} else {
|
||||
Modifier
|
||||
}
|
||||
|
||||
+13
-12
@@ -5,7 +5,6 @@ import androidx.compose.animation.core.animateDpAsState
|
||||
import androidx.compose.animation.fadeIn
|
||||
import androidx.compose.animation.fadeOut
|
||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.combinedClickable
|
||||
@@ -39,7 +38,6 @@ import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.ColorFilter
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
@@ -130,24 +128,25 @@ fun ConversationItem(
|
||||
.clip(CircleShape)
|
||||
.background(MaterialTheme.colorScheme.primary)
|
||||
) {
|
||||
Image(
|
||||
Icon(
|
||||
modifier = Modifier
|
||||
.align(Alignment.Center)
|
||||
.size(32.dp),
|
||||
painter = painterResource(id = UiR.drawable.ic_round_bookmark_border_24),
|
||||
contentDescription = "Favorites icon"
|
||||
contentDescription = "Favorites icon",
|
||||
tint = Color.White
|
||||
)
|
||||
}
|
||||
} else {
|
||||
val avatarImage = conversation.avatar?.getImage()
|
||||
if (avatarImage is Painter) {
|
||||
Image(
|
||||
Icon(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.clip(CircleShape),
|
||||
painter = avatarImage,
|
||||
contentDescription = "Avatar",
|
||||
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onBackground)
|
||||
tint = MaterialTheme.colorScheme.onBackground
|
||||
)
|
||||
} else {
|
||||
AsyncImage(
|
||||
@@ -173,12 +172,13 @@ fun ConversationItem(
|
||||
.defaultMinSize(minWidth = 20.dp, minHeight = 20.dp)
|
||||
.background(MaterialTheme.colorScheme.outline)
|
||||
) {
|
||||
Image(
|
||||
Icon(
|
||||
modifier = Modifier
|
||||
.height(14.dp)
|
||||
.align(Alignment.Center),
|
||||
painter = painterResource(id = UiR.drawable.ic_round_push_pin_24),
|
||||
contentDescription = "Pin icon"
|
||||
contentDescription = "Pin icon",
|
||||
tint = Color.White
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -228,12 +228,13 @@ fun ConversationItem(
|
||||
.matchParentSize()
|
||||
.background(BirthdayColor)
|
||||
) {
|
||||
Image(
|
||||
Icon(
|
||||
modifier = Modifier
|
||||
.align(Alignment.Center)
|
||||
.size(10.dp),
|
||||
painter = painterResource(id = UiR.drawable.round_cake_24),
|
||||
contentDescription = "Birthday icon"
|
||||
contentDescription = "Birthday icon",
|
||||
tint = Color.White
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -270,11 +271,11 @@ fun ConversationItem(
|
||||
conversation.attachmentImage?.getResourcePainter()?.let { painter ->
|
||||
Column {
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Image(
|
||||
Icon(
|
||||
modifier = Modifier.size(14.dp),
|
||||
painter = painter,
|
||||
contentDescription = "attachment image",
|
||||
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onPrimaryContainer)
|
||||
tint = MaterialTheme.colorScheme.onPrimaryContainer
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+1
-4
@@ -366,10 +366,7 @@ fun ConversationsScreen(
|
||||
state = listState,
|
||||
maxLines = maxLines,
|
||||
modifier = if (currentTheme.enableBlur) {
|
||||
Modifier.haze(
|
||||
state = hazeState,
|
||||
style = HazeMaterials.thick()
|
||||
)
|
||||
Modifier.haze(state = hazeState)
|
||||
} else {
|
||||
Modifier
|
||||
}.fillMaxSize(),
|
||||
|
||||
+1
-4
@@ -304,10 +304,7 @@ fun FriendsScreen(
|
||||
|
||||
FriendsList(
|
||||
modifier = if (currentTheme.enableBlur) {
|
||||
Modifier.haze(
|
||||
state = hazeState,
|
||||
style = HazeMaterials.thick()
|
||||
)
|
||||
Modifier.haze(state = hazeState)
|
||||
} else {
|
||||
Modifier
|
||||
}.fillMaxSize(),
|
||||
|
||||
+3
-9
@@ -17,15 +17,12 @@ import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import dev.chrisbanes.haze.HazeState
|
||||
import dev.chrisbanes.haze.haze
|
||||
import dev.meloda.fast.messageshistory.model.UiItem
|
||||
import dev.meloda.fast.ui.theme.LocalThemeConfig
|
||||
import dev.meloda.fast.ui.util.ImmutableList
|
||||
import dev.chrisbanes.haze.HazeState
|
||||
import dev.chrisbanes.haze.haze
|
||||
import dev.chrisbanes.haze.materials.ExperimentalHazeMaterialsApi
|
||||
import dev.chrisbanes.haze.materials.HazeMaterials
|
||||
|
||||
@OptIn(ExperimentalHazeMaterialsApi::class)
|
||||
@Composable
|
||||
fun MessagesList(
|
||||
modifier: Modifier = Modifier,
|
||||
@@ -45,10 +42,7 @@ fun MessagesList(
|
||||
.fillMaxWidth()
|
||||
.then(
|
||||
if (currentTheme.enableBlur) {
|
||||
Modifier.haze(
|
||||
state = hazeState,
|
||||
style = HazeMaterials.regular()
|
||||
)
|
||||
Modifier.haze(state = hazeState)
|
||||
} else Modifier
|
||||
),
|
||||
state = listState,
|
||||
|
||||
@@ -238,6 +238,11 @@ class SettingsViewModelImpl(
|
||||
userSettings.onShowTimeInActionMessagesChanged(show)
|
||||
}
|
||||
|
||||
SettingsKeys.KEY_DEBUG_USE_SYSTEM_FONT -> {
|
||||
val use = newValue as? Boolean ?: SettingsKeys.DEFAULT_DEBUG_USE_SYSTEM_FONT
|
||||
userSettings.onUseSystemFontChanged(use)
|
||||
}
|
||||
|
||||
SettingsKeys.KEY_SHOW_DEBUG_CATEGORY -> {
|
||||
val show = newValue as? Boolean ?: false
|
||||
userSettings.onShowDebugCategoryChanged(show)
|
||||
@@ -409,7 +414,7 @@ class SettingsViewModelImpl(
|
||||
)
|
||||
val debugEnableHaptic = SettingsItem.Switch(
|
||||
key = SettingsKeys.KEY_DEBUG_ENABLE_HAPTIC,
|
||||
defaultValue = true,
|
||||
defaultValue = SettingsKeys.DEFAULT_DEBUG_ENABLE_HAPTIC,
|
||||
title = UiText.Simple("Enable haptic")
|
||||
)
|
||||
|
||||
@@ -435,6 +440,12 @@ class SettingsViewModelImpl(
|
||||
}
|
||||
}
|
||||
|
||||
val debugUseSystemFont = SettingsItem.Switch(
|
||||
key = SettingsKeys.KEY_DEBUG_USE_SYSTEM_FONT,
|
||||
defaultValue = SettingsKeys.DEFAULT_DEBUG_USE_SYSTEM_FONT,
|
||||
title = UiText.Simple("Use system font")
|
||||
)
|
||||
|
||||
val debugHideDebugList = SettingsItem.TitleText(
|
||||
key = SettingsKeys.KEY_DEBUG_HIDE_DEBUG_LIST,
|
||||
title = UiText.Simple("Hide debug list")
|
||||
@@ -475,7 +486,8 @@ class SettingsViewModelImpl(
|
||||
debugShowEmojiButton,
|
||||
debugShowTimeInActionMessages,
|
||||
debugEnableHaptic,
|
||||
debugNetworkLogLevel
|
||||
debugNetworkLogLevel,
|
||||
debugUseSystemFont
|
||||
).forEach(debugList::add)
|
||||
|
||||
debugList += debugHideDebugList
|
||||
|
||||
+1
-4
@@ -161,10 +161,7 @@ fun SettingsScreen(
|
||||
modifier = Modifier
|
||||
.then(
|
||||
if (themeConfig.enableBlur) {
|
||||
Modifier.haze(
|
||||
state = hazeState,
|
||||
style = HazeMaterials.thick()
|
||||
)
|
||||
Modifier.haze(state = hazeState)
|
||||
} else Modifier
|
||||
)
|
||||
.fillMaxWidth()
|
||||
|
||||
Reference in New Issue
Block a user