Fixed
Status Update
Comments
jb...@google.com <jb...@google.com> #2
Thank you for reporting this issue. For us to further investigate this issue, please provide the following additional information:
Steps to reproduce
Please provide a sample application or apk to reproduce the issue.
Also kindly mention the steps to be followed for reproducing the issue with the given sample application.
Steps to reproduce
Please provide a sample application or apk to reproduce the issue.
Also kindly mention the steps to be followed for reproducing the issue with the given sample application.
ch...@beyls.net <ch...@beyls.net> #3
Please provide the information as requested in comment #2 , For us to further investigate this issue.
il...@google.com <il...@google.com> #4
We are closing this issue as we don't have enough actionable information. If you are still facing this problem, please open new issue and add the relevant information along with reference to earlier issue.
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #5
I'm not sure who decided there isn't enough information. The description contains the exact steps to reproduce the bug.
However if you follow the instructions here:https://developer.android.com/guide/topics/ui/dialogs#CustomLayout you also will hit this bug.
Basically the android x dialog fragment has the hook to call onCreateDialog in a callback to the layout inflater. However, accessing the layout inflater recursively triggers onCreateDialog...
However if you follow the instructions here:
Basically the android x dialog fragment has the hook to call onCreateDialog in a callback to the layout inflater. However, accessing the layout inflater recursively triggers onCreateDialog...
jb...@google.com <jb...@google.com> #6
The bug is essentially in Fragment:
LayoutInflater performGetLayoutInflater(@Nullable Bundle savedInstanceState) {
LayoutInflater layoutInflater = onGetLayoutInflater(savedInstanceState);
mLayoutInflater = layoutInflater;
return mLayoutInflater;
}
Because the layout inflator is not "set" invoking the callback onGetLayoutInflator() which is where onCreateDialog() is invoked will cause the cycle to repeat if you call getLayoutInflater in onCreateDialog()
The fix should be just reordering the code to set the inflater before invoking the callback.
LayoutInflater performGetLayoutInflater(@Nullable Bundle savedInstanceState) {
mLayoutInflater = layoutInflater;
LayoutInflater layoutInflater = onGetLayoutInflater(savedInstanceState);
return mLayoutInflater;
}
LayoutInflater performGetLayoutInflater(@Nullable Bundle savedInstanceState) {
LayoutInflater layoutInflater = onGetLayoutInflater(savedInstanceState);
mLayoutInflater = layoutInflater;
return mLayoutInflater;
}
Because the layout inflator is not "set" invoking the callback onGetLayoutInflator() which is where onCreateDialog() is invoked will cause the cycle to repeat if you call getLayoutInflater in onCreateDialog()
The fix should be just reordering the code to set the inflater before invoking the callback.
LayoutInflater performGetLayoutInflater(@Nullable Bundle savedInstanceState) {
mLayoutInflater = layoutInflater;
LayoutInflater layoutInflater = onGetLayoutInflater(savedInstanceState);
return mLayoutInflater;
}
ch...@beyls.net <ch...@beyls.net> #7
Actually that doesn't work, a better solution is to not hook onCreateDialog into the onGetLayoutInflater callback... but there is a nasty dependency between DialogFragment and Fragment that I don't have time to try and resolve.
pr...@google.com <pr...@google.com> #8
Using requireActivity().layoutInflater as is done in the Java code sample in the docs is one workaround until this can be fixed.
pr...@google.com <pr...@google.com> #9
I just wound up using the following as a work around:
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
dialogView = LayoutInflater.from(context).inflate(R.layout.fragment_add_user, null)
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
dialogView = LayoutInflater.from(context).inflate(R.layout.fragment_add_user, null)
Description
Version used: 1.7.0
Devices/Android versions reproduced on: Pixel 7 running Android 14
When enabling predictive back animations, the predictive back gesture now also animates transitions between fragments since Fragment 1.7.0 (in combination with the AndroidX Transition library version 1.5.0).
However, if the Fragment transition includes a shared element that uses the ChangeTransform() transition, then the animation breaks when triggered by the back gesture.
Display also ends up empty if the transition is cancelled, then both fragments are shown at the same time when navigating back. See the attached video for a demonstration.
A sample project to reproduce the issue can be cloned from: