Request Camera permission before launching the external Camera app (#1395)
This commit is contained in:
parent
7b9d2f903b
commit
31eca73e8d
21 changed files with 124 additions and 20 deletions
|
|
@ -22,17 +22,19 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
|||
open class PermissionsViewStateProvider : PreviewParameterProvider<PermissionsState> {
|
||||
override val values: Sequence<PermissionsState>
|
||||
get() = sequenceOf(
|
||||
aPermissionsState(),
|
||||
aPermissionsState().copy(shouldShowRationale = true),
|
||||
aPermissionsState().copy(permissionAlreadyDenied = true),
|
||||
aPermissionsState(showDialog = true),
|
||||
aPermissionsState(showDialog = true).copy(shouldShowRationale = true),
|
||||
aPermissionsState(showDialog = true).copy(permissionAlreadyDenied = true),
|
||||
)
|
||||
}
|
||||
|
||||
fun aPermissionsState() = PermissionsState(
|
||||
fun aPermissionsState(
|
||||
showDialog: Boolean,
|
||||
) = PermissionsState(
|
||||
permission = Manifest.permission.INTERNET,
|
||||
permissionGranted = false,
|
||||
shouldShowRationale = false,
|
||||
showDialog = true,
|
||||
showDialog = showDialog,
|
||||
permissionAlreadyAsked = false,
|
||||
permissionAlreadyDenied = false,
|
||||
eventSink = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue