Status Update
Comments
js...@google.com <js...@google.com>
ka...@gmail.com <ka...@gmail.com> #2
Running into a similar issue, any update on this?
ka...@gmail.com <ka...@gmail.com> #3
This is a platform behavior change.
ka...@gmail.com <ka...@gmail.com> #4
va...@gmail.com <va...@gmail.com> #5
ya...@google.com <ya...@google.com> #7
de...@google.com <de...@google.com>
bo...@google.com <bo...@google.com> #9
de...@google.com <de...@google.com> #10
This issue is also stopping us from being able to support edge-to-edge in Android 15. Given it's a enforced requirement for targeting Android 15, couldn't this be prioritised higher? Companies like us have hundreds of screens to fix so waiting until 2025 for a workaround is going to be tough work.
de...@google.com <de...@google.com>
ka...@gmail.com <ka...@gmail.com> #11
Maybe you can create a static method, com.your.company.ViewGroupCompat#installCompatInsetsDispatch
, like this:
After creating the method, you need to call ViewGroupCompat.installCompatInsetsDispatch(getWindow().getDecorView())
in onCreate()
of your activity to make the behavior compatible with API 30+.
When the new library with the API is released, you can replace com.your.company.ViewGroupCompat
with androidx.core.view.ViewGroupCompat
.
ya...@google.com <ya...@google.com> #12
Wow quick response, thanks! I just tried applying that workaround to our root view and can confirm it fixes the issue. (Also FYI there's a typo in the PR; "comsumed")
ka...@gmail.com <ka...@gmail.com> #13
I'm getting a crash when using new version of ktx-core 1.16.0-alpha01
with fixed ViewCompat and ViewGroupCompat on API < 30. This is related to FragmentContainerView
:
java.lang.NullPointerException: Parameter specified as non-null is null: method androidx.fragment.app.FragmentContainerView.setOnApplyWindowInsetsListener, parameter listener
at androidx.fragment.app.FragmentContainerView.setOnApplyWindowInsetsListener(Unknown Source:2)
at androidx.core.view.ViewGroupCompat.dispatchApplyWindowInsets(ViewGroupCompat.java:255)
at androidx.core.view.ViewGroupCompat.dispatchApplyWindowInsets(ViewGroupCompat.java:264)
at androidx.core.view.ViewGroupCompat.dispatchApplyWindowInsets(ViewGroupCompat.java:264)
at androidx.core.view.ViewGroupCompat.dispatchApplyWindowInsets(ViewGroupCompat.java:264)
at androidx.core.view.ViewGroupCompat.dispatchApplyWindowInsets(ViewGroupCompat.java:264)
at androidx.core.view.ViewGroupCompat.dispatchApplyWindowInsets(ViewGroupCompat.java:264)
at androidx.core.view.ViewGroupCompat.dispatchApplyWindowInsets(ViewGroupCompat.java:264)
at androidx.core.view.ViewGroupCompat.lambda$installCompatInsetsDispatch$0(ViewGroupCompat.java:218)
at androidx.core.view.ViewGroupCompat$$ExternalSyntheticLambda1.onApplyWindowInsets(D8$$SyntheticClass:0)
at android.view.View.dispatchApplyWindowInsets(View.java:10499)
at android.view.ViewGroup.dispatchApplyWindowInsets(ViewGroup.java:7191)
at android.view.ViewRootImpl.dispatchApplyInsets(ViewRootImpl.java:1925)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2030)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1721)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7598)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:966)
at android.view.Choreographer.doCallbacks(Choreographer.java:790)
at android.view.Choreographer.doFrame(Choreographer.java:725)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:951)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
ya...@google.com <ya...@google.com> #14
Re
I think the @NonNull
annotation of androidx.fragment.app.FragmentContainerView.setOnApplyWindowInsetsListener
has been removed since
Do you mind upgrading your androidx.fragment version to 1.4.0-alpha09 or above? The latest version is
ko...@google.com <ko...@google.com> #17
Ah, you are right. It still requires a non-null object since the required type is not OnApplyWindowInsetsListener?
but OnApplyWindowInsetsListener
.
public override fun setOnApplyWindowInsetsListener(listener: OnApplyWindowInsetsListener) {
applyWindowInsetsListener = listener
}
Hi Jeremy,
Do you mind checking why androidx.fragment.app.FragmentContainerView.setOnApplyWindowInsetsListener
requires a non-null parameter? The restriction was added in
Description
P.S. I didn't have permission to create this ticket in the GPU category.
Thanks
STEPS TO REPRODUCE:
1. Just launch any avd on the emulator
------------------
Studio Build:
Android Studio Bumblebee | 2021.1.1 Patch 3
Build #AI-211.7628.21.2111.8309675, built on March 16, 2022
Runtime version: 11.0.11+0-b60-7590822 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.3
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 4
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: org.jetbrains.kotlin (211-1.6.20-release-275-AS7442.40)
OS: macOS Monterey 12.3