Bug P3
Status Update
Comments
vi...@google.com <vi...@google.com> #2
Thank you for reporting this issue. For us to further investigate this issue, please provide the following additional information:
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Expected output
What is the expected output?
Current output
What is the current output?
he...@gmail.com <he...@gmail.com> #3
How can you possibly need more information, i just told you the exact part of code causing the issue, and the code changes required to fix it!
Please read the description.
Expected output:
What is the expected output?
See attached "expected.webm" video in OP
Current output
What is the current output?
See attached "actual.webm" video in OP
Please read the description.
Expected output:
What is the expected output?
See attached "expected.webm" video in OP
Current output
What is the current output?
See attached "actual.webm" video in OP
he...@gmail.com <he...@gmail.com> #4
1. Import attached project
2. Install and run on Android 5 (Lollipop) or above
3. Click FAB and see it fall below/behind the navigation bar once the Snackbar disappear
2. Install and run on Android 5 (Lollipop) or above
3. Click FAB and see it fall below/behind the navigation bar once the Snackbar disappear
vi...@google.com <vi...@google.com> #5
Could you please check the attached project as we couldn't extract the files from it.
he...@gmail.com <he...@gmail.com> #6
It's a RAR archive, there's no issue with it.
However you have problems extracting such, here's the same content as a ZIP archive.
However you have problems extracting such, here's the same content as a ZIP archive.
vi...@google.com <vi...@google.com> #7
Thank you for reporting this issue. We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
vi...@google.com <vi...@google.com> #8
@ coordinator layout,
Please check this issue and provide your inputs.
Please check this issue and provide your inputs.
al...@google.com <al...@google.com>
da...@gmail.com <da...@gmail.com> #9
This is still an issue in 1.2.0. Looks like nobody at Google uses FABs with Snackbars in CoordinatorLayout? How can such obvious issue be still present after more than 3 years?
vl...@desygner.com <vl...@desygner.com> #10
This seems to work around the issue successfully:
snackbar.addCallback(object : Snackbar.Callback() {
override fun onDismissed(transientBottomBar: Snackbar?, event: Int) {
transientBottomBar?.removeCallback(this)
Handler(Looper.getMainLooper()).post {
coordinatorLayout?.requestApplyInsets()
}
}
})
Description
androidx.coordinatorlayout:coordinatorlayout:1.1.0-rc02
Version used:
1.1.0-rc02
Theme used:
Irrelevant
Devices/Android versions reproduced on:
All
Description:
When using an CoordinatorLayout with fitsSystemWindows=true in an Activity with SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION any child with layout_gravity=bottom, e.g. an FloatingActionButton, will fall below/behind the navigation bar, i.e. it doesn't account for WindowInsets, after a bottom sheet, e.g. Snackbar, has been dismissed. See "actual.webm". Any view with gravity and a dependency are likely affected.
The bug is located in the onChildViewsChanged() method, called when the dependency (Snackbar) view is dismissed, as seen it doesn't account for WindowInsets:
The fix is simple, after the "inset" declaration, before the for-loop, just add the following lines, or something similar to ensure a dependent view isn't placed within the WindowInsets (result in "expected.webm"):
if (mLastInsets != null) {
inset.set(
mLastInsets.getSystemWindowInsetLeft(),
mLastInsets.getSystemWindowInsetTop(),
mLastInsets.getSystemWindowInsetRight(),
mLastInsets.getSystemWindowInsetBottom());
}
Please prioritize this issue, it's impossible to workaround by sub-classing since the onChildViewsChanged method is final. I had to pull, patch and compile my own coordinatorlayout module.