mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 15:15:34 +03:00
BIT-1606: Add element IDs to DeleteAccountScreen (#1075)
This commit is contained in:
parent
cdda76bdae
commit
77e07f49ee
1 changed files with 9 additions and 3 deletions
|
@ -28,6 +28,8 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.semantics.semantics
|
||||||
|
import androidx.compose.ui.semantics.testTag
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import com.x8bit.bitwarden.R
|
import com.x8bit.bitwarden.R
|
||||||
|
@ -150,6 +152,10 @@ fun DeleteAccountScreen(
|
||||||
onConfirmationClick = remember(viewModel) {
|
onConfirmationClick = remember(viewModel) {
|
||||||
{ viewModel.trySendAction(DeleteAccountAction.DeleteAccountClick(it)) }
|
{ viewModel.trySendAction(DeleteAccountAction.DeleteAccountClick(it)) }
|
||||||
},
|
},
|
||||||
|
modifier = Modifier
|
||||||
|
.semantics { testTag = "DELETE ACCOUNT" }
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(horizontal = 16.dp),
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(12.dp))
|
Spacer(modifier = Modifier.height(12.dp))
|
||||||
BitwardenOutlinedButton(
|
BitwardenOutlinedButton(
|
||||||
|
@ -158,6 +164,7 @@ fun DeleteAccountScreen(
|
||||||
{ viewModel.trySendAction(DeleteAccountAction.CancelClick) }
|
{ viewModel.trySendAction(DeleteAccountAction.CancelClick) }
|
||||||
},
|
},
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
.semantics { testTag = "CANCEL" }
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp),
|
||||||
)
|
)
|
||||||
|
@ -169,6 +176,7 @@ fun DeleteAccountScreen(
|
||||||
@Composable
|
@Composable
|
||||||
private fun DeleteAccountButton(
|
private fun DeleteAccountButton(
|
||||||
onConfirmationClick: (masterPassword: String) -> Unit,
|
onConfirmationClick: (masterPassword: String) -> Unit,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
var showPasswordDialog by remember { mutableStateOf(false) }
|
var showPasswordDialog by remember { mutableStateOf(false) }
|
||||||
if (showPasswordDialog) {
|
if (showPasswordDialog) {
|
||||||
|
@ -184,8 +192,6 @@ private fun DeleteAccountButton(
|
||||||
BitwardenErrorButton(
|
BitwardenErrorButton(
|
||||||
label = stringResource(id = R.string.delete_account),
|
label = stringResource(id = R.string.delete_account),
|
||||||
onClick = { showPasswordDialog = true },
|
onClick = { showPasswordDialog = true },
|
||||||
modifier = Modifier
|
modifier = modifier,
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(horizontal = 16.dp),
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue