yayan преди 1 година
родител
ревизия
31965bc197

+ 1 - 6
app/build.gradle.kts

@@ -5,7 +5,6 @@ plugins {
     alias(libs.plugins.googleDevtoolsKsp)
     alias(libs.plugins.jetbrainsKotlinPluginSerialization)
     id("kotlin-parcelize")
-    kotlin("kapt")
 }
 
 android {
@@ -92,7 +91,7 @@ dependencies {
     implementation(libs.org.jetbrains.coroutines.android)
 
     implementation(libs.com.google.hilt.android)
-    kapt(libs.com.google.hilt.android.compiler)
+    ksp(libs.com.google.hilt.android.compiler)
     implementation(libs.androidx.hilt.navigation)
 
     implementation(project(":cpaas-lite"))
@@ -103,8 +102,4 @@ dependencies {
     androidTestImplementation(libs.androidx.ui.test.junit4)
     debugImplementation(libs.androidx.ui.tooling)
     debugImplementation(libs.androidx.ui.test.manifest)
-}
-
-kapt {
-    correctErrorTypes = true
 }

+ 2 - 1
app/src/main/AndroidManifest.xml

@@ -28,7 +28,8 @@
             android:name=".MainActivity"
             android:exported="true"
             android:theme="@style/Theme.Alpha"
-            android:windowSoftInputMode="adjustResize">
+            android:windowSoftInputMode="adjustResize"
+            android:configChanges="keyboardHidden|screenSize|orientation">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 

+ 6 - 1
app/src/main/java/io/nexilis/alpha/ui/components/Attachments.kt

@@ -6,6 +6,7 @@ import android.net.Uri
 import android.os.Bundle
 import android.os.Parcelable
 import android.provider.OpenableColumns
+import android.util.Log
 import android.widget.Toast
 import androidx.activity.compose.rememberLauncherForActivityResult
 import androidx.activity.result.contract.ActivityResultContracts
@@ -37,6 +38,7 @@ import androidx.compose.runtime.getValue
 import androidx.compose.runtime.mutableStateOf
 import androidx.compose.runtime.remember
 import androidx.compose.runtime.rememberCoroutineScope
+import androidx.compose.runtime.saveable.rememberSaveable
 import androidx.compose.runtime.setValue
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
@@ -79,7 +81,9 @@ fun Attachments(modifier: Modifier, onAttachment: (List<Uri>) -> Unit) {
         mutableStateOf(false)
     }
     val context = LocalContext.current
-    var tempUri = Uri.EMPTY
+    var tempUri by rememberSaveable {
+        mutableStateOf(Uri.EMPTY)
+    }
     val coroutine = rememberCoroutineScope()
     IconButton(onClick = {
         if (isDismiss) {
@@ -127,6 +131,7 @@ fun Attachments(modifier: Modifier, onAttachment: (List<Uri>) -> Unit) {
                     }
                     val launcherCamera =
                         rememberLauncherForActivityResult(ActivityResultContracts.TakePicture()) {
+                            Log.d("SAPI", "TakePicture:$it")
                             if (it) {
                                 onAttachment(listOf(tempUri))
                             }

+ 1 - 1
app/src/main/java/io/nexilis/alpha/ui/main/Chat.kt

@@ -50,7 +50,7 @@ fun Chat(
         ) {
             items(
                 count = lazyPagingItems.itemCount,
-                key = lazyPagingItems.itemKey { it.message_id }
+//                key = lazyPagingItems.itemKey { it.message_id }
             ) { index ->
                 lazyPagingItems[index]?.let { message ->
                     ListItem(modifier = Modifier.fillMaxWidth(), headlineContent = {

+ 1 - 6
cpaas-lite/build.gradle.kts

@@ -4,7 +4,6 @@ plugins {
     alias(libs.plugins.googleDevtoolsKsp)
     alias(libs.plugins.googleDaggerHiltAndroid)
     alias(libs.plugins.googleGmsGoogleServices)
-    kotlin("kapt")
 }
 
 android {
@@ -52,7 +51,7 @@ dependencies {
     implementation(libs.org.jetbrains.coroutines.android)
 
     implementation(libs.com.google.hilt.android)
-    kapt(libs.com.google.hilt.android.compiler)
+    ksp(libs.com.google.hilt.android.compiler)
 
     implementation(platform(libs.firebase.bom))
     implementation(libs.firebase.messaging)
@@ -61,8 +60,4 @@ dependencies {
     testImplementation(libs.junit)
     androidTestImplementation(libs.androidx.junit)
     androidTestImplementation(libs.androidx.espresso.core)
-}
-
-kapt {
-    correctErrorTypes = true
 }

+ 1 - 2
gradle.properties

@@ -20,5 +20,4 @@ kotlin.code.style=official
 # Enables namespacing of each library's R class so that its R class includes only the
 # resources declared in the library itself and none from the library's dependencies,
 # thereby reducing the size of the R class for that library
-android.nonTransitiveRClass=true
-android.nonFinalResIds=false
+android.nonTransitiveRClass=true

+ 1 - 1
gradle/libs.versions.toml

@@ -1,5 +1,5 @@
 [versions]
-agp = "8.3.0"
+agp = "8.3.1"
 kotlin = "1.9.10"
 ksp = "1.9.10-1.0.13"
 coreKtx = "1.12.0"