use open lock icon for set password

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2024-09-23 19:14:16 +02:00 committed by Marcel Hibbe
parent c165e9fe0c
commit 8c967c4f56
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B
3 changed files with 32 additions and 14 deletions

View file

@ -61,7 +61,6 @@ import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.collectAsState import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
@ -468,7 +467,7 @@ fun RoomCreationOptions(conversationCreationViewModel: ConversationCreationViewM
if (isGuestsAllowed && !isPasswordSet) { if (isGuestsAllowed && !isPasswordSet) {
ConversationOptions( ConversationOptions(
icon = R.drawable.ic_lock_grey600_24px, icon = R.drawable.baseline_lock_open_24,
text = R.string.nc_set_password, text = R.string.nc_set_password,
conversationCreationViewModel = conversationCreationViewModel conversationCreationViewModel = conversationCreationViewModel
) )
@ -656,6 +655,16 @@ fun ShowPasswordDialog(onDismiss: () -> Unit, conversationCreationViewModel: Con
AlertDialog( AlertDialog(
containerColor = colorResource(id = R.color.dialog_background), containerColor = colorResource(id = R.color.dialog_background),
onDismissRequest = onDismiss, onDismissRequest = onDismiss,
title = { Text(text = stringResource(id = R.string.nc_set_password)) },
text = {
TextField(
value = password,
onValueChange = {
password = it
},
label = { Text(text = stringResource(id = R.string.nc_guest_access_password_dialog_hint)) }
)
},
confirmButton = { confirmButton = {
Button( Button(
onClick = { onClick = {
@ -668,16 +677,6 @@ fun ShowPasswordDialog(onDismiss: () -> Unit, conversationCreationViewModel: Con
Text(text = stringResource(id = R.string.save)) Text(text = stringResource(id = R.string.save))
} }
}, },
title = { Text(text = stringResource(id = R.string.nc_set_password)) },
text = {
TextField(
value = password,
onValueChange = {
password = it
},
label = { Text(text = stringResource(id = R.string.nc_guest_access_password_dialog_hint)) }
)
},
dismissButton = { dismissButton = {
Button(onClick = { onDismiss() }) { Button(onClick = { onDismiss() }) {
Text(text = stringResource(id = R.string.nc_cancel)) Text(text = stringResource(id = R.string.nc_cancel))

View file

@ -46,7 +46,9 @@ class ConversationCreationViewModel @Inject constructor(
} }
fun isPasswordEnabled(value: Boolean) { fun isPasswordEnabled(value: Boolean) {
isPasswordEnabled.value = value _isPasswordEnabled.value = value
}
fun updateSelectedImageUri(uri: Uri?) { fun updateSelectedImageUri(uri: Uri?) {
_selectedImageUri.value = uri _selectedImageUri.value = uri
} }
@ -77,7 +79,6 @@ class ConversationCreationViewModel @Inject constructor(
roomType: String, roomType: String,
conversationName: String, conversationName: String,
participants: Set<AutocompleteUser>, participants: Set<AutocompleteUser>,
selectedImageUri: Uri?,
onRoomCreated: (String) -> Unit onRoomCreated: (String) -> Unit
) { ) {
val scope = when { val scope = when {

View file

@ -0,0 +1,18 @@
<!--
~ Nextcloud Talk - Android Client
~
~ SPDX-FileCopyrightText: 2024 Google LLC
~ SPDX-License-Identifier: GPL-3.0-or-later
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:tint="#000000"
android:viewportHeight="24"
android:viewportWidth="24"
android:width="24dp">
<path android:fillColor="@android:color/white"
android:pathData="M12,17c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6h1.9c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM18,20L6,20L6,10h12v10z"/>
</vector>