Status Update
Comments
[Deleted User] <[Deleted User]> #2
Please include a sample project that reproduces your issue.
il...@google.com <il...@google.com> #3
Steps to reproduce:
1. Press on "Search" icon;
2. Write something;
3. Search this text, keyboard will be dismissed;
4. Tap on "Dialog" button;
5. Dissmiss dialog;
With the new 1.5.0 fragment library version text will be cleared in the search box after dismissing dialog.
In the version 1.4.1 and lower text in the search is not clearing and this is correct behaviour.
Please suggest some workarounds or how to fix this issue?
ap...@google.com <ap...@google.com> #4
ap...@google.com <ap...@google.com> #5
ap...@google.com <ap...@google.com> #6
an...@google.com <an...@google.com> #7
Hello
I raised similar issue with this ticket
This makes the SearchView unusable/broken when fragments are changed (i.e base on searchView input query)
What can we do to fix this problem? What is the progress of work on solving this problem?
to...@gmail.com <to...@gmail.com> #8
il...@google.com <il...@google.com> #9
Any idea on when it will be fixed?
to...@gmail.com <to...@gmail.com> #10
to...@gmail.com <to...@gmail.com> #11
Can you update regarding any progress on this issue.
il...@google.com <il...@google.com> #12
to...@gmail.com <to...@gmail.com> #13
Branch: androidx-main
commit 50f098644adc703ae218b0b7e999629f516a0241
Author: sanura <sanura@google.com>
Date: Thu Mar 02 00:11:35 2023
Add check to only invalidate options menu when contributing menu items
FragmentManager previously appropriately only added
a MenuProvider when the host is a MenuHost **and**
we are at the root fragment that is providing the
menu items. This behavior should be mirrored when
removing a MenuProvider as well, so that only
components that directly contribute menu items will
invalidate the options menu.
Bug: 244336571
Test: all tests pass
Change-Id: I9404ee9fcc9ce6b80d70a93bea720fe4ccf583a0
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentContainerInflatedFragmentTest.kt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/OptionsMenuFragmentTest.kt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/test/FragmentTestActivity.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
il...@google.com <il...@google.com> #14
Please show what to write on gradle file.
to...@gmail.com <to...@gmail.com> #15
This has been fixed internally and will be available in the Fragment 1.6.0-alpha07
release.
il...@google.com <il...@google.com> #16
It's part of the material dependency, perhaps?
to...@gmail.com <to...@gmail.com> #17
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.fragment:fragment:1.6.0-alpha07
ap...@google.com <ap...@google.com> #18
ap...@google.com <ap...@google.com> #19
It says "Duplicate class found".
The IDE doesn't provide any useful explanation of what is the class that is duplicated and what to do about it.
Please help.
jb...@google.com <jb...@google.com> #20
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.fragment:fragment:1.5.6
sw...@gmail.com <sw...@gmail.com> #21
il...@google.com <il...@google.com> #22
@21 androidx.fragment:fragment:1.5.6 is a STABLE release. It has the fix we need. The androidx.fragment:fragment:1.6.0-alpha07 is an alpha as it says. 1.6 is "work in progress". 1.6.0 is still not a stable release. Use "alpha" only for testing
ch...@gmail.com <ch...@gmail.com> #23
il...@google.com <il...@google.com> #24
Re #23 - sounds like onViewCreated()
is what you're looking for.
Description
Version used: 1.2.0-rc02
onActivityCreated() is a callback provided to Fragments ostensibly for when the activity is finished being created, but it ends up actually being tied into the Fragment view's lifecycle - it is actually called between onViewCreated() and onViewStateRestored() and can be called multiple times in cases where the Fragment is detached/re-attached or moved onto the back stack.
Besides being, at best, confusingly named, the original purpose of giving a callback after the Activity's onCreate() completes indicates a strong coupling between the logic in the Fragment and the logic running in the Activity's onCreate(), which is not a pattern we want to encourage. In general, Fragment should act independently from the Activity, being passed external arguments as constructor parameters via FragmentFactory.
We should deprecate onActivityCreated(), citing that the method is called directly after onViewCreated() and is not a one time call immediately after the activity is created as the name suggests. Code touching the Fragment's view should be in onViewCreated() and other initialization should be done in onCreate(). If the developer specifically wants a callback of when the Activity's onCreate() is complete, they should register a LifecycleObserver on the Activity's Lifecycle, removing it when they receive the onCreate() callback.