mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-29 04:39:53 +00:00
android, desktop: compose 1.8.0-beta01 + Kotlin 2.1.20 + compileSdk 35
This commit is contained in:
parent
15742aee30
commit
b67d85f4f5
12 changed files with 26 additions and 16 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -79,3 +79,4 @@ website/package-lock.json
|
||||||
website/.cache
|
website/.cache
|
||||||
website/test/stubs-layout-cache/_includes/*.js
|
website/test/stubs-layout-cache/_includes/*.js
|
||||||
apps/android/app/release
|
apps/android/app/release
|
||||||
|
apps/multiplatform/.kotlin/sessions
|
||||||
|
|
|
@ -5,10 +5,11 @@ plugins {
|
||||||
id("org.jetbrains.compose")
|
id("org.jetbrains.compose")
|
||||||
kotlin("android")
|
kotlin("android")
|
||||||
id("org.jetbrains.kotlin.plugin.serialization")
|
id("org.jetbrains.kotlin.plugin.serialization")
|
||||||
|
id("org.jetbrains.kotlin.plugin.compose")
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk = 34
|
compileSdk = 35
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "chat.simplex.app"
|
applicationId = "chat.simplex.app"
|
||||||
|
|
|
@ -3,6 +3,7 @@ plugins {
|
||||||
id("org.jetbrains.compose")
|
id("org.jetbrains.compose")
|
||||||
id("com.android.library")
|
id("com.android.library")
|
||||||
id("org.jetbrains.kotlin.plugin.serialization")
|
id("org.jetbrains.kotlin.plugin.serialization")
|
||||||
|
id("org.jetbrains.kotlin.plugin.compose")
|
||||||
id("dev.icerock.mobile.multiplatform-resources")
|
id("dev.icerock.mobile.multiplatform-resources")
|
||||||
id("com.github.gmazzo.buildconfig") version "5.3.5"
|
id("com.github.gmazzo.buildconfig") version "5.3.5"
|
||||||
}
|
}
|
||||||
|
@ -125,7 +126,7 @@ kotlin {
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "chat.simplex.common"
|
namespace = "chat.simplex.common"
|
||||||
compileSdk = 34
|
compileSdk = 35
|
||||||
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
|
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
|
|
|
@ -26,6 +26,8 @@ import kotlinx.coroutines.flow.*
|
||||||
import kotlinx.coroutines.sync.Mutex
|
import kotlinx.coroutines.sync.Mutex
|
||||||
import kotlin.collections.removeAll as remAll
|
import kotlin.collections.removeAll as remAll
|
||||||
import kotlinx.datetime.*
|
import kotlinx.datetime.*
|
||||||
|
import kotlinx.datetime.Clock
|
||||||
|
import kotlinx.datetime.Instant
|
||||||
import kotlinx.datetime.TimeZone
|
import kotlinx.datetime.TimeZone
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
|
@ -2798,7 +2800,8 @@ fun MutableState<SnapshotStateList<ChatItem>>.removeLastAndNotify(contentTag: Ms
|
||||||
value = SnapshotStateList<ChatItem>().apply {
|
value = SnapshotStateList<ChatItem>().apply {
|
||||||
addAll(value)
|
addAll(value)
|
||||||
val remIndex = lastIndex
|
val remIndex = lastIndex
|
||||||
val rem = removeLast()
|
// note: removeLast() produce NoSuchMethodError on Android but removeLastOrNull() works
|
||||||
|
val rem = removeLastOrNull() ?: return
|
||||||
removed = Triple(rem.id, remIndex, rem.isRcvNew)
|
removed = Triple(rem.id, remIndex, rem.isRcvNew)
|
||||||
}
|
}
|
||||||
chatModel.chatItemsChangesListenerForContent(contentTag)?.removed(listOf(removed), value)
|
chatModel.chatItemsChangesListenerForContent(contentTag)?.removed(listOf(removed), value)
|
||||||
|
|
|
@ -327,7 +327,8 @@ private fun removeDuplicatesAndUpperSplits(
|
||||||
if (idsToTrim.last().isNotEmpty()) {
|
if (idsToTrim.last().isNotEmpty()) {
|
||||||
// it has some elements to trim from currently visible range which means the items shouldn't be trimmed
|
// it has some elements to trim from currently visible range which means the items shouldn't be trimmed
|
||||||
// Otherwise, the last set would be empty
|
// Otherwise, the last set would be empty
|
||||||
idsToTrim.removeLast()
|
// note: removeLast() produce NoSuchMethodError on Android but removeLastOrNull() works
|
||||||
|
idsToTrim.removeLastOrNull()
|
||||||
}
|
}
|
||||||
val allItemsToDelete = idsToTrim.flatten()
|
val allItemsToDelete = idsToTrim.flatten()
|
||||||
if (allItemsToDelete.isNotEmpty()) {
|
if (allItemsToDelete.isNotEmpty()) {
|
||||||
|
|
|
@ -58,6 +58,7 @@ class ProcessedErrors <T: AgentErrorType>(val interval: Long) {
|
||||||
text = generalGetString(MR.strings.agent_internal_error_desc).format(error.internalErr),
|
text = generalGetString(MR.strings.agent_internal_error_desc).format(error.internalErr),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
else -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ import chat.simplex.res.MR
|
||||||
import java.text.DecimalFormat
|
import java.text.DecimalFormat
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ModalData.AdvancedNetworkSettingsView(showModal: (ModalData.() -> Unit) -> Unit, close: () -> Unit) {
|
fun ModalData.AdvancedNetworkSettingsView(showModal: (@Composable ModalData.() -> Unit) -> Unit, close: () -> Unit) {
|
||||||
val currentRemoteHost by remember { chatModel.currentRemoteHost }
|
val currentRemoteHost by remember { chatModel.currentRemoteHost }
|
||||||
val developerTools = remember { appPrefs.developerTools.get() }
|
val developerTools = remember { appPrefs.developerTools.get() }
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ fun ModalData.AdvancedNetworkSettingsView(showModal: (ModalData.() -> Unit) -> U
|
||||||
updateSessionMode: (TransportSessionMode) -> Unit,
|
updateSessionMode: (TransportSessionMode) -> Unit,
|
||||||
updateSMPProxyMode: (SMPProxyMode) -> Unit,
|
updateSMPProxyMode: (SMPProxyMode) -> Unit,
|
||||||
updateSMPProxyFallback: (SMPProxyFallback) -> Unit,
|
updateSMPProxyFallback: (SMPProxyFallback) -> Unit,
|
||||||
showModal: (ModalData.() -> Unit) -> Unit,
|
showModal: (@Composable ModalData.() -> Unit) -> Unit,
|
||||||
resetDisabled: Boolean,
|
resetDisabled: Boolean,
|
||||||
reset: () -> Unit,
|
reset: () -> Unit,
|
||||||
saveDisabled: Boolean,
|
saveDisabled: Boolean,
|
||||||
|
|
|
@ -93,7 +93,7 @@ actual fun LazyColumnWithScrollBar(
|
||||||
}
|
}
|
||||||
val modifier = if (fillMaxSize) Modifier.fillMaxSize().then(modifier) else modifier
|
val modifier = if (fillMaxSize) Modifier.fillMaxSize().then(modifier) else modifier
|
||||||
Box(Modifier.copyViewToAppBar(remember { appPrefs.appearanceBarsBlurRadius.state }.value, LocalAppBarHandler.current?.graphicsLayer).nestedScroll(connection)) {
|
Box(Modifier.copyViewToAppBar(remember { appPrefs.appearanceBarsBlurRadius.state }.value, LocalAppBarHandler.current?.graphicsLayer).nestedScroll(connection)) {
|
||||||
LazyColumn(modifier.then(scrollModifier), state, contentPadding, reverseLayout, verticalArrangement, horizontalAlignment, flingBehavior, userScrollEnabled, content)
|
LazyColumn(modifier.then(scrollModifier), state, contentPadding, reverseLayout, verticalArrangement, horizontalAlignment, flingBehavior, userScrollEnabled, content = content)
|
||||||
ScrollBar(reverseLayout, state, scrollBarAlpha, scrollJob, scrollBarDraggingState, additionalBarOffset, additionalTopBar, chatBottomBar)
|
ScrollBar(reverseLayout, state, scrollBarAlpha, scrollJob, scrollBarDraggingState, additionalBarOffset, additionalTopBar, chatBottomBar)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ actual fun LazyColumnWithScrollBarNoAppBar(
|
||||||
// (only first visible row is useful because LazyColumn doesn't have absolute scroll position, only relative to row)
|
// (only first visible row is useful because LazyColumn doesn't have absolute scroll position, only relative to row)
|
||||||
val scrollBarDraggingState = remember { mutableStateOf(false) }
|
val scrollBarDraggingState = remember { mutableStateOf(false) }
|
||||||
Box(contentAlignment = containerAlignment) {
|
Box(contentAlignment = containerAlignment) {
|
||||||
LazyColumn(modifier.then(scrollModifier), state, contentPadding, reverseLayout, verticalArrangement, horizontalAlignment, flingBehavior, userScrollEnabled, content)
|
LazyColumn(modifier.then(scrollModifier), state, contentPadding, reverseLayout, verticalArrangement, horizontalAlignment, flingBehavior, userScrollEnabled, content = content)
|
||||||
Box(if (maxHeight?.value != null) Modifier.height(maxHeight.value).fillMaxWidth() else Modifier.fillMaxSize(), contentAlignment = Alignment.CenterEnd) {
|
Box(if (maxHeight?.value != null) Modifier.height(maxHeight.value).fillMaxWidth() else Modifier.fillMaxSize(), contentAlignment = Alignment.CenterEnd) {
|
||||||
DesktopScrollBar(rememberScrollbarAdapter(state), Modifier.fillMaxHeight(), scrollBarAlpha, scrollJob, reverseLayout, scrollBarDraggingState)
|
DesktopScrollBar(rememberScrollbarAdapter(state), Modifier.fillMaxHeight(), scrollBarAlpha, scrollJob, reverseLayout, scrollBarDraggingState)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
|
import org.gradle.internal.extensions.stdlib.toDefaultLowerCase
|
||||||
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
|
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
|
||||||
import org.jetbrains.kotlin.util.capitalizeDecapitalize.toLowerCaseAsciiOnly
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform")
|
kotlin("multiplatform")
|
||||||
id("org.jetbrains.compose")
|
id("org.jetbrains.compose")
|
||||||
|
id("org.jetbrains.kotlin.plugin.compose")
|
||||||
id("io.github.tomtzook.gradle-cmake") version "1.2.2"
|
id("io.github.tomtzook.gradle-cmake") version "1.2.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +90,7 @@ compose {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val os = System.getProperty("os.name", "generic").toLowerCaseAsciiOnly()
|
val os = System.getProperty("os.name", "generic").toDefaultLowerCase()
|
||||||
if (os.contains("mac") || os.contains("win")) {
|
if (os.contains("mac") || os.contains("win")) {
|
||||||
packageName = "SimpleX"
|
packageName = "SimpleX"
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -30,9 +30,9 @@ android.version_code=279
|
||||||
desktop.version_name=6.3
|
desktop.version_name=6.3
|
||||||
desktop.version_code=96
|
desktop.version_code=96
|
||||||
|
|
||||||
kotlin.version=1.9.23
|
kotlin.version=2.1.20
|
||||||
gradle.plugin.version=8.2.0
|
gradle.plugin.version=8.7.0
|
||||||
compose.version=1.7.0
|
compose.version=1.8.0-beta01
|
||||||
|
|
||||||
# Choose sqlite or postgres backend
|
# Choose sqlite or postgres backend
|
||||||
database.backend=sqlite
|
database.backend=sqlite
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#Mon Feb 14 14:23:51 GMT 2022
|
#Fri Mar 21 20:38:56 ICT 2025
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
|
|
@ -12,6 +12,7 @@ pluginManagement {
|
||||||
id("com.android.application").version(extra["gradle.plugin.version"] as String)
|
id("com.android.application").version(extra["gradle.plugin.version"] as String)
|
||||||
id("com.android.library").version(extra["gradle.plugin.version"] as String)
|
id("com.android.library").version(extra["gradle.plugin.version"] as String)
|
||||||
id("org.jetbrains.compose").version(extra["compose.version"] as String)
|
id("org.jetbrains.compose").version(extra["compose.version"] as String)
|
||||||
|
id("org.jetbrains.kotlin.plugin.compose").version(extra["kotlin.version"] as String)
|
||||||
id("org.jetbrains.kotlin.plugin.serialization").version(extra["kotlin.version"] as String)
|
id("org.jetbrains.kotlin.plugin.serialization").version(extra["kotlin.version"] as String)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue