-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Permissions] Support calling rememberPermissionState in a Compose preview #1803
Conversation
f54f01e
to
a3c24c2
Compare
@@ -36,10 +36,12 @@ import androidx.compose.ui.util.fastMap | |||
@Composable | |||
public fun rememberMultiplePermissionsState( | |||
permissions: List<String>, | |||
onPermissionsResult: (Map<String, Boolean>) -> Unit = {} | |||
onPermissionsResult: (Map<String, Boolean>) -> Unit = {}, | |||
permissionStatuses: Map<String, PermissionStatus> = emptyMap() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this would prevent a release because of the API change I can move it to a separate PR. Not sure what the policy is with default params, but metalavaGenerateSignatureRelease
seems to treat it as an API change (also see next commit where I address this with JvmOverloads
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, default params don't fix binary compat unfortunately. Just add a new function and then make this one call your new one and then it is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the JvmOverloads
work for that, or does there have to be an actual new function in source?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, I'm not 100% sure actually but on Compose we always do it with a new function in source so I assume there is a reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I'll push that shortly.
a3c24c2
to
fadb0fa
Compare
fadb0fa
to
2d05d95
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this!
Spinning this out while the fate of #1793 hangs in the balance 😅