@@ -22,9 +22,6 @@ import android.content.res.Configuration
2222import android.os.Build
2323import android.view.ViewGroup
2424import androidx.annotation.CallSuper
25- import androidx.lifecycle.ViewTreeLifecycleOwner
26- import androidx.lifecycle.ViewTreeViewModelStoreOwner
27- import androidx.savedstate.ViewTreeSavedStateRegistryOwner
2825import com.uber.autodispose.lifecycle.CorrespondingEventsFunction
2926import com.uber.autodispose.lifecycle.LifecycleEndedException
3027import com.uber.autodispose.lifecycle.LifecycleNotStartedException
@@ -93,7 +90,6 @@ abstract class RibActivity :
9390 @CallSuper
9491 override fun onCreate (savedInstanceState : android.os.Bundle ? ) {
9592 super .onCreate(savedInstanceState)
96- initViewTreeOwners()
9793 val rootViewGroup = findViewById<ViewGroup >(android.R .id.content)
9894 _lifecycleFlow .tryEmit(createOnCreateEvent(savedInstanceState))
9995 val wrappedBundle: Bundle ? =
@@ -236,18 +232,6 @@ abstract class RibActivity :
236232 */
237233 protected abstract fun createRouter (parentViewGroup : ViewGroup ): ViewRouter <* , * >
238234
239- /* *
240- * [RibActivity] must call this since it does not use [ComponentActivity.setContentView] which
241- * already handles this.
242- */
243- private fun initViewTreeOwners () {
244- // Set the view tree owners before setting the content view so that the inflation process
245- // and attach listeners will see them already present
246- ViewTreeLifecycleOwner .set(window.decorView, this )
247- ViewTreeViewModelStoreOwner .set(window.decorView, this )
248- ViewTreeSavedStateRegistryOwner .set(window.decorView, this )
249- }
250-
251235 companion object {
252236 /* *
253237 * Figures out which corresponding next lifecycle event in which to unsubscribe, for Activities.
0 commit comments