mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 15:15:34 +03:00
Dialogs should persist past a rotation (#592)
This commit is contained in:
parent
33b6f994e6
commit
739004cc57
5 changed files with 9 additions and 6 deletions
|
@ -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(
|
||||
|
|
|
@ -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 },
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue