yayan 1 ano atrás
pai
commit
33653e0e18

+ 33 - 12
app/src/main/java/io/nexilis/alpha/ui/components/ContentChat.kt

@@ -12,6 +12,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
 import androidx.compose.material.icons.Icons
 import androidx.compose.material.icons.automirrored.filled.InsertDriveFile
 import androidx.compose.material.icons.filled.Headset
+import androidx.compose.material.icons.filled.PlayArrow
 import androidx.compose.material3.Icon
 import androidx.compose.material3.LinearProgressIndicator
 import androidx.compose.material3.MaterialTheme
@@ -92,6 +93,8 @@ fun ContentChat(message: Message) {
                     Text(
                         text = message.message_text.split("|").first(),
                         style = MaterialTheme.typography.bodyMedium,
+                        maxLines = 2,
+                        overflow = TextOverflow.Ellipsis
                     )
                     Text(
                         text = "11 KB • XLSX",
@@ -129,19 +132,37 @@ fun ContentChat(message: Message) {
                     contentDescription = null,
                     tint = Color.Orange
                 )
-                Column(
-                    modifier = Modifier.padding(
-                        start = 4.dp,
-                        top = 8.dp,
-                        end = 8.dp,
-                        bottom = 8.dp
-                    )
-                ) {
-                    LinearProgressIndicator(
-                        progress = { 50f },
-                        modifier = Modifier.fillMaxWidth(),
-                    )
+                Column {
+                    Row(
+                        modifier = Modifier.padding(
+                            start = 4.dp,
+                            top = 8.dp,
+                            end = 8.dp,
+                            bottom = 8.dp
+                        )
+                    ) {
+                        Icon(
+                            modifier = Modifier
+                                .size(32.dp)
+                                .align(Alignment.CenterVertically),
+                            imageVector = Icons.Default.PlayArrow,
+                            contentDescription = null,
+                            tint = MaterialTheme.colorScheme.primary
+                        )
+                        LinearProgressIndicator(
+                            progress = { 0.5f },
+                            modifier = Modifier
+                                .align(Alignment.CenterVertically)
+                                .fillMaxWidth(),
+                        )
+                    }
                     Text(
+                        modifier = Modifier.padding(
+                            start = 4.dp,
+                            top = 8.dp,
+                            end = 8.dp,
+                            bottom = 8.dp
+                        ),
                         text = message.message_text.split("|").first(),
                         style = MaterialTheme.typography.labelSmall,
                         maxLines = 1,

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

@@ -155,7 +155,7 @@ fun BottomBar(navController: NavHostController, isHome: Boolean) {
     val navBackStackEntry by navController.currentBackStackEntryAsState()
     val currentDestination = navBackStackEntry?.destination
     if (isHome) NavigationBar {
-        barItems.forEachIndexed { index, screen ->
+        barItems.forEach { screen ->
             NavigationBarItem(
                 icon = { Icon(screen.imageVector, contentDescription = screen.title) },
                 label = { Text(screen.title) },

+ 4 - 3
app/src/main/java/io/nexilis/alpha/ui/theme/Theme.kt

@@ -9,7 +9,7 @@ import androidx.compose.runtime.SideEffect
 import androidx.compose.ui.graphics.toArgb
 import androidx.compose.ui.platform.LocalContext
 import androidx.compose.ui.platform.LocalView
-import androidx.core.view.ViewCompat
+import androidx.core.view.WindowCompat
 
 private val DarkColorScheme = darkColorScheme(
     primary = Purple80,
@@ -51,8 +51,9 @@ fun AlphaTheme(
     val view = LocalView.current
     if (!view.isInEditMode) {
         SideEffect {
-            (view.context as Activity).window.statusBarColor = colorScheme.primary.toArgb()
-            ViewCompat.getWindowInsetsController(view)?.isAppearanceLightStatusBars = darkTheme
+            val window = (view.context as Activity).window
+            window.statusBarColor = colorScheme.primary.toArgb()
+            WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
         }
     }
 

+ 2 - 1
app/src/main/java/io/nexilis/alpha/ui/theme/Type.kt

@@ -1,6 +1,7 @@
 package io.nexilis.alpha.ui.theme
 
 import androidx.compose.material3.Typography
+import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.text.TextStyle
 import androidx.compose.ui.text.font.FontFamily
 import androidx.compose.ui.text.font.FontWeight
@@ -24,7 +25,7 @@ val Typography = Typography(
     ),
     labelSmall = TextStyle(
         fontFamily = FontFamily.Default,
-        fontWeight = FontWeight.Medium,
+        fontWeight = FontWeight.Normal,
         fontSize = 11.sp,
         lineHeight = 16.sp,
         letterSpacing = 0.5.sp

+ 2 - 2
build.gradle

@@ -2,8 +2,8 @@ buildscript {
 
 }// Top-level build file where you can add configuration options common to all sub-projects/modules.
 plugins {
-    id 'com.android.application' version '8.2.2' apply false
-    id 'com.android.library' version '8.2.2' apply false
+    id 'com.android.application' version '8.3.0' apply false
+    id 'com.android.library' version '8.3.0' apply false
     id 'com.google.dagger.hilt.android' version '2.48' apply false
     id 'com.google.devtools.ksp' version '1.9.10-1.0.13' apply false
     id 'com.google.gms.google-services' version '4.3.14' apply false

+ 48 - 45
cpaas-lite/src/main/java/io/nexilis/service/core/Incoming.kt

@@ -300,27 +300,27 @@ class Incoming(private val context: Context) {
                 val jsonObject = jsonArray.getJSONObject(i)
                 ApiRoomDatabase.getDatabase(context).groupDao().insert(
                     Group(
-                        jsonObject.optString("A04") ?: "",
-                        jsonObject.optString("A05") ?: "",
-                        jsonObject.optString("A06") ?: "",
-                        jsonObject.optString("A74") ?: "",
-                        jsonObject.optString("A16") ?: "",
-                        jsonObject.optString("A11") ?: "0",
-                        jsonObject.optString("A28") ?: "",
-                        jsonObject.optString("A29") ?: "0",
-                        jsonObject.optString("A43") ?: "",
-                        "",
-                        jsonObject.optInt("B0") ?: 0,
-                        jsonObject.optInt("A122") ?: 0,
-                        jsonObject.optString("BP") ?: "",
-                        jsonObject.optString("A103") ?: "",
-                        0,
-                        jsonObject.optInt("IOP") ?: 0,
-                        jsonObject.optInt("oacc") ?: 0,
-                        jsonObject.optInt("lvledu") ?: 0,
-                        jsonObject.optInt("mtredu") ?: 0,
-                        jsonObject.optInt("IED") ?: 0,
-                        jsonObject.optString("BZ1") ?: ""
+                        group_id = jsonObject.optString("A04") ?: "",
+                        f_name = jsonObject.optString("A05") ?: "",
+                        scope_id = jsonObject.optString("A06") ?: "",
+                        image_id = jsonObject.optString("A74") ?: "",
+                        quote = jsonObject.optString("A16") ?: "",
+                        last_update = jsonObject.optString("A11") ?: "0",
+                        created_by = jsonObject.optString("A28") ?: "",
+                        created_date = jsonObject.optString("A29") ?: "0",
+                        ex_block = jsonObject.optString("A43") ?: "",
+                        folder_id = "",
+                        chat_modifier = jsonObject.optInt("B0"),
+                        group_type = jsonObject.optInt("A122"),
+                        parent = jsonObject.optString("BP") ?: "",
+                        level = jsonObject.optString("A103") ?: "",
+                        muted = 0,
+                        is_open = jsonObject.optInt("IOP"),
+                        official = jsonObject.optInt("oacc"),
+                        level_edu = jsonObject.optInt("lvledu"),
+                        materi_edu = jsonObject.optInt("mtredu"),
+                        is_education = jsonObject.optInt("IED"),
+                        be = jsonObject.optString("BZ1") ?: ""
                     )
                 )
                 val members = JSONArray(jsonObject.getString("member"))
@@ -328,17 +328,18 @@ class Incoming(private val context: Context) {
                     val jsonMember = members.getJSONObject(j)
                     ApiRoomDatabase.getDatabase(context).groupMemberDao().insert(
                         GroupMember(
-                            jsonMember.optString("A04") ?: "",
-                            jsonMember.optString("A00") ?: "",
-                            jsonMember.optString("A80") ?: "",
-                            jsonMember.optString("B7") ?: "",
-                            jsonMember.optString("AC") ?: "",
-                            jsonMember.optString("AC_DESC") ?: "",
-                            jsonMember.optString("A02") ?: "",
-                            jsonMember.optString("A03") ?: "",
-                            jsonMember.optString("B5") ?: "",
-                            jsonMember.optString("A74") ?: "",
-                            jsonMember.optString("A29") ?: System.currentTimeMillis().toString(),
+                            group_id = jsonMember.optString("A04") ?: "",
+                            f_pin = jsonMember.optString("A00") ?: "",
+                            position = jsonMember.optString("A80") ?: "",
+                            user_id = jsonMember.optString("B7") ?: "",
+                            ac = jsonMember.optString("AC") ?: "",
+                            ac_desc = jsonMember.optString("AC_DESC") ?: "",
+                            first_name = jsonMember.optString("A02") ?: "",
+                            last_name = jsonMember.optString("A03") ?: "",
+                            msisdn = jsonMember.optString("B5") ?: "",
+                            thumb_id = jsonMember.optString("A74") ?: "",
+                            created_date = jsonMember.optString("A29") ?: System.currentTimeMillis()
+                                .toString(),
                         )
                     )
                 }
@@ -354,17 +355,17 @@ class Incoming(private val context: Context) {
             val me = context.getSharedPreferences().getString("pin", null)
             ApiRoomDatabase.getDatabase(context).groupMemberDao().insert(
                 GroupMember(
-                    data.bodies["A04"] ?: "",
-                    data.bodies["A00"] ?: "",
-                    data.bodies["A80"] ?: "",
-                    data.bodies["B7"] ?: "",
-                    data.bodies["AC"] ?: "",
-                    data.bodies["AC_DESC"] ?: "",
-                    data.bodies["A02"] ?: "",
-                    data.bodies["A03"] ?: "",
-                    data.bodies["B5"] ?: "",
-                    data.bodies["A74"] ?: "",
-                    data.bodies["A29"] ?: System.currentTimeMillis().toString(),
+                    group_id = data.bodies["A04"] ?: "",
+                    f_pin = data.bodies["A00"] ?: "",
+                    position = data.bodies["A80"] ?: "",
+                    user_id = data.bodies["B7"] ?: "",
+                    ac = data.bodies["AC"] ?: "",
+                    ac_desc = data.bodies["AC_DESC"] ?: "",
+                    first_name = data.bodies["A02"] ?: "",
+                    last_name = data.bodies["A03"] ?: "",
+                    msisdn = data.bodies["B5"] ?: "",
+                    thumb_id = data.bodies["A74"] ?: "",
+                    created_date = data.bodies["A29"] ?: System.currentTimeMillis().toString(),
                 )
             )
             Service.sendAck(me, data.status)
@@ -389,9 +390,11 @@ class Incoming(private val context: Context) {
             val chatId = data.bodies["BA"] ?: ""
             val imageId = data.bodies["A57"]
             var uri: Uri? = null
-            Log.d(tag, "data.media:${data.media.size}")
             imageId?.let { fileName ->
-                uri = Network().download(context, "https://digixplatform.com/filepalio/image/$fileName")
+                uri = Network().download(
+                    context,
+                    "https://digixplatform.com/filepalio/image/$fileName"
+                )
             }
             ApiRoomDatabase.getDatabase(context).messageDao().insert(
                 Message(

+ 1 - 1
gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
 #Thu Nov 24 10:36:14 ICT 2022
 distributionBase=GRADLE_USER_HOME
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
 distributionPath=wrapper/dists
 zipStorePath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME