mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-23 04:35:01 +01:00
Fix conversation creation & password set
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
1c3792bc21
commit
ebec4c547e
@ -106,7 +106,7 @@ class GroupConversationView : BaseView() {
|
||||
|
||||
override fun onFloatingActionButtonClick() {
|
||||
view?.conversationNameInputEditText?.text?.let { conversationName ->
|
||||
val conversationType = if (view?.allowGuestsSwitchMaterial?.isChecked == true) 2 else 3
|
||||
val conversationType = if (view?.allowGuestsSwitchMaterial?.isChecked == true) 3 else 2
|
||||
viewModel.createConversation(conversationType, conversationName.toString(), view?.passwordInputEditText?.text?.toString())
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ class GroupConversationViewModel constructor(
|
||||
createConversationUseCase.invoke(viewModelScope, parametersOf(globalService.currentUserLiveData.value, conversationType, null, null, conversationName), object : UseCaseResponse<ConversationOverall> {
|
||||
override suspend fun onSuccess(result: ConversationOverall) {
|
||||
result.ocs.data.token?.let { token ->
|
||||
if (conversationPassword != null) {
|
||||
if (!conversationPassword.isNullOrEmpty()) {
|
||||
setPasswordForConversation(token, conversationPassword)
|
||||
} else {
|
||||
_operationState.postValue(ContactsViewOperationStateWrapper(ContactsViewOperationState.OK, null, token))
|
||||
|
@ -56,7 +56,8 @@
|
||||
android:layout_height="32dp"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:indeterminateTint="@color/hwSecurityRed"
|
||||
android:visibility="gone"
|
||||
android:indeterminateTint="@color/white"
|
||||
android:scaleType="fitCenter" />
|
||||
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
|
@ -23,6 +23,7 @@
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:animateLayoutChanges="true">
|
||||
|
||||
<RelativeLayout
|
||||
@ -33,6 +34,7 @@
|
||||
android:id="@+id/conversationNameTextInputLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:endIconMode="clear_text"
|
||||
android:hint="@string/nc_call_name">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
@ -45,6 +47,7 @@
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/allowGuestsSwitchMaterial"
|
||||
android:layout_width="match_parent"
|
||||
app:useMaterialThemeColors="true"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/conversationNameTextInputLayout"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
@ -57,6 +60,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/allowGuestsSwitchMaterial"
|
||||
android:visibility="gone"
|
||||
app:endIconMode="password_toggle"
|
||||
android:hint="@string/nc_password_optional">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
@ -64,6 +68,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
android:inputType="textPassword"
|
||||
android:layout_marginBottom="8dp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</RelativeLayout>
|
||||
|
Loading…
Reference in New Issue
Block a user