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

Set view tree owners in parent class #615

Merged
merged 1 commit into from
Sep 12, 2023
Merged

Set view tree owners in parent class #615

merged 1 commit into from
Sep 12, 2023

Conversation

jbarr21
Copy link
Contributor

@jbarr21 jbarr21 commented Sep 12, 2023

A followup to #606 which moves the logic into the superclass so all CoreAppCompatActivity subclasses benefit from the updated logic

Comment on lines +96 to +98
ViewTreeLifecycleOwner.set(window.decorView, this)
ViewTreeViewModelStoreOwner.set(window.decorView, this)
ViewTreeSavedStateRegistryOwner.set(window.decorView, this)
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess there are now setViewTreeXyz extensions that don't need to take in this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this artifact was already there & the ext fun weren't visible so i stuck w/ this

@jbarr21 jbarr21 merged commit 00753bb into main Sep 12, 2023
2 checks passed
@jbarr21 jbarr21 deleted the jb/core-act-owners branch September 12, 2023 01:24
@@ -81,4 +85,16 @@ abstract class CoreAppCompatActivity : AppCompatActivity() {
super.onActivityResult(requestCode, resultCode, data)
activityDelegate?.onActivityResult(this, requestCode, resultCode, data)
}

/**
* [RibActivity] must call this since it does not use [ComponentActivity.setContentView] which
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens for activities that extend from this and call setContentView? I imagine lifecycle owners get overwritten and that's ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

overwritten & ok

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

Successfully merging this pull request may close these issues.

3 participants