Fixed
Status Update
Comments
wd...@google.com <wd...@google.com>
di...@google.com <di...@google.com> #2
Navigation is built with Support Library Fragments so has no access to the FragmentFactory itself. I think we can make some minor changes to FragmentNavigator to make it easy for developers who are using Navigation 1.0 and Fragments 1.1.0 together to call through to their FragmentFactory.
Once Navigation switches to AndroidX (post 1.0), we'll use FragmentFactory directly.
Once Navigation switches to AndroidX (post 1.0), we'll use FragmentFactory directly.
jb...@gmail.com <jb...@gmail.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 1b215f0d93828286782776b9a12d2387097947f9
Author: Ian Lake <ilake@google.com>
Date: Sun Nov 25 21:45:56 2018
Move Fragment creation to FragmentNavigator
Provide an instantiateFragment() method on
FragmentNavigator which serves as the
centralized place to instantiate new
Fragment instances for FragmentNavigator.
Besides moving this business logic out of
the dumb POJO FragmentNavigator.Destination,
this also provides a future extension point
for integrating in FragmentFactory.
Test: existing tests passes, testapp still works
BUG: 119054429
Change-Id: If60471a704ef77bc35b30838e152a31cde8bc235
M navigation/fragment/ktx/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorDestinationBuilderTest.kt
M navigation/fragment/ktx/src/main/java/androidx/navigation/fragment/FragmentNavigatorDestinationBuilder.kt
M navigation/fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
M navigation/fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.java
https://android-review.googlesource.com/835682
https://goto.google.com/android-sha1/1b215f0d93828286782776b9a12d2387097947f9
Branch: androidx-master-dev
commit 1b215f0d93828286782776b9a12d2387097947f9
Author: Ian Lake <ilake@google.com>
Date: Sun Nov 25 21:45:56 2018
Move Fragment creation to FragmentNavigator
Provide an instantiateFragment() method on
FragmentNavigator which serves as the
centralized place to instantiate new
Fragment instances for FragmentNavigator.
Besides moving this business logic out of
the dumb POJO FragmentNavigator.Destination,
this also provides a future extension point
for integrating in FragmentFactory.
Test: existing tests passes, testapp still works
BUG: 119054429
Change-Id: If60471a704ef77bc35b30838e152a31cde8bc235
M navigation/fragment/ktx/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorDestinationBuilderTest.kt
M navigation/fragment/ktx/src/main/java/androidx/navigation/fragment/FragmentNavigatorDestinationBuilder.kt
M navigation/fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
M navigation/fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.java
mo...@gmail.com <mo...@gmail.com> #4
Navigation still depends on Support Library and not AndroidX, so we can't directly use FragmentFactory in FragmentNavigator.
However, in alpha08, you'll be able to subclass FragmentNavigator and override instantiateFragment(), calling into FragmentFactory if you're using AndroidX Fragment 1.1.0+. You'd also need to subclass NavHostFragment and override createFragmentNavigator() to return your custom FragmentNavigator subclass (or, if you're not using app:navGraph, you can set it via navHostFragment.navController.navigatorProvider += YourFragmentNavigator(context, navHostFragment.childFragmentManager)).
We'll keep this open until Navigation has moved to AndroidX and can directly use FragmentFactory as its default implementation of instantiateFragment().
However, in alpha08, you'll be able to subclass FragmentNavigator and override instantiateFragment(), calling into FragmentFactory if you're using AndroidX Fragment 1.1.0+. You'd also need to subclass NavHostFragment and override createFragmentNavigator() to return your custom FragmentNavigator subclass (or, if you're not using app:navGraph, you can set it via navHostFragment.navController.navigatorProvider += YourFragmentNavigator(context, navHostFragment.childFragmentManager)).
We'll keep this open until Navigation has moved to AndroidX and can directly use FragmentFactory as its default implementation of instantiateFragment().
jl...@google.com <jl...@google.com> #5
Thanks for the workaround in alpha08!
mo...@gmail.com <mo...@gmail.com> #6
Can't wait to use this library after the move to AndroidX.
For us is a major blocking feature and we don't want to proceed overriding all the necessary classes.
Thank you Ian and the rest of the navigation team.
For us is a major blocking feature and we don't want to proceed overriding all the necessary classes.
Thank you Ian and the rest of the navigation team.
jl...@google.com <jl...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 74c3760e428648d00249dc1d38865b7802f48a9a
Author: Ian Lake <ilake@google.com>
Date: Wed Mar 13 13:11:57 2019
Use FragmentFactory in FragmentNavigator
Rely on the FragmentManager's FragmentFactory
to instantiate Fragments created for
FragmentNavigator.
Test: new FragmentNavigatorTest
Fixes: 119054429
Change-Id: Icbeb2771e29cafdc52e4c4ea770ce89f739921d1
M navigation/fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
M navigation/fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.java
https://android-review.googlesource.com/928481
https://goto.google.com/android-sha1/74c3760e428648d00249dc1d38865b7802f48a9a
Branch: androidx-master-dev
commit 74c3760e428648d00249dc1d38865b7802f48a9a
Author: Ian Lake <ilake@google.com>
Date: Wed Mar 13 13:11:57 2019
Use FragmentFactory in FragmentNavigator
Rely on the FragmentManager's FragmentFactory
to instantiate Fragments created for
FragmentNavigator.
Test: new FragmentNavigatorTest
Fixes: 119054429
Change-Id: Icbeb2771e29cafdc52e4c4ea770ce89f739921d1
M navigation/fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
M navigation/fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.java
jl...@google.com <jl...@google.com> #8
This is fixed internally - FragmentNavigator will use the FragmentFactory to create Fragments in the upcoming 2.1.0-alpha01 release.
mo...@gmail.com <mo...@gmail.com> #9
Thank you Ian :)
jl...@google.com <jl...@google.com> #10
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 3dd6d1fcdb3ffa7d4bd265a023f0ac7c94e14d19
Author: Ian Lake <ilake@google.com>
Date: Mon Mar 18 09:36:37 2019
Deprecate FragmentNavigator.instantiateFragment
Instead of providing a custom subclass of
FragmentNavigator, instantiation of Fragments
should be controlled by setting a custom
FragmentFactory, which is the default behavior
of instantiateFragment() now.
By deprecating the class, we ensure that
developers who were overriding this method
are informed of the changes and can change
their code to use FragmentFactory.
Test: ./gradlew checkApi
BUG: 119054429
Change-Id: Iff46919face98baa6dc62835ca3fc105d987d141
M navigation/fragment/api/2.1.0-alpha01.txt
M navigation/fragment/api/current.txt
M navigation/fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.java
https://android-review.googlesource.com/930120
https://goto.google.com/android-sha1/3dd6d1fcdb3ffa7d4bd265a023f0ac7c94e14d19
Branch: androidx-master-dev
commit 3dd6d1fcdb3ffa7d4bd265a023f0ac7c94e14d19
Author: Ian Lake <ilake@google.com>
Date: Mon Mar 18 09:36:37 2019
Deprecate FragmentNavigator.instantiateFragment
Instead of providing a custom subclass of
FragmentNavigator, instantiation of Fragments
should be controlled by setting a custom
FragmentFactory, which is the default behavior
of instantiateFragment() now.
By deprecating the class, we ensure that
developers who were overriding this method
are informed of the changes and can change
their code to use FragmentFactory.
Test: ./gradlew checkApi
BUG: 119054429
Change-Id: Iff46919face98baa6dc62835ca3fc105d987d141
M navigation/fragment/api/2.1.0-alpha01.txt
M navigation/fragment/api/current.txt
M navigation/fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.java
ke...@gmail.com <ke...@gmail.com> #11
#8
I found an issue may related to this.
Detail is here 244376735.
I found an issue may related to this.
Detail is here 244376735.
Description
Shortly after launch, layout inspector crashes the app within first 10 seconds. Sometimes it may stay for longer, until I click some view for inspection. The crash occurs regardless of the device I use: Samsung Tab S6 Lite (API 31), Android Emulator (API 32) and Pixel 4 (API 33). For some reason this issue is specific to my project and I wasn't able to create a reproducible test project for you. I've attached logs from devices and a thread dump from Android Studio.
I would be grateful for any insight on where to look for the problem.
P.S. Also, I can't file an issue under Android Studio > Design Tools > Layout Inspector category.