Fixed
Status Update
Comments
er...@gmail.com <er...@gmail.com> #2
> The Transition Kotlin extensions target the Framework Transition class which is a bit confusing
All extensions in 'core-ktx' target either 'core' or the framework types. This is working as expected. It sounds like this is a feature request for a transition-ktx with equivalent extensions for the androidx.transition types.
> as most framework classes are being deprecated in favor of their AndroidX counterparts, Fragments for example.
"Most"? This *dramatically* overstates what is actually happening. Fragments (and loaders) were added to the framework in a time where the Android team did not have external libraries for shipping features. Transition was added 5 years later.
All extensions in 'core-ktx' target either 'core' or the framework types. This is working as expected. It sounds like this is a feature request for a transition-ktx with equivalent extensions for the androidx.transition types.
> as most framework classes are being deprecated in favor of their AndroidX counterparts, Fragments for example.
"Most"? This *dramatically* overstates what is actually happening. Fragments (and loaders) were added to the framework in a time where the Android team did not have external libraries for shipping features. Transition was added 5 years later.
er...@gmail.com <er...@gmail.com> #3
Pardon my misunderstanding, I was under the belief that where possible, new features that could be developed outside the framework, would be under Androidx. Also it's a common refrain to use the Androidx libraries over the framework libraries where possible, as those ship update independently of platform releases. I wasn't attempting to be dramatic.
If the Transition api is unlikely to change, there is no need for a transition-ktx for androidx.transition types. If developers should use Androidx transitions over framework transitions where possible however, then it would be much appreciated.
I am well aware of the limitations that existed when Fragments and Loaders were created, and when the Transition api was introduced.
If the Transition api is unlikely to change, there is no need for a transition-ktx for androidx.transition types. If developers should use Androidx transitions over framework transitions where possible however, then it would be much appreciated.
I am well aware of the limitations that existed when Fragments and Loaders were created, and when the Transition api was introduced.
jg...@google.com <jg...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit ae42e311ecfbac18cedc90e489d1fdde956a4557
Author: Jake Wharton <jakew@google.com>
Date: Fri Nov 22 11:13:30 2019
Introduce transition-ktx for standalone transition library
These extensions are the same as androidx.core.transition for the platform types, just adapted to the standalone library.
Bug: 138870873
Test: gw :transition:transition-ktx:build :transition:transition-ktx:connectedCheck
Change-Id: Ie80022cc60ed1f482b7593db5ef1ac1c5ea33d8d
M buildSrc/src/main/kotlin/androidx/build/PublishDocsRules.kt
M jetifier/jetifier/migration.config
M settings.gradle
A transition/transition-ktx/OWNERS
A transition/transition-ktx/api/1.4.0-alpha01.txt
A transition/transition-ktx/api/current.txt
A transition/transition-ktx/api/public_plus_experimental_1.4.0-alpha01.txt
A transition/transition-ktx/api/public_plus_experimental_current.txt
A transition/transition-ktx/api/res-1.4.0-alpha01.txt
A transition/transition-ktx/api/restricted_1.4.0-alpha01.txt
A transition/transition-ktx/api/restricted_current.txt
A transition/transition-ktx/build.gradle
A transition/transition-ktx/src/androidTest/AndroidManifest.xml
A transition/transition-ktx/src/androidTest/java/androidx/transition/TestActivity.kt
A transition/transition-ktx/src/androidTest/java/androidx/transition/TransitionTest.kt
A transition/transition-ktx/src/androidTest/res/layout/test_activity.xml
A transition/transition-ktx/src/main/AndroidManifest.xml
A transition/transition-ktx/src/main/java/androidx/transition/Transition.kt
https://android-review.googlesource.com/1172715
Branch: androidx-master-dev
commit ae42e311ecfbac18cedc90e489d1fdde956a4557
Author: Jake Wharton <jakew@google.com>
Date: Fri Nov 22 11:13:30 2019
Introduce transition-ktx for standalone transition library
These extensions are the same as androidx.core.transition for the platform types, just adapted to the standalone library.
Bug: 138870873
Test: gw :transition:transition-ktx:build :transition:transition-ktx:connectedCheck
Change-Id: Ie80022cc60ed1f482b7593db5ef1ac1c5ea33d8d
M buildSrc/src/main/kotlin/androidx/build/PublishDocsRules.kt
M jetifier/jetifier/migration.config
M settings.gradle
A transition/transition-ktx/OWNERS
A transition/transition-ktx/api/1.4.0-alpha01.txt
A transition/transition-ktx/api/current.txt
A transition/transition-ktx/api/public_plus_experimental_1.4.0-alpha01.txt
A transition/transition-ktx/api/public_plus_experimental_current.txt
A transition/transition-ktx/api/res-1.4.0-alpha01.txt
A transition/transition-ktx/api/restricted_1.4.0-alpha01.txt
A transition/transition-ktx/api/restricted_current.txt
A transition/transition-ktx/build.gradle
A transition/transition-ktx/src/androidTest/AndroidManifest.xml
A transition/transition-ktx/src/androidTest/java/androidx/transition/TestActivity.kt
A transition/transition-ktx/src/androidTest/java/androidx/transition/TransitionTest.kt
A transition/transition-ktx/src/androidTest/res/layout/test_activity.xml
A transition/transition-ktx/src/main/AndroidManifest.xml
A transition/transition-ktx/src/main/java/androidx/transition/Transition.kt
jg...@google.com <jg...@google.com> #5
Btw, as a temporary workaround before a fix is released you can probably copy-paste the FragmentStateAdapter [1] class and patch it locally?
[1]https://android.googlesource.com/platform/frameworks/support/+/androidx-master-dev/viewpager2/src/main/java/androidx/viewpager2/adapter/FragmentStateAdapter.java
[1]
ch...@beyls.net <ch...@beyls.net> #6
In my case the simplest workaround was to add fragment.setMenuItemVisible(false) directly in the createFragment(position) method of my adapters, right before returning the fragment.
jg...@google.com <jg...@google.com>
je...@google.com <je...@google.com>
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-master-dev
commit dca177316c5d2771759641d01f956b0f49892ca7
Author: Jelle Fresen <jellefresen@google.com>
Date: Fri Jan 17 17:32:28 2020
Fix for Fragment menu visibility issue in FSA
The fragment's menu visibility is directly related to the fragment's max
lifecycle. When the max lifecycle is STARTED, the menu should not be
visible. When the max lifecycle is RESUMED, the menu should be visible.
This CL fixes the bug where a fragment that is added to the fragment
manager by FragmentStateAdapter did set the max lifecycle to STARTED,
but did not set the menu visibility to false.
Relnote: "Fixed `FragmentStateAdapter` issue with initial fragment menu
visibility when adding a fragment to the `FragmentManager`."
Bug: 144442240
Test: ./gradlew viewpager2:viewpager2:cC \
-Pandroid.testInstrumentationRunnerArguments.class=\
androidx.viewpager2.widget.FragmentLifecycleTest
Change-Id: I9d2ffa0efcb03b63eeca25f2d4e74c81446a5774
M viewpager2/viewpager2/src/androidTest/java/androidx/viewpager2/widget/FragmentLifecycleTest.kt
M viewpager2/viewpager2/src/main/java/androidx/viewpager2/adapter/FragmentStateAdapter.java
https://android-review.googlesource.com/1211984
Branch: androidx-master-dev
commit dca177316c5d2771759641d01f956b0f49892ca7
Author: Jelle Fresen <jellefresen@google.com>
Date: Fri Jan 17 17:32:28 2020
Fix for Fragment menu visibility issue in FSA
The fragment's menu visibility is directly related to the fragment's max
lifecycle. When the max lifecycle is STARTED, the menu should not be
visible. When the max lifecycle is RESUMED, the menu should be visible.
This CL fixes the bug where a fragment that is added to the fragment
manager by FragmentStateAdapter did set the max lifecycle to STARTED,
but did not set the menu visibility to false.
Relnote: "Fixed `FragmentStateAdapter` issue with initial fragment menu
visibility when adding a fragment to the `FragmentManager`."
Bug: 144442240
Test: ./gradlew viewpager2:viewpager2:cC \
-Pandroid.testInstrumentationRunnerArguments.class=\
androidx.viewpager2.widget.FragmentLifecycleTest
Change-Id: I9d2ffa0efcb03b63eeca25f2d4e74c81446a5774
M viewpager2/viewpager2/src/androidTest/java/androidx/viewpager2/widget/FragmentLifecycleTest.kt
M viewpager2/viewpager2/src/main/java/androidx/viewpager2/adapter/FragmentStateAdapter.java
je...@google.com <je...@google.com>
v....@gmail.com <v....@gmail.com> #8
I think this issue relates to https://issuetracker.google.com/issues/147550812 as well and that other issue can be marked as fixed too.
Checked on 1.1.0-alpha01 and can confirm the fix.
Checked on 1.1.0-alpha01 and can confirm the fix.
ni...@gmail.com <ni...@gmail.com> #9
Comment has been deleted.
14...@gmail.com <14...@gmail.com> #10
Still having issue in alpha, when you slide very fast, icon will disappear for a while!
je...@google.com <je...@google.com> #11
Can you file a new bug for that? It sounds like that is a separate issue where for a brief period of time there none of the fragments is in RESUMED state. We'd need to figure out if that is a bug or working as intended.
Description
As a result, between the time the fragment is added and the time it becomes the new primary fragment of the ViewPager2, its menu is briefly shown at the same time as the menu of the current primary fragment, creating a visual glitch of duplicate menu items.
Fix: update the code of FragmentStateAdapter to call newFragment.setMenuItemVisible(false) right after creating the fragment using createFragment(position)