Dialogs should persist past a rotation (#592)

This commit is contained in:
David Perez 2024-01-12 13:07:14 -06:00 committed by Álison Fernandes
parent 33b6f994e6
commit 739004cc57
5 changed files with 9 additions and 6 deletions

View file

@ -352,7 +352,7 @@ private fun EnvironmentSelector(
modifier: Modifier,
) {
val options = Environment.Type.values()
var shouldShowDialog by remember { mutableStateOf(false) }
var shouldShowDialog by rememberSaveable { mutableStateOf(false) }
Box(modifier = modifier) {
Row(

View file

@ -5,7 +5,7 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
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.Modifier
import androidx.compose.ui.res.painterResource
@ -41,7 +41,7 @@ fun BitwardenExternalLinkRow(
dialogConfirmButtonText: String = stringResource(id = R.string.continue_text),
dialogDismissButtonText: String = stringResource(id = R.string.cancel),
) {
var shouldShowDialog by remember { mutableStateOf(false) }
var shouldShowDialog by rememberSaveable { mutableStateOf(false) }
BitwardenTextRow(
text = text,
onClick = { shouldShowDialog = true },

View file

@ -19,6 +19,7 @@ import androidx.compose.runtime.Composable
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
import androidx.compose.ui.Modifier
@ -58,7 +59,7 @@ fun BitwardenListItem(
supportingLabel: String? = null,
trailingLabelIcons: List<IconResource> = emptyList(),
) {
var shouldShowDialog by remember { mutableStateOf(false) }
var shouldShowDialog by rememberSaveable { mutableStateOf(false) }
Row(
modifier = Modifier
.clickable(

View file

@ -19,6 +19,7 @@ import androidx.compose.runtime.Composable
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.Modifier
import androidx.compose.ui.res.painterResource
@ -63,7 +64,7 @@ fun BitwardenMultiSelectButton(
supportingText: String? = null,
tooltip: TooltipData? = null,
) {
var shouldShowDialog by remember { mutableStateOf(false) }
var shouldShowDialog by rememberSaveable { mutableStateOf(false) }
Box(
modifier = modifier

View file

@ -19,6 +19,7 @@ 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.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll
@ -179,7 +180,7 @@ private fun UriMatchDetectionDialog(
selectedUriDetection: AutoFillState.UriDetectionMethod,
onDetectionSelect: (AutoFillState.UriDetectionMethod) -> Unit,
) {
var shouldShowDialog by remember { mutableStateOf(false) }
var shouldShowDialog by rememberSaveable { mutableStateOf(false) }
BitwardenTextRow(
text = stringResource(id = R.string.default_uri_match_detection),