From cd01c80d7110b49a0fba46fcd3d2709679fb8ff6 Mon Sep 17 00:00:00 2001 From: sowjanyakch Date: Wed, 22 May 2024 16:09:12 +0200 Subject: [PATCH] ConversationCreationActivity UI Signed-off-by: sowjanyakch --- app/build.gradle | 2 +- app/src/main/AndroidManifest.xml | 3 + .../com/nextcloud/talk/api/NcApiCoroutines.kt | 26 ++ .../talk/contacts/ContactsActivityCompose.kt | 9 +- .../contacts/ContactsActivityViewModel.kt | 104 ++++++++ .../ConversationCreationActivity.kt | 246 ++++++++++++++++++ .../ConversationCreationRepository.kt | 15 ++ .../ConversationCreationRepositoryImpl.kt | 48 ++++ .../ConversationCreationViewModel.kt | 57 ++++ .../talk/dagger/modules/RepositoryModule.kt | 10 + .../talk/dagger/modules/ViewModelModule.kt | 6 + .../res/drawable/baseline_tag_faces_24.xml | 18 ++ app/src/main/res/values/strings.xml | 1 + .../repository/FakeRepositorySuccess.kt | 4 + gradle/verification-metadata.xml | 138 +++++++++- 15 files changed, 680 insertions(+), 7 deletions(-) create mode 100644 app/src/main/java/com/nextcloud/talk/contacts/ContactsActivityViewModel.kt create mode 100644 app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationActivity.kt create mode 100644 app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationRepository.kt create mode 100644 app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationRepositoryImpl.kt create mode 100644 app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationViewModel.kt create mode 100644 app/src/main/res/drawable/baseline_tag_faces_24.xml diff --git a/app/build.gradle b/app/build.gradle index 993794069..469f4a39b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -309,7 +309,7 @@ dependencies { //compose implementation(platform("androidx.compose:compose-bom:2024.09.00")) implementation("androidx.compose.ui:ui") - implementation 'androidx.compose.material3:material3' + implementation 'androidx.compose.material3:material3:1.2.1' implementation("androidx.compose.ui:ui-tooling-preview") implementation 'androidx.activity:activity-compose:1.9.2' implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.5' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 410dd82da..256e2b2b5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -129,6 +129,9 @@ + + diff --git a/app/src/main/java/com/nextcloud/talk/api/NcApiCoroutines.kt b/app/src/main/java/com/nextcloud/talk/api/NcApiCoroutines.kt index c330c33cb..ccca322a7 100644 --- a/app/src/main/java/com/nextcloud/talk/api/NcApiCoroutines.kt +++ b/app/src/main/java/com/nextcloud/talk/api/NcApiCoroutines.kt @@ -9,9 +9,13 @@ package com.nextcloud.talk.api import com.nextcloud.talk.models.json.autocomplete.AutocompleteOverall import com.nextcloud.talk.models.json.conversations.RoomOverall +import com.nextcloud.talk.models.json.generic.GenericOverall +import retrofit2.http.Field +import retrofit2.http.FormUrlEncoded import retrofit2.http.GET import retrofit2.http.Header import retrofit2.http.POST +import retrofit2.http.PUT import retrofit2.http.Query import retrofit2.http.QueryMap import retrofit2.http.Url @@ -39,4 +43,26 @@ interface NcApiCoroutines { @Url url: String?, @QueryMap options: Map? ): RoomOverall + + /* + QueryMap items are as follows: + - "roomName" : "newName" + + Server URL is: baseUrl + ocsApiVersion + spreedApiVersion + /room/roomToken + */ + @FormUrlEncoded + @PUT + fun renameRoom( + @Header("Authorization") authorization: String?, + @Url url: String, + @Field("roomName") roomName: String? + ): GenericOverall + + @FormUrlEncoded + @PUT + fun setConversationDescription( + @Header("Authorization") authorization: String?, + @Url url: String, + @Field("description") description: String? + ): GenericOverall } diff --git a/app/src/main/java/com/nextcloud/talk/contacts/ContactsActivityCompose.kt b/app/src/main/java/com/nextcloud/talk/contacts/ContactsActivityCompose.kt index fe828a4b7..d9234bac9 100644 --- a/app/src/main/java/com/nextcloud/talk/contacts/ContactsActivityCompose.kt +++ b/app/src/main/java/com/nextcloud/talk/contacts/ContactsActivityCompose.kt @@ -64,6 +64,7 @@ import com.nextcloud.talk.R import com.nextcloud.talk.activities.BaseActivity import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.chat.ChatActivity +import com.nextcloud.talk.conversationcreation.ConversationCreationActivity import com.nextcloud.talk.models.json.autocomplete.AutocompleteUser import com.nextcloud.talk.openconversations.ListOpenConversationsActivity import com.nextcloud.talk.utils.bundle.BundleKeys @@ -278,7 +279,11 @@ fun AppBar(title: String, context: Context, contactsViewModel: ContactsViewModel fun ConversationCreationOptions(context: Context) { Column { Row( - modifier = Modifier.padding(start = 16.dp, end = 16.dp, top = 16.dp, bottom = 8.dp), + modifier = Modifier.padding(start = 16.dp, end = 16.dp, top = 16.dp, bottom = 8.dp) + .clickable { + val intent = Intent(context, ConversationCreationActivity::class.java) + context.startActivity(intent) + }, verticalAlignment = Alignment.CenterVertically ) { Icon( @@ -326,6 +331,8 @@ fun ConversationCreationOptions(context: Context) { } } + + class CompanionClass { companion object { internal val TAG = ContactsActivityCompose::class.simpleName diff --git a/app/src/main/java/com/nextcloud/talk/contacts/ContactsActivityViewModel.kt b/app/src/main/java/com/nextcloud/talk/contacts/ContactsActivityViewModel.kt new file mode 100644 index 000000000..6c87c6608 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/contacts/ContactsActivityViewModel.kt @@ -0,0 +1,104 @@ +/* + * Nextcloud Talk - Android Client + * + * SPDX-FileCopyrightText: 2024 Your Name + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +package com.nextcloud.talk.contacts + +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import com.nextcloud.talk.data.user.model.User +import com.nextcloud.talk.models.json.autocomplete.AutocompleteUser +import com.nextcloud.talk.models.json.conversations.Conversation +import com.nextcloud.talk.users.UserManager +import com.nextcloud.talk.utils.ApiUtils +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.launch +import javax.inject.Inject + +class ContactsActivityViewModel @Inject constructor( + private val repository: ContactsRepository, + private val userManager: UserManager +) : ViewModel() { + + private val _contactsViewState = MutableStateFlow(ContactsUiState.None) + val contactsViewState: StateFlow = _contactsViewState + private val _roomViewState = MutableStateFlow(RoomUiState.None) + val roomViewState: StateFlow = _roomViewState + private val _currentUser = userManager.currentUser.blockingGet() + val currentUser: User = _currentUser + private val _searchQuery = MutableStateFlow("") + val searchQuery: StateFlow = _searchQuery + private val shareTypes: MutableList = mutableListOf(ShareType.User.shareType) + val shareTypeList: List = shareTypes + + init { + getContactsFromSearchParams() + } + + fun updateSearchQuery(query: String) { + _searchQuery.value = query + } + + fun updateShareTypes(value: String) { + shareTypes.add(value) + } + + fun getContactsFromSearchParams() { + _contactsViewState.value = ContactsUiState.Loading + viewModelScope.launch { + try { + val contacts = repository.getContacts( + searchQuery.value, + shareTypeList + ) + val contactsList: List? = contacts.ocs!!.data + _contactsViewState.value = ContactsUiState.Success(contactsList) + } catch (exception: Exception) { + _contactsViewState.value = ContactsUiState.Error(exception.message ?: "") + } + } + } + + fun createRoom(roomType: String, sourceType: String, userId: String, conversationName: String?) { + viewModelScope.launch { + try { + val room = repository.createRoom( + roomType, + sourceType, + userId, + conversationName + ) + + val conversation: Conversation? = room.ocs?.data + _roomViewState.value = RoomUiState.Success(conversation) + } catch (exception: Exception) { + _roomViewState.value = RoomUiState.Error(exception.message ?: "") + } + } + } + + fun getImageUri(avatarId: String, requestBigSize: Boolean): String { + return ApiUtils.getUrlForAvatar( + _currentUser.baseUrl, + avatarId, + requestBigSize + ) + } +} + +sealed class ContactsUiState { + data object None : ContactsUiState() + data object Loading : ContactsUiState() + data class Success(val contacts: List?) : ContactsUiState() + data class Error(val message: String) : ContactsUiState() +} + +sealed class RoomUiState { + data object None : RoomUiState() + data class Success(val conversation: Conversation?) : RoomUiState() + data class Error(val message: String) : RoomUiState() +} diff --git a/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationActivity.kt b/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationActivity.kt new file mode 100644 index 000000000..29fc51956 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationActivity.kt @@ -0,0 +1,246 @@ +/* + * Nextcloud Talk - Android Client + * + * SPDX-FileCopyrightText: 2024 Sowjanya Kota + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +package com.nextcloud.talk.conversationcreation + +import android.app.Activity +import android.os.Bundle +import androidx.activity.compose.setContent +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.filled.ArrowBack +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.OutlinedTextField +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Switch +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBar +import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.lifecycle.ViewModelProvider +import autodagger.AutoInjector +import coil.compose.AsyncImage +import com.nextcloud.talk.R +import com.nextcloud.talk.activities.BaseActivity +import com.nextcloud.talk.application.NextcloudTalkApplication +import com.nextcloud.talk.contacts.ContactsViewModel +import javax.inject.Inject + +@AutoInjector(NextcloudTalkApplication::class) +class ConversationCreationActivity : BaseActivity() { + @Inject + lateinit var viewModelFactory: ViewModelProvider.Factory + private lateinit var conversationCreationViewModel: ConversationCreationViewModel + private lateinit var contactsViewModel: ContactsViewModel + + @OptIn(ExperimentalMaterial3Api::class) + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + NextcloudTalkApplication.sharedApplication!!.componentApplication.inject(this) + conversationCreationViewModel = + ViewModelProvider(this, viewModelFactory)[ConversationCreationViewModel::class.java] + contactsViewModel = ViewModelProvider(this, viewModelFactory)[ContactsViewModel::class.java] + setContent { + val colorScheme = viewThemeUtils.getColorScheme(this) + MaterialTheme( + colorScheme = colorScheme + ) { + val context = LocalContext.current + Scaffold( + topBar = { + TopAppBar( + title = { Text(text = stringResource(id = R.string.nc_new_conversation)) }, + + navigationIcon = { + IconButton(onClick = { + (context as? Activity)?.finish() + }) { + Icon( + Icons.AutoMirrored.Filled.ArrowBack, + contentDescription = stringResource(R.string.back_button) + ) + } + } + ) + }, + content = { + Column(Modifier.padding(it)) { + DefaultUserAvatar() + UploadAvatar() + ConversationNameAndDescription(conversationCreationViewModel) + AddParticipants(contactsViewModel) + RoomCreationOptions(conversationCreationViewModel) + } + } + ) + } + } + } +} + +@Composable +fun DefaultUserAvatar() { + Box( + modifier = Modifier.fillMaxWidth(), + contentAlignment = Alignment.Center + ) { + AsyncImage( + model = R.drawable.ic_circular_group, + contentDescription = "User Avatar", + modifier = Modifier + .size(width = 84.dp, height = 84.dp) + .padding(top = 8.dp) + ) + } +} + +@Composable +fun UploadAvatar() { + Row( + modifier = Modifier + .fillMaxWidth() + .padding(16.dp), + horizontalArrangement = Arrangement.Center + ) { + IconButton(onClick = { + }) { + Icon( + painter = painterResource(id = R.drawable.ic_baseline_photo_camera_24), + contentDescription = null, + modifier = Modifier.size(24.dp) + ) + } + + IconButton(onClick = { + }) { + Icon( + painter = painterResource(id = R.drawable.ic_folder_multiple_image), + contentDescription = null, + modifier = Modifier.size(24.dp) + ) + } + + IconButton(onClick = { + }) { + Icon( + painter = painterResource(id = R.drawable.baseline_tag_faces_24), + contentDescription = null, + modifier = Modifier.size(24.dp) + ) + } + + IconButton(onClick = { + }) { + Icon( + painter = painterResource(id = R.drawable.ic_delete_grey600_24dp), + contentDescription = null, + modifier = Modifier.size(24.dp) + ) + } + } +} + +@Composable +fun ConversationNameAndDescription(conversationCreationViewModel: ConversationCreationViewModel) { + val conversationRoomName = conversationCreationViewModel.roomName.collectAsState() + val conversationDescription = conversationCreationViewModel.conversationDescription.collectAsState() + OutlinedTextField( + value = conversationRoomName.value, + onValueChange = { + conversationCreationViewModel.updateRoomName(it) + }, + label = { Text(text = stringResource(id = R.string.nc_call_name)) }, + modifier = Modifier + .padding(start = 16.dp, end = 16.dp) + .fillMaxWidth() + ) + OutlinedTextField( + value = conversationDescription.value, + onValueChange = { + conversationCreationViewModel.updateRoomName(it) + }, + label = { Text(text = stringResource(id = R.string.nc_conversation_description)) }, + modifier = Modifier + .padding(top = 8.dp, start = 16.dp, end = 16.dp) + .fillMaxWidth() + ) +} + +@Composable +fun AddParticipants(contactsViewModel: ContactsViewModel) { + Text( + text = stringResource(id = R.string.nc_participants).uppercase(), + fontSize = 14.sp, + modifier = Modifier.padding(top = 24.dp, start = 16.dp, end = 16.dp) + ) + + Row( + modifier = Modifier + .padding(start = 16.dp, end = 16.dp) + .clickable { + // Show contacts + }, + verticalAlignment = Alignment + .CenterVertically + ) { + Icon( + painter = painterResource(id = R.drawable.ic_account_plus), + contentDescription = null, + modifier = Modifier.size(24.dp) + ) + + Text(text = stringResource(id = R.string.nc_add_participants), modifier = Modifier.padding(start = 16.dp)) + } +} + +@Composable +fun RoomCreationOptions(conversationCreationViewModel: ConversationCreationViewModel) { + val isChecked = conversationCreationViewModel.isGuestsAllowed.value + Text( + text = stringResource(id = R.string.nc_visible).uppercase(), + fontSize = 14.sp, + modifier = Modifier.padding(top = 24.dp, start = 16.dp, end = 16.dp) + ) + Row( + modifier = Modifier.padding(start = 16.dp, top = 16.dp, end = 16.dp).fillMaxWidth(), + verticalAlignment = Alignment + .CenterVertically + ) { + Icon( + painter = painterResource(id = R.drawable.ic_avatar_link), + contentDescription = null, + modifier = Modifier.size(24.dp) + ) + Text(text = stringResource(id = R.string.nc_guest_access_allow_title)) + + Spacer(modifier = Modifier.weight(1f)) + Switch( + checked = isChecked, + onCheckedChange = { + conversationCreationViewModel.isGuestsAllowed.value = it + } + ) + } +} diff --git a/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationRepository.kt b/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationRepository.kt new file mode 100644 index 000000000..d241e8993 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationRepository.kt @@ -0,0 +1,15 @@ +/* + * Nextcloud Talk - Android Client + * + * SPDX-FileCopyrightText: 2024 Sowjanya Kota + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +package com.nextcloud.talk.conversationcreation + +import com.nextcloud.talk.models.json.generic.GenericOverall + +interface ConversationCreationRepository { + suspend fun renameConversation(roomToken: String, roomNameNew: String?): GenericOverall + suspend fun setConversationDescription(roomToken: String, description: String?): GenericOverall +} diff --git a/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationRepositoryImpl.kt b/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationRepositoryImpl.kt new file mode 100644 index 000000000..ab41d84f9 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationRepositoryImpl.kt @@ -0,0 +1,48 @@ +/* + * Nextcloud Talk - Android Client + * + * SPDX-FileCopyrightText: 2024 Sowjanya Kota + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +package com.nextcloud.talk.conversationcreation + +import com.nextcloud.talk.api.NcApiCoroutines +import com.nextcloud.talk.data.user.model.User +import com.nextcloud.talk.models.json.generic.GenericOverall +import com.nextcloud.talk.users.UserManager +import com.nextcloud.talk.utils.ApiUtils + +class ConversationCreationRepositoryImpl( + private val ncApiCoroutines: NcApiCoroutines, + private val userManager: UserManager +) : ConversationCreationRepository { + private val _currentUser = userManager.currentUser.blockingGet() + val currentUser: User = _currentUser + val credentials = ApiUtils.getCredentials(_currentUser.username, _currentUser.token) + val apiVersion = ApiUtils.getConversationApiVersion(_currentUser, intArrayOf(ApiUtils.API_V4, ApiUtils.API_V1)) + + override suspend fun renameConversation(roomToken: String, roomNameNew: String?): GenericOverall { + return ncApiCoroutines.renameRoom( + credentials, + ApiUtils.getUrlForRoom( + apiVersion, + _currentUser.baseUrl, + roomToken + ), + roomNameNew + ) + } + + override suspend fun setConversationDescription(roomToken: String, description: String?): GenericOverall { + return ncApiCoroutines.setConversationDescription( + credentials, + ApiUtils.getUrlForConversationDescription( + apiVersion, + _currentUser.baseUrl, + roomToken + ), + description + ) + } +} diff --git a/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationViewModel.kt b/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationViewModel.kt new file mode 100644 index 000000000..9ba08cbec --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/conversationcreation/ConversationCreationViewModel.kt @@ -0,0 +1,57 @@ +/* + * Nextcloud Talk - Android Client + * + * SPDX-FileCopyrightText: 2024 Sowjanya Kota + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +package com.nextcloud.talk.conversationcreation + +import android.util.Log +import androidx.compose.runtime.mutableStateOf +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.launch +import javax.inject.Inject + +class ConversationCreationViewModel @Inject constructor( + private val repository: ConversationCreationRepository +) : ViewModel() { + + private val _roomName = MutableStateFlow("") + val roomName: StateFlow = _roomName + private val _conversationDescription = MutableStateFlow("") + val conversationDescription: StateFlow = _conversationDescription + var isGuestsAllowed = mutableStateOf(false) + var isConversationAvailableForRegisteredUsers = mutableStateOf(false) + var openForGuestAppUsers = mutableStateOf(false) + + fun updateRoomName(roomName: String) { + _roomName.value = roomName + } + + fun updateConversationDescription(conversationDescription: String) { + _conversationDescription.value = conversationDescription + } + + fun renameConversation(roomToken: String) { + viewModelScope.launch { + try { + repository.renameConversation(roomToken, roomName.value) + } catch (e: Exception) { + Log.d("ConversationCreationViewModel", "${e.message}") + } + } + } + fun setConversationDescription(roomToken: String) { + viewModelScope.launch { + try { + repository.setConversationDescription(roomToken, conversationDescription.value) + } catch (e: Exception) { + Log.d("ConversationCreationViewModel", "${e.message}") + } + } + } +} diff --git a/app/src/main/java/com/nextcloud/talk/dagger/modules/RepositoryModule.kt b/app/src/main/java/com/nextcloud/talk/dagger/modules/RepositoryModule.kt index 4085d4114..f00c502ba 100644 --- a/app/src/main/java/com/nextcloud/talk/dagger/modules/RepositoryModule.kt +++ b/app/src/main/java/com/nextcloud/talk/dagger/modules/RepositoryModule.kt @@ -19,6 +19,8 @@ import com.nextcloud.talk.contacts.ContactsRepository import com.nextcloud.talk.contacts.ContactsRepositoryImpl import com.nextcloud.talk.conversation.repository.ConversationRepository import com.nextcloud.talk.conversation.repository.ConversationRepositoryImpl +import com.nextcloud.talk.conversationcreation.ConversationCreationRepository +import com.nextcloud.talk.conversationcreation.ConversationCreationRepositoryImpl import com.nextcloud.talk.conversationinfoedit.data.ConversationInfoEditRepository import com.nextcloud.talk.conversationinfoedit.data.ConversationInfoEditRepositoryImpl import com.nextcloud.talk.conversationlist.data.OfflineConversationsRepository @@ -208,4 +210,12 @@ class RepositoryModule { fun provideContactsRepository(ncApiCoroutines: NcApiCoroutines, userManager: UserManager): ContactsRepository { return ContactsRepositoryImpl(ncApiCoroutines, userManager) } + + @Provides + fun provideConversationCreationRepository( + ncApiCoroutines: NcApiCoroutines, + userManager: UserManager + ): ConversationCreationRepository { + return ConversationCreationRepositoryImpl(ncApiCoroutines, userManager) + } } diff --git a/app/src/main/java/com/nextcloud/talk/dagger/modules/ViewModelModule.kt b/app/src/main/java/com/nextcloud/talk/dagger/modules/ViewModelModule.kt index 511e6d7e2..f1ac935fe 100644 --- a/app/src/main/java/com/nextcloud/talk/dagger/modules/ViewModelModule.kt +++ b/app/src/main/java/com/nextcloud/talk/dagger/modules/ViewModelModule.kt @@ -14,6 +14,7 @@ import com.nextcloud.talk.contacts.ContactsViewModel import com.nextcloud.talk.chat.viewmodels.MessageInputViewModel import com.nextcloud.talk.conversation.viewmodel.ConversationViewModel import com.nextcloud.talk.conversation.viewmodel.RenameConversationViewModel +import com.nextcloud.talk.conversationcreation.ConversationCreationViewModel import com.nextcloud.talk.conversationinfo.viewmodel.ConversationInfoViewModel import com.nextcloud.talk.conversationinfoedit.viewmodel.ConversationInfoEditViewModel import com.nextcloud.talk.conversationlist.viewmodels.ConversationsListViewModel @@ -156,4 +157,9 @@ abstract class ViewModelModule { @IntoMap @ViewModelKey(ContactsViewModel::class) abstract fun contactsViewModel(viewModel: ContactsViewModel): ViewModel + + @Binds + @IntoMap + @ViewModelKey(ConversationCreationViewModel::class) + abstract fun conversationCreationViewModel(viewModel: ConversationCreationViewModel): ViewModel } diff --git a/app/src/main/res/drawable/baseline_tag_faces_24.xml b/app/src/main/res/drawable/baseline_tag_faces_24.xml new file mode 100644 index 000000000..3a4f45877 --- /dev/null +++ b/app/src/main/res/drawable/baseline_tag_faces_24.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6fa26e80e..32679fbf4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -386,6 +386,7 @@ How to translate with transifex: Close Icon Refresh Please check your internet connection + Visible Enter a message … diff --git a/app/src/test/java/com/nextcloud/talk/contacts/repository/FakeRepositorySuccess.kt b/app/src/test/java/com/nextcloud/talk/contacts/repository/FakeRepositorySuccess.kt index f5d87d919..9022ba059 100644 --- a/app/src/test/java/com/nextcloud/talk/contacts/repository/FakeRepositorySuccess.kt +++ b/app/src/test/java/com/nextcloud/talk/contacts/repository/FakeRepositorySuccess.kt @@ -29,4 +29,8 @@ class FakeRepositorySuccess : ContactsRepository { override fun getImageUri(avatarId: String, requestBigSize: Boolean): String { return "https://mydomain.com/index.php/avatar/$avatarId/512" } + + override fun getImageUri(avatarId: String, requestBigSize: Boolean): String { + TODO("Not yet implemented") + } } diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index f1531e06f..f55002312 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -4,13 +4,13 @@ true true - - - - + + + + @@ -145,7 +145,6 @@ - @@ -157,6 +156,7 @@ + @@ -246,6 +246,7 @@ + @@ -343,6 +344,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -359,6 +404,14 @@ + + + + + + + + @@ -372,6 +425,11 @@ + + + + + @@ -393,6 +451,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +