Release QMAX 1.0.1 with Telegram-style theme editor
This commit is contained in:
@@ -22,8 +22,8 @@ android {
|
||||
applicationId = "xyz.kusoft.qmax"
|
||||
minSdk = 26
|
||||
targetSdk = 36
|
||||
versionCode = 57
|
||||
versionName = "1.0.0"
|
||||
versionCode = 58
|
||||
versionName = "1.0.1"
|
||||
|
||||
buildConfigField("String", "QMAX_DEFAULT_SERVER_URL", "\"https://qmax.kusoft.xyz\"")
|
||||
buildConfigField("String", "QMAX_DEFAULT_PAIRING_CODE", "\"qmax-MxRq4h2HQBEIFs6k\"")
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,9 @@ data class ChatPalette(
|
||||
val outgoingBubble: Int,
|
||||
val messageText: Int,
|
||||
val patternColor: Int,
|
||||
val showPattern: Boolean = true
|
||||
val showPattern: Boolean = true,
|
||||
val outgoingGradientColors: List<Int> = emptyList(),
|
||||
val animateOutgoingGradient: Boolean = false
|
||||
)
|
||||
|
||||
object ChatPalettes {
|
||||
|
||||
@@ -52,6 +52,8 @@ class AppearanceStore(private val context: Context) {
|
||||
val messageText = intPreferencesKey("${prefix}_message_text")
|
||||
val patternColor = intPreferencesKey("${prefix}_pattern_color")
|
||||
val showPattern = booleanPreferencesKey("${prefix}_show_pattern")
|
||||
val outgoingGradientColors = stringPreferencesKey("${prefix}_outgoing_gradient_colors")
|
||||
val animateOutgoingGradient = booleanPreferencesKey("${prefix}_animate_outgoing_gradient")
|
||||
}
|
||||
|
||||
private fun Preferences.readPalette(keys: PaletteKeys, fallback: ChatPalette): ChatPalette {
|
||||
@@ -62,7 +64,13 @@ class AppearanceStore(private val context: Context) {
|
||||
outgoingBubble = this[keys.outgoingBubble] ?: fallback.outgoingBubble,
|
||||
messageText = this[keys.messageText] ?: fallback.messageText,
|
||||
patternColor = this[keys.patternColor] ?: fallback.patternColor,
|
||||
showPattern = this[keys.showPattern] ?: fallback.showPattern
|
||||
showPattern = this[keys.showPattern] ?: fallback.showPattern,
|
||||
outgoingGradientColors = this[keys.outgoingGradientColors]
|
||||
?.split(',')
|
||||
?.mapNotNull { value -> value.toLongOrNull(16)?.toInt() }
|
||||
?.take(4)
|
||||
?: fallback.outgoingGradientColors,
|
||||
animateOutgoingGradient = this[keys.animateOutgoingGradient] ?: fallback.animateOutgoingGradient
|
||||
)
|
||||
}
|
||||
|
||||
@@ -77,5 +85,9 @@ class AppearanceStore(private val context: Context) {
|
||||
this[keys.messageText] = palette.messageText
|
||||
this[keys.patternColor] = palette.patternColor
|
||||
this[keys.showPattern] = palette.showPattern
|
||||
this[keys.outgoingGradientColors] = palette.outgoingGradientColors
|
||||
.take(4)
|
||||
.joinToString(",") { color -> color.toUInt().toString(16) }
|
||||
this[keys.animateOutgoingGradient] = palette.animateOutgoingGradient
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ private data class QMaxThemeColors(
|
||||
val chatBackground: Color,
|
||||
val incomingBubble: Color,
|
||||
val outgoingBubble: Color,
|
||||
val outgoingGradientColors: List<Color>,
|
||||
val animateOutgoingGradient: Boolean,
|
||||
val messageText: Color,
|
||||
val pattern: Color,
|
||||
val showPattern: Boolean,
|
||||
@@ -106,6 +108,16 @@ val QMaxOutgoing: Color
|
||||
@ReadOnlyComposable
|
||||
get() = LocalQMaxColors.current.outgoingBubble
|
||||
|
||||
val QMaxOutgoingGradient: List<Color>
|
||||
@Composable
|
||||
@ReadOnlyComposable
|
||||
get() = LocalQMaxColors.current.outgoingGradientColors
|
||||
|
||||
val QMaxAnimateOutgoingGradient: Boolean
|
||||
@Composable
|
||||
@ReadOnlyComposable
|
||||
get() = LocalQMaxColors.current.animateOutgoingGradient
|
||||
|
||||
val QMaxPattern: Color
|
||||
@Composable
|
||||
@ReadOnlyComposable
|
||||
@@ -174,15 +186,17 @@ private fun colorsFor(
|
||||
return QMaxThemeColors(
|
||||
accent = accent,
|
||||
onAccent = if (accent.luminance() > 0.48f) Color.Black else Color.White,
|
||||
appBackground = if (isDark) Color(0xFF0E1621) else Color(0xFFF3F7FA),
|
||||
surface = if (isDark) Color(0xFF17212B) else Color.White,
|
||||
surfaceVariant = if (isDark) Color(0xFF232E3B) else Color(0xFFE9EEF2),
|
||||
divider = if (isDark) Color(0xFF2A3948) else Color(0xFFE7EEF3),
|
||||
text = if (isDark) Color(0xFFF5F7FA) else Color(0xFF17212B),
|
||||
muted = if (isDark) Color(0xFFA7B3BF) else Color(0xFF6C7883),
|
||||
appBackground = if (isDark) Color(0xFF111416) else Color(0xFFF2F2F4),
|
||||
surface = if (isDark) Color(0xFF1C2023) else Color.White,
|
||||
surfaceVariant = if (isDark) Color(0xFF292E32) else Color(0xFFF0F1F3),
|
||||
divider = if (isDark) Color(0xFF30363A) else Color(0xFFE5E7E9),
|
||||
text = if (isDark) Color(0xFFF4F7F7) else Color(0xFF111617),
|
||||
muted = if (isDark) Color(0xFF9AA3A7) else Color(0xFF858D91),
|
||||
chatBackground = Color(palette.chatBackground),
|
||||
incomingBubble = Color(palette.incomingBubble),
|
||||
outgoingBubble = Color(palette.outgoingBubble),
|
||||
outgoingGradientColors = palette.outgoingGradientColors.map(::Color),
|
||||
animateOutgoingGradient = palette.animateOutgoingGradient,
|
||||
messageText = Color(palette.messageText),
|
||||
pattern = Color(palette.patternColor),
|
||||
showPattern = palette.showPattern,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"slug": "qmax",
|
||||
"name": "QMAX",
|
||||
"version": "1.0.0",
|
||||
"androidVersionCode": 57,
|
||||
"version": "1.0.1",
|
||||
"androidVersionCode": 58,
|
||||
"channel": "stable",
|
||||
"platform": "android",
|
||||
"packageKind": "apk",
|
||||
"downloadPath": "/api/app-updates/android/download/qmax-1.0.0-stable.apk",
|
||||
"packageSizeBytes": 17911217,
|
||||
"sha256": "f21d2f6ed8584ba204560c75fecae6d78041b20f620fb4ef992e11e6a230b5bb",
|
||||
"notes": "QMAX 1.0.0",
|
||||
"publishedAt": "2026-07-15T09:12:25.7697332Z"
|
||||
"downloadPath": "/api/app-updates/android/download/qmax-1.0.1-stable.apk",
|
||||
"packageSizeBytes": 17976753,
|
||||
"sha256": "ff59d69d2b783d53fbd100ffb4354c150f9c342c5a2b24bb4ea9063bac98bcf9",
|
||||
"notes": "QMAX 1.0.1",
|
||||
"publishedAt": "2026-07-15T21:06:52.7275098Z"
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user