mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-28 02:54:34 +00:00
android, desktop: update dependencies (#3954)
Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
This commit is contained in:
co-authored by
Evgeny Poberezkin
parent
a5817d9feb
commit
154ce5843d
@@ -8,12 +8,14 @@ plugins {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion(34)
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "chat.simplex.app"
|
||||
minSdkVersion(28)
|
||||
targetSdkVersion(33)
|
||||
namespace = "chat.simplex.app"
|
||||
minSdk = 28
|
||||
//noinspection OldTargetApi
|
||||
targetSdk = 33
|
||||
// !!!
|
||||
// skip version code after release to F-Droid, as it uses two version codes
|
||||
versionCode = (extra["android.version_code"] as String).toInt()
|
||||
@@ -47,11 +49,11 @@ android {
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
jvmTarget = "11"
|
||||
freeCompilerArgs += "-opt-in=kotlinx.coroutines.DelicateCoroutinesApi"
|
||||
freeCompilerArgs += "-opt-in=androidx.compose.foundation.ExperimentalFoundationApi"
|
||||
freeCompilerArgs += "-opt-in=androidx.compose.ui.text.ExperimentalTextApi"
|
||||
@@ -71,18 +73,20 @@ android {
|
||||
isMinifyEnabled = false
|
||||
}
|
||||
}
|
||||
packagingOptions {
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
packaging {
|
||||
resources {
|
||||
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
||||
}
|
||||
jniLibs.useLegacyPackaging = rootProject.extra["compression.level"] as Int != 0
|
||||
}
|
||||
android.sourceSets["main"].assets.setSrcDirs(listOf("../common/src/commonMain/resources/assets"))
|
||||
val isRelease = gradle.startParameter.taskNames.find { it.toLowerCase().contains("release") } != null
|
||||
val isBundle = gradle.startParameter.taskNames.find { it.toLowerCase().contains("bundle") } != null
|
||||
// if (isRelease) {
|
||||
val isRelease = gradle.startParameter.taskNames.find { it.lowercase().contains("release") } != null
|
||||
val isBundle = gradle.startParameter.taskNames.find { it.lowercase().contains("bundle") } != null
|
||||
// Comma separated list of languages that will be included in the apk
|
||||
android.defaultConfig.resConfigs(
|
||||
android.defaultConfig.resourceConfigurations += listOf(
|
||||
"en",
|
||||
"ar",
|
||||
"bg",
|
||||
@@ -104,7 +108,7 @@ android {
|
||||
"uk",
|
||||
"zh-rCN"
|
||||
)
|
||||
// }
|
||||
ndkVersion = "23.1.7779620"
|
||||
if (isBundle) {
|
||||
defaultConfig.ndk.abiFilters("arm64-v8a", "armeabi-v7a")
|
||||
} else {
|
||||
@@ -125,41 +129,41 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation(project(":common"))
|
||||
implementation("androidx.core:core-ktx:1.7.0")
|
||||
implementation("androidx.core:core-ktx:1.12.0")
|
||||
//implementation("androidx.compose.ui:ui:${rootProject.extra["compose.version"] as String}")
|
||||
//implementation("androidx.compose.material:material:$compose_version")
|
||||
//implementation("androidx.compose.ui:ui-tooling-preview:$compose_version")
|
||||
implementation("androidx.appcompat:appcompat:1.5.1")
|
||||
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.1")
|
||||
implementation("androidx.lifecycle:lifecycle-process:2.4.1")
|
||||
implementation("androidx.activity:activity-compose:1.5.0")
|
||||
val work_version = "2.7.1"
|
||||
implementation("androidx.work:work-runtime-ktx:$work_version")
|
||||
implementation("androidx.work:work-multiprocess:$work_version")
|
||||
implementation("androidx.appcompat:appcompat:1.6.1")
|
||||
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
|
||||
implementation("androidx.lifecycle:lifecycle-process:2.7.0")
|
||||
implementation("androidx.activity:activity-compose:1.8.2")
|
||||
val workVersion = "2.9.0"
|
||||
implementation("androidx.work:work-runtime-ktx:$workVersion")
|
||||
implementation("androidx.work:work-multiprocess:$workVersion")
|
||||
|
||||
implementation("com.jakewharton:process-phoenix:2.1.2")
|
||||
implementation("com.jakewharton:process-phoenix:2.2.0")
|
||||
|
||||
//implementation("androidx.compose.material:material-icons-extended:$compose_version")
|
||||
//implementation("androidx.compose.ui:ui-util:$compose_version")
|
||||
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.3")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
||||
//androidTestImplementation("androidx.compose.ui:ui-test-junit4:$compose_version")
|
||||
debugImplementation("androidx.compose.ui:ui-tooling:1.4.3")
|
||||
debugImplementation("androidx.compose.ui:ui-tooling:1.6.4")
|
||||
}
|
||||
|
||||
tasks {
|
||||
val compressApk by creating {
|
||||
doLast {
|
||||
val isRelease = gradle.startParameter.taskNames.find { it.toLowerCase().contains("release") } != null
|
||||
val isRelease = gradle.startParameter.taskNames.find { it.lowercase().contains("release") } != null
|
||||
val buildType: String = if (isRelease) "release" else "debug"
|
||||
val javaHome = System.getProperties()["java.home"] ?: org.gradle.internal.jvm.Jvm.current().javaHome
|
||||
val sdkDir = android.sdkDirectory.absolutePath
|
||||
var keyAlias = ""
|
||||
var keyPassword = ""
|
||||
var storeFile = ""
|
||||
var storePassword = ""
|
||||
val keyAlias: String
|
||||
val keyPassword: String
|
||||
val storeFile: String
|
||||
val storePassword: String
|
||||
if (project.properties["android.injected.signing.key.alias"] != null) {
|
||||
keyAlias = project.properties["android.injected.signing.key.alias"] as String
|
||||
keyPassword = project.properties["android.injected.signing.key.password"] as String
|
||||
@@ -184,16 +188,16 @@ tasks {
|
||||
}
|
||||
exec {
|
||||
workingDir("../../../scripts/android")
|
||||
setEnvironment(mapOf("JAVA_HOME" to "$javaHome"))
|
||||
environment = mapOf("JAVA_HOME" to "$javaHome")
|
||||
commandLine = listOf(
|
||||
"./compress-and-sign-apk.sh",
|
||||
"${rootProject.extra["compression.level"]}",
|
||||
"$outputDir",
|
||||
"$sdkDir",
|
||||
"$storeFile",
|
||||
"$storePassword",
|
||||
"$keyAlias",
|
||||
"$keyPassword"
|
||||
sdkDir,
|
||||
storeFile,
|
||||
storePassword,
|
||||
keyAlias,
|
||||
keyPassword
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.content.*
|
||||
import android.content.pm.PackageManager
|
||||
import android.net.Uri
|
||||
import android.os.*
|
||||
import android.os.SystemClock
|
||||
import android.provider.Settings
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material.*
|
||||
|
||||
+2
-1
@@ -4,6 +4,7 @@ import android.app.*
|
||||
import android.app.TaskStackBuilder
|
||||
import android.content.*
|
||||
import android.content.pm.PackageManager
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.BitmapFactory
|
||||
import android.hardware.display.DisplayManager
|
||||
import android.media.AudioAttributes
|
||||
@@ -218,7 +219,7 @@ object NtfManager {
|
||||
.setGroup(MessageGroup)
|
||||
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN)
|
||||
.setSmallIcon(R.drawable.ntf_icon)
|
||||
.setLargeIcon(null)
|
||||
.setLargeIcon(null as Bitmap?)
|
||||
.setColor(0x88FFFF)
|
||||
.setAutoCancel(true)
|
||||
.setVibrate(null)
|
||||
|
||||
@@ -47,6 +47,9 @@ buildscript {
|
||||
classpath(kotlin("gradle-plugin", version = rootProject.extra["kotlin.version"] as String))
|
||||
classpath("dev.icerock.moko:resources-generator:0.23.0")
|
||||
|
||||
// Workaround gradle sync issue: https://github.com/gmazzo/gradle-buildconfig-plugin/issues/137#issuecomment-1935739759
|
||||
classpath("com.squareup:kotlinpoet:1.16.0")
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
|
||||
@@ -4,17 +4,18 @@ plugins {
|
||||
id("com.android.library")
|
||||
id("org.jetbrains.kotlin.plugin.serialization")
|
||||
id("dev.icerock.mobile.multiplatform-resources")
|
||||
id("com.github.gmazzo.buildconfig") version "4.0.4"
|
||||
id("com.github.gmazzo.buildconfig") version "5.3.5"
|
||||
}
|
||||
|
||||
group = "chat.simplex"
|
||||
version = extra["android.version_name"] as String
|
||||
|
||||
kotlin {
|
||||
android()
|
||||
androidTarget()
|
||||
jvm("desktop") {
|
||||
jvmToolchain(11)
|
||||
}
|
||||
applyDefaultHierarchyTemplate()
|
||||
sourceSets {
|
||||
all {
|
||||
languageSettings {
|
||||
@@ -35,20 +36,20 @@ kotlin {
|
||||
api(compose.runtime)
|
||||
api(compose.foundation)
|
||||
api(compose.material)
|
||||
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.3.2")
|
||||
api("com.russhwolf:multiplatform-settings:1.0.0")
|
||||
api("com.charleskorn.kaml:kaml:0.43.0")
|
||||
api("dev.icerock.moko:resources-compose:0.23.0")
|
||||
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.5.0")
|
||||
api("com.russhwolf:multiplatform-settings:1.1.1")
|
||||
api("com.charleskorn.kaml:kaml:0.58.0")
|
||||
api("org.jetbrains.compose.ui:ui-text:${rootProject.extra["compose.version"] as String}")
|
||||
implementation("org.jetbrains.compose.components:components-animatedimage:${rootProject.extra["compose.version"] as String}")
|
||||
//Barcode
|
||||
api("org.boofcv:boofcv-core:0.40.1")
|
||||
api("org.boofcv:boofcv-core:1.1.3")
|
||||
implementation("com.godaddy.android.colorpicker:compose-color-picker-jvm:0.7.0")
|
||||
// Link Previews
|
||||
implementation("org.jsoup:jsoup:1.13.1")
|
||||
implementation("org.jsoup:jsoup:1.17.2")
|
||||
// Resources
|
||||
implementation("dev.icerock.moko:resources:0.23.0")
|
||||
api("dev.icerock.moko:resources:0.23.0")
|
||||
api("dev.icerock.moko:resources-compose:0.23.0")
|
||||
}
|
||||
}
|
||||
val commonTest by getting {
|
||||
@@ -57,47 +58,47 @@ kotlin {
|
||||
}
|
||||
}
|
||||
val androidMain by getting {
|
||||
kotlin.srcDir("build/generated/moko/androidMain/src")
|
||||
dependencies {
|
||||
implementation("androidx.activity:activity-compose:1.5.0")
|
||||
val work_version = "2.7.1"
|
||||
implementation("androidx.work:work-runtime-ktx:$work_version")
|
||||
implementation("com.google.accompanist:accompanist-insets:0.23.0")
|
||||
implementation("dev.icerock.moko:resources:0.23.0")
|
||||
implementation("androidx.activity:activity-compose:1.8.2")
|
||||
val workVersion = "2.9.0"
|
||||
implementation("androidx.work:work-runtime-ktx:$workVersion")
|
||||
implementation("com.google.accompanist:accompanist-insets:0.30.1")
|
||||
|
||||
// Video support
|
||||
implementation("com.google.android.exoplayer:exoplayer:2.17.1")
|
||||
implementation("com.google.android.exoplayer:exoplayer:2.19.1")
|
||||
|
||||
// Biometric authentication
|
||||
implementation("androidx.biometric:biometric:1.2.0-alpha04")
|
||||
implementation("androidx.biometric:biometric:1.2.0-alpha05")
|
||||
|
||||
//Barcode
|
||||
implementation("org.boofcv:boofcv-android:0.40.1")
|
||||
implementation("org.boofcv:boofcv-android:1.1.3")
|
||||
|
||||
//Camera Permission
|
||||
implementation("com.google.accompanist:accompanist-permissions:0.23.0")
|
||||
implementation("com.google.accompanist:accompanist-permissions:0.34.0")
|
||||
|
||||
implementation("androidx.webkit:webkit:1.4.0")
|
||||
implementation("androidx.webkit:webkit:1.10.0")
|
||||
|
||||
// GIFs support
|
||||
implementation("io.coil-kt:coil-compose:2.1.0")
|
||||
implementation("io.coil-kt:coil-gif:2.1.0")
|
||||
implementation("io.coil-kt:coil-compose:2.6.0")
|
||||
implementation("io.coil-kt:coil-gif:2.6.0")
|
||||
|
||||
implementation("com.jakewharton:process-phoenix:2.1.2")
|
||||
implementation("com.jakewharton:process-phoenix:2.2.0")
|
||||
|
||||
val camerax_version = "1.1.0-beta01"
|
||||
implementation("androidx.camera:camera-core:${camerax_version}")
|
||||
implementation("androidx.camera:camera-camera2:${camerax_version}")
|
||||
implementation("androidx.camera:camera-lifecycle:${camerax_version}")
|
||||
implementation("androidx.camera:camera-view:${camerax_version}")
|
||||
val cameraXVersion = "1.3.2"
|
||||
implementation("androidx.camera:camera-core:${cameraXVersion}")
|
||||
implementation("androidx.camera:camera-camera2:${cameraXVersion}")
|
||||
implementation("androidx.camera:camera-lifecycle:${cameraXVersion}")
|
||||
implementation("androidx.camera:camera-view:${cameraXVersion}")
|
||||
}
|
||||
}
|
||||
val desktopMain by getting {
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.7.1")
|
||||
implementation("com.github.Dansoftowner:jSystemThemeDetector:3.6")
|
||||
implementation("com.sshtools:two-slices:0.9.0-SNAPSHOT")
|
||||
implementation("org.slf4j:slf4j-simple:2.0.7")
|
||||
implementation("uk.co.caprica:vlcj:4.7.3")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.8.0")
|
||||
implementation("com.github.Dansoftowner:jSystemThemeDetector:3.8")
|
||||
implementation("com.sshtools:two-slices:0.9.3")
|
||||
implementation("org.slf4j:slf4j-simple:2.0.12")
|
||||
implementation("uk.co.caprica:vlcj:4.8.2")
|
||||
implementation("com.github.NanoHttpd.nanohttpd:nanohttpd:efb2ebf85a")
|
||||
implementation("com.github.NanoHttpd.nanohttpd:nanohttpd-websocket:efb2ebf85a")
|
||||
}
|
||||
@@ -107,23 +108,25 @@ kotlin {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion(34)
|
||||
namespace = "chat.simplex.common"
|
||||
compileSdk = 34
|
||||
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
|
||||
defaultConfig {
|
||||
minSdkVersion(28)
|
||||
targetSdkVersion(33)
|
||||
minSdk = 28
|
||||
}
|
||||
testOptions.targetSdk = 33
|
||||
lint.targetSdk = 33
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
val isAndroid = gradle.startParameter.taskNames.find {
|
||||
val lower = it.toLowerCase()
|
||||
val lower = it.lowercase()
|
||||
lower.contains("release") || lower.startsWith("assemble") || lower.startsWith("install")
|
||||
} != null
|
||||
if (isAndroid) {
|
||||
// This is not needed on Android but can't be moved to desktopMain because MR lib don't support this.
|
||||
// No other ways to exclude a file work but it's large and should be excluded
|
||||
// No other ways to exclude a file work, but it's large and should be excluded
|
||||
kotlin.sourceSets["commonMain"].resources.exclude("/MR/fonts/NotoColorEmoji-Regular.ttf")
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -15,6 +15,7 @@ import chat.simplex.common.platform.FileChooserLauncher
|
||||
import chat.simplex.common.platform.saveImage
|
||||
import chat.simplex.common.views.helpers.*
|
||||
import chat.simplex.res.MR
|
||||
import com.google.accompanist.permissions.PermissionStatus
|
||||
import com.google.accompanist.permissions.rememberPermissionState
|
||||
import dev.icerock.moko.resources.compose.painterResource
|
||||
import dev.icerock.moko.resources.compose.stringResource
|
||||
@@ -30,7 +31,7 @@ actual fun SaveContentItemAction(cItem: ChatItem, saveFileLauncher: FileChooserL
|
||||
ItemAction(stringResource(MR.strings.save_verb), painterResource(if (cItem.file?.fileSource?.cryptoArgs == null) MR.images.ic_download else MR.images.ic_lock_open_right), onClick = {
|
||||
when (cItem.content.msgContent) {
|
||||
is MsgContent.MCImage -> {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R || writePermissionState.hasPermission) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R || writePermissionState.status == PermissionStatus.Granted) {
|
||||
saveImage(cItem.file)
|
||||
} else {
|
||||
writePermissionState.launchPermissionRequest()
|
||||
|
||||
+8
-4
@@ -11,6 +11,7 @@ import androidx.camera.view.PreviewView
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material.*
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clipToBounds
|
||||
@@ -27,6 +28,7 @@ import chat.simplex.common.platform.TAG
|
||||
import chat.simplex.common.ui.theme.DEFAULT_PADDING_HALF
|
||||
import chat.simplex.common.views.helpers.*
|
||||
import chat.simplex.res.MR
|
||||
import com.google.accompanist.permissions.PermissionStatus
|
||||
import com.google.accompanist.permissions.rememberPermissionState
|
||||
import com.google.common.util.concurrent.ListenableFuture
|
||||
import dev.icerock.moko.resources.compose.painterResource
|
||||
@@ -65,7 +67,7 @@ actual fun QRCodeScanner(
|
||||
.widthIn(max = 400.dp)
|
||||
.aspectRatio(1f)
|
||||
val showScanner = remember { showQRCodeScanner }
|
||||
if (showScanner.value && cameraPermissionState.hasPermission) {
|
||||
if (showScanner.value && cameraPermissionState.status == PermissionStatus.Granted) {
|
||||
AndroidView(
|
||||
factory = { AndroidViewContext ->
|
||||
PreviewView(AndroidViewContext).apply {
|
||||
@@ -126,20 +128,22 @@ actual fun QRCodeScanner(
|
||||
disabledBackgroundColor = MaterialTheme.colors.background.mixWith(MaterialTheme.colors.onBackground, 0.9f),
|
||||
disabledContentColor = MaterialTheme.colors.primary,
|
||||
)
|
||||
var permissionRequested by rememberSaveable { mutableStateOf(false) }
|
||||
when {
|
||||
!cameraPermissionState.hasPermission && !cameraPermissionState.permissionRequested && showScanner.value -> {
|
||||
cameraPermissionState.status is PermissionStatus.Denied && !permissionRequested && showScanner.value -> {
|
||||
LaunchedEffect(Unit) {
|
||||
permissionRequested = true
|
||||
cameraPermissionState.launchPermissionRequest()
|
||||
}
|
||||
}
|
||||
!cameraPermissionState.hasPermission -> {
|
||||
cameraPermissionState.status is PermissionStatus.Denied -> {
|
||||
Button({ cameraPermissionState.launchPermissionRequest() }, modifier = modifier, colors = buttonColors) {
|
||||
Icon(painterResource(MR.images.ic_camera_enhance), null)
|
||||
Spacer(Modifier.width(DEFAULT_PADDING_HALF))
|
||||
Text(stringResource(MR.strings.enable_camera_access))
|
||||
}
|
||||
}
|
||||
cameraPermissionState.hasPermission -> {
|
||||
cameraPermissionState.status == PermissionStatus.Granted -> {
|
||||
Button({ showQRCodeScanner.value = true }, modifier = modifier, colors = buttonColors) {
|
||||
Icon(painterResource(MR.images.ic_qr_code), null)
|
||||
Spacer(Modifier.width(DEFAULT_PADDING_HALF))
|
||||
|
||||
+3
-2
@@ -5,14 +5,15 @@ import android.os.Build
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import chat.simplex.common.platform.ntfManager
|
||||
import com.google.accompanist.permissions.PermissionStatus
|
||||
import com.google.accompanist.permissions.rememberPermissionState
|
||||
|
||||
@Composable
|
||||
actual fun SetNotificationsModeAdditions() {
|
||||
if (Build.VERSION.SDK_INT >= 33) {
|
||||
val notificationsPermissionState = rememberPermissionState(Manifest.permission.POST_NOTIFICATIONS)
|
||||
LaunchedEffect(notificationsPermissionState.hasPermission) {
|
||||
if (notificationsPermissionState.hasPermission) {
|
||||
LaunchedEffect(notificationsPermissionState.status == PermissionStatus.Granted) {
|
||||
if (notificationsPermissionState.status == PermissionStatus.Granted) {
|
||||
ntfManager.androidCreateNtfChannelsMaybeShowAlert()
|
||||
} else {
|
||||
notificationsPermissionState.launchPermissionRequest()
|
||||
|
||||
@@ -109,6 +109,7 @@ private fun fileReady(file: CIFile, filePath: String) =
|
||||
@Composable
|
||||
expect fun rememberFileChooserLauncher(getContent: Boolean, rememberedValue: Any? = null, onResult: (URI?) -> Unit): FileChooserLauncher
|
||||
|
||||
@Composable
|
||||
expect fun rememberFileChooserMultipleLauncher(onResult: (List<URI>) -> Unit): FileChooserMultipleLauncher
|
||||
|
||||
expect class FileChooserLauncher() {
|
||||
|
||||
@@ -260,6 +260,7 @@ val CurrentColors: MutableStateFlow<ThemeManager.ActiveTheme> = MutableStateFlow
|
||||
@Composable
|
||||
fun isInDarkTheme(): Boolean = !CurrentColors.collectAsState().value.colors.isLight
|
||||
|
||||
@Composable
|
||||
expect fun isSystemInDarkTheme(): Boolean
|
||||
|
||||
fun reactOnDarkThemeChanges(isDark: Boolean) {
|
||||
|
||||
+3
-3
@@ -32,9 +32,9 @@ fun initApp() {
|
||||
//testCrypto()
|
||||
}
|
||||
|
||||
fun discoverVlcLibs(path: String) {
|
||||
uk.co.caprica.vlcj.binding.LibC.INSTANCE.setenv("VLC_PLUGIN_PATH", path, 1)
|
||||
}
|
||||
//fun discoverVlcLibs(path: String) {
|
||||
// uk.co.caprica.vlcj.binding.LibC.INSTANCE.setenv("VLC_PLUGIN_PATH", path, 1)
|
||||
//}
|
||||
|
||||
private fun applyAppLocale() {
|
||||
val lang = ChatController.appPrefs.appLanguage.get()
|
||||
|
||||
+2
@@ -1,5 +1,6 @@
|
||||
package chat.simplex.common.ui.theme
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import chat.simplex.common.platform.Log
|
||||
import chat.simplex.common.platform.TAG
|
||||
import com.jthemedetecor.OsThemeDetector
|
||||
@@ -9,6 +10,7 @@ private val detector: OsThemeDetector = OsThemeDetector.getDetector()
|
||||
registerListener(::reactOnDarkThemeChanges)
|
||||
}
|
||||
|
||||
@Composable
|
||||
actual fun isSystemInDarkTheme(): Boolean = try {
|
||||
detector.isDark
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ kotlin {
|
||||
dependencies {
|
||||
implementation(project(":common"))
|
||||
implementation(compose.desktop.currentOs)
|
||||
implementation("net.java.dev.jna:jna:5.13.0")
|
||||
implementation("net.java.dev.jna:jna:5.14.0")
|
||||
}
|
||||
}
|
||||
val jvmTest by getting
|
||||
|
||||
@@ -31,6 +31,6 @@ android.version_code=191
|
||||
desktop.version_name=5.6
|
||||
desktop.version_code=35
|
||||
|
||||
kotlin.version=1.8.20
|
||||
gradle.plugin.version=7.4.2
|
||||
compose.version=1.5.10
|
||||
kotlin.version=1.9.23
|
||||
gradle.plugin.version=8.2.0
|
||||
compose.version=1.6.1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#Mon Feb 14 14:23:51 GMT 2022
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
Reference in New Issue
Block a user