diff --git a/build.gradle b/build.gradle index aa0dac9..7bcba9f 100644 --- a/build.gradle +++ b/build.gradle @@ -52,9 +52,11 @@ ext.applyLibraryPlugins = { project -> project.apply plugin: 'kotlin-android' } +ext.androidSdkVersion = 31 + ext.applyCommonAndroidParameters = { project -> def android = project.android - android.compileSdk 31 + android.compileSdk androidSdkVersion android.compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -62,7 +64,7 @@ ext.applyCommonAndroidParameters = { project -> } android.defaultConfig { minSdkVersion 29 - targetSdkVersion 31 + targetSdkVersion androidSdkVersion } android.buildFeatures.compose = true diff --git a/design-library/src/main/kotlin/app/dapk/st/design/components/Theme.kt b/design-library/src/main/kotlin/app/dapk/st/design/components/Theme.kt index c992f69..46e4d3c 100644 --- a/design-library/src/main/kotlin/app/dapk/st/design/components/Theme.kt +++ b/design-library/src/main/kotlin/app/dapk/st/design/components/Theme.kt @@ -24,6 +24,8 @@ private val DARK_EXTENDED = ExtendedColors( onSelfBubble = DARK_COLOURS.onPrimary, othersBubble = Color(0x20EDEDED), onOthersBubble = Color(0xFF000000), + selfBubbleReplyBackground = Color(0x40EAEAEA), + otherBubbleReplyBackground = Color(0x20EAEAEA), missingImageColors = listOf( Color(0xFFf7c7f7) to Color(0xFFdf20de), Color(0xFFe5d7f6) to Color(0xFF7b30cf), @@ -38,6 +40,8 @@ data class ExtendedColors( val onSelfBubble: Color, val othersBubble: Color, val onOthersBubble: Color, + val selfBubbleReplyBackground: Color, + val otherBubbleReplyBackground: Color, val missingImageColors: List>, ) { fun getMissingImageColor(key: String): Pair { diff --git a/domains/android/stub/build.gradle b/domains/android/stub/build.gradle index 46ba458..8ee9c3d 100644 --- a/domains/android/stub/build.gradle +++ b/domains/android/stub/build.gradle @@ -12,9 +12,8 @@ if (localProperties.exists()) { } dependencies { - def androidVer = 31 + def androidVer = androidSdkVersion kotlinFixtures(it) testFixturesImplementation testFixtures(project(":core")) testFixturesImplementation files("${properties.getProperty("sdk.dir")}/platforms/android-${androidVer}/android.jar") - } \ No newline at end of file diff --git a/domains/android/viewmodel-stub/src/main/kotlin/androidx/compose/runtime/MutableState.kt b/domains/android/viewmodel-stub/src/main/kotlin/androidx/compose/runtime/MutableState.kt index 1462fa5..543df16 100644 --- a/domains/android/viewmodel-stub/src/main/kotlin/androidx/compose/runtime/MutableState.kt +++ b/domains/android/viewmodel-stub/src/main/kotlin/androidx/compose/runtime/MutableState.kt @@ -1,5 +1,4 @@ @file:JvmName("SnapshotStateKt") -@file:JvmMultifileClass package androidx.compose.runtime @@ -20,4 +19,16 @@ operator fun MutableState.setValue(thisObj: Any?, property: KProperty<*>, throw RuntimeException("stub") } -fun mutableStateOf(value: T): MutableState = throw RuntimeException("stub") +fun mutableStateOf( + value: T, + policy: SnapshotMutationPolicy = object : SnapshotMutationPolicy { + override fun equivalent(a: T, b: T): Boolean { + throw RuntimeException("stub") + } + } +): MutableState = throw RuntimeException("stub") + +interface SnapshotMutationPolicy { + fun equivalent(a: T, b: T): Boolean + fun merge(previous: T, current: T, applied: T): T? = null +} diff --git a/features/messenger/src/main/kotlin/app/dapk/st/messenger/MessengerScreen.kt b/features/messenger/src/main/kotlin/app/dapk/st/messenger/MessengerScreen.kt index cf1a3d2..14672c8 100644 --- a/features/messenger/src/main/kotlin/app/dapk/st/messenger/MessengerScreen.kt +++ b/features/messenger/src/main/kotlin/app/dapk/st/messenger/MessengerScreen.kt @@ -336,10 +336,10 @@ private fun ReplyBubbleContent(shape: RoundedCornerShape, background: Color, isN ) { Column( Modifier - .background(Color.Blue) + .background(if (isNotSelf) SmallTalkTheme.extendedColors.otherBubbleReplyBackground else SmallTalkTheme.extendedColors.selfBubbleReplyBackground) .padding(4.dp) ) { - val replyName = if (!isNotSelf && reply.replyingToSelf) "You" else reply.message.author.displayName ?: reply.message.author.id.value + val replyName = if (!isNotSelf && reply.replyingToSelf) "You" else reply.replyingTo.author.displayName ?: reply.replyingTo.author.id.value Text( fontSize = 11.sp, text = replyName,