Skip to content
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

Change to use Fragment as a LifecycleOwner when PermissionRequester is constructed by Fragment #766

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

omtians9425
Copy link

@omtians9425 omtians9425 commented Feb 26, 2022

Resolves #765

Overview

  • Changed to use Fragment as a LifecycleOwner when PermissionRequester is constructed by Fragment
  • For Activity, it changes nothing (uses Activity as a LifecycleOwner just like before)

GIFs

Behaviors of sample app

before after

@@ -27,14 +27,14 @@ internal class PermissionRequestViewModel : ViewModel() {
onPermissionDenied: WeakReference<Fun>?,
onNeverAskAgain: WeakReference<Fun>?
) {
permissionRequestResult.observe(owner, {
permissionRequestResult.observe(owner) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not main topic of this PR but fixed warning about trailing lambda syntax

@omtians9425 omtians9425 marked this pull request as ready for review February 26, 2022 01:52
@OliverRhyme
Copy link

Can anyone review this? We need this fix🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants