diff --git a/app/build.gradle b/app/build.gradle index 99498baa6..a5aa0ebb4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,7 +15,7 @@ import com.github.spotbugs.snom.SpotBugsTask plugins { id "org.jetbrains.kotlin.plugin.compose" version "2.0.20" id "org.jetbrains.kotlin.kapt" - id 'com.google.devtools.ksp' version '2.0.20-1.0.25' + id 'com.google.devtools.ksp' version '2.0.20-1.0.24' } apply plugin: 'com.android.application' diff --git a/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationActivity.kt b/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationActivity.kt index 0ba7aee21..89acf6c85 100644 --- a/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationActivity.kt @@ -33,6 +33,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.filled.ArrowBack @@ -58,7 +59,9 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color +import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.colorResource @@ -212,7 +215,7 @@ fun ConversationCreationScreen( ConversationNameAndDescription(conversationCreationViewModel) AddParticipants(launcher, context, conversationCreationViewModel) RoomCreationOptions(conversationCreationViewModel) - CreateConversation(conversationCreationViewModel, context,selectedImageUri) + CreateConversation(conversationCreationViewModel, context, selectedImageUri) } } ) @@ -228,17 +231,21 @@ fun DefaultUserAvatar(selectedImageUri: Uri?) { AsyncImage( model = selectedImageUri, contentDescription = stringResource(id = R.string.user_avatar), + contentScale = ContentScale.Crop, modifier = Modifier .size(84.dp) .padding(top = 8.dp) + .clip(CircleShape) ) } else { AsyncImage( model = R.drawable.ic_circular_group, contentDescription = stringResource(id = R.string.user_avatar), + contentScale = ContentScale.Crop, modifier = Modifier .size(84.dp) .padding(top = 8.dp) + .clip(CircleShape) ) } } @@ -571,7 +578,11 @@ fun ShowPasswordDialog(onDismiss: () -> Unit, conversationCreationViewModel: Con } @Composable -fun CreateConversation(conversationCreationViewModel: ConversationCreationViewModel, context: Context,selectedImageUri: Uri?) { +fun CreateConversation( + conversationCreationViewModel: ConversationCreationViewModel, + context: Context, + selectedImageUri: Uri? +) { val selectedParticipants by conversationCreationViewModel.selectedParticipants.collectAsState() Box( modifier = Modifier diff --git a/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationViewModel.kt b/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationViewModel.kt index 13fc607f5..38586a6e3 100644 --- a/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationViewModel.kt +++ b/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationViewModel.kt @@ -109,7 +109,7 @@ class ConversationCreationViewModel @Inject constructor( repository.setPassword(token, _password.value) } repository.openConversation(token, scope) - if(selectedImageUri!= null){ + if (selectedImageUri != null) { repository.uploadConversationAvatar(selectedImageUri.toFile(), token) } onRoomCreated(token) @@ -166,4 +166,3 @@ sealed class AddParticipantsUiState { data class Success(val participants: List?) : AddParticipantsUiState() data class Error(val message: String) : AddParticipantsUiState() } -