Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
Can you rise priority please?
It's a real stopper to use in not helloworld apps.
It must be joke, define it as "An issue that should be addressed eventually. Such an issue is not relevant to core organizational functions or the work of other teams, or else it relates only to the attractiveness or pleasantness of the system."
Why use compose in production, if this base things resolved for years?
It's a real stopper to use in not helloworld apps.
It must be joke, define it as "An issue that should be addressed eventually. Such an issue is not relevant to core organizational functions or the work of other teams, or else it relates only to the attractiveness or pleasantness of the system."
Why use compose in production, if this base things resolved for years?
ap...@google.com <ap...@google.com> #3
This is high priority for us. The "Priority" field on buganizer is misleading, it has a very specific internal meaning and interaction with other systems so we don't use it for actual prioritization for compose text issues. Unfortunately, the way we track actual priority is not visible externally.
il...@google.com <il...@google.com> #4
Does this work as expected for you with Views? I was able to reproduce this bug with views as well – an EditText
inside a ScrollView
will not cause the view to scroll to keep the EditText
in view if the keyboard covers it.
Description
Build: AI-201.8743.12.41.6953283, 202011050241,
AI-201.8743.12.41.6953283, JRE 1.8.0_242-release-1644-b3-6222593x64 JetBrains s.r.o, OS Linux(amd64) v5.4.0-53-generic, screens 3440x1440
AS: 4.1.1; Kotlin plugin: 1.4.10-release-Studio4.1-1; Android Gradle Plugin: 4.1.1; Gradle: 6.5; NDK: from local.properties: (not specified), latest from SDK: 21.3.6528147; LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: 3.16.3
Affected version:
androidx.fragment:fragment-ktx:1.2.5
Note: It looks like all versions starting from 1.2+ are affected
Description
When you have view pager with nested fragment that shows menu it will crash if you try to access menu items from
onPrepareOptionsMenu
.Steps to reproduce
ViewPager
Fragment1
Fragment2
Fragment2
add nestedFragment21
and enablesetHasOptionsMenu(true)
, also add new menu specific to this fragmentFragment21
fromonPrepareOptionsMenu
Expected behavior
onPrepareOptionsMenu
should never be called if menu is not inflatedActual behavior
onPrepareOptionsMenu
Additional information
Looking through the changes I was able to pinpoint it to this behavior change:https://android.googlesource.com/platform/frameworks/support/+/4809e01d4153a5ba68cb68f36544baa1b90738c0
We are now also checking for parent menu visibility but only in
dispatchCreateOptionsMenu
, which means we would calldispatchPrepareOptionsMenu
with no menu inflated since we skipped it.Possible fix
dispatch*Menu
methods, ordispatchCreateOptionsMenu
Demo repository:
You can find repository with repro steps here:https://github.com/vovkab/fragment-menu-crash