Skip to content

Commit

Permalink
use open lock icon for set password
Browse files Browse the repository at this point in the history
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
  • Loading branch information
sowjanyakch committed Sep 23, 2024
1 parent 4b24fb1 commit d2ef5d4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
Expand Down Expand Up @@ -468,7 +467,7 @@ fun RoomCreationOptions(conversationCreationViewModel: ConversationCreationViewM

if (isGuestsAllowed && !isPasswordSet) {
ConversationOptions(
icon = R.drawable.ic_lock_grey600_24px,
icon = R.drawable.baseline_lock_open_24,
text = R.string.nc_set_password,
conversationCreationViewModel = conversationCreationViewModel
)
Expand Down Expand Up @@ -656,6 +655,16 @@ fun ShowPasswordDialog(onDismiss: () -> Unit, conversationCreationViewModel: Con
AlertDialog(
containerColor = colorResource(id = R.color.dialog_background),
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 = {
Button(
onClick = {
Expand All @@ -668,16 +677,6 @@ fun ShowPasswordDialog(onDismiss: () -> Unit, conversationCreationViewModel: Con
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 = {
Button(onClick = { onDismiss() }) {
Text(text = stringResource(id = R.string.nc_cancel))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ class ConversationCreationViewModel @Inject constructor(
}

fun isPasswordEnabled(value: Boolean) {
isPasswordEnabled.value = value
_isPasswordEnabled.value = value
}

fun updateSelectedImageUri(uri: Uri?) {
_selectedImageUri.value = uri
}
Expand Down Expand Up @@ -77,7 +79,6 @@ class ConversationCreationViewModel @Inject constructor(
roomType: String,
conversationName: String,
participants: Set<AutocompleteUser>,
selectedImageUri: Uri?,
onRoomCreated: (String) -> Unit
) {
val scope = when {
Expand Down
18 changes: 18 additions & 0 deletions app/src/main/res/drawable/baseline_lock_open_24.xml
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit d2ef5d4

Please sign in to comment.