From 79338423e6290eb89b9e1ed786a8f4b7a5f66473 Mon Sep 17 00:00:00 2001 From: Martin Guillon Date: Thu, 10 Feb 2022 10:40:06 +0100 Subject: [PATCH] fix: use hide to prevent black with OpenGL during a transition --- packages/core/ui/frame/index.android.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/core/ui/frame/index.android.ts b/packages/core/ui/frame/index.android.ts index 55af28052..dadb7dab4 100644 --- a/packages/core/ui/frame/index.android.ts +++ b/packages/core/ui/frame/index.android.ts @@ -439,6 +439,11 @@ export class Frame extends FrameBase { //transaction.setTransition(androidx.fragment.app.FragmentTransaction.TRANSIT_FRAGMENT_OPEN); } + if (this._currentEntry && this._currentEntry.entry.backstackVisible === false) { + // we only hide the fragment to fix some black blick issues with GLSurfaceView and GLTextureView + // it will be removed once the navigation is done + transaction.hide(this._currentEntry.fragment); + } if (clearHistory || isReplace) { // we need to ensure we dont listen for animations of // in between fragments or they could break our transition end handling @@ -450,9 +455,6 @@ export class Frame extends FrameBase { } else { transaction.add(this.containerViewId, newFragment, newFragmentTag); } - if (this._currentEntry && this._currentEntry.entry.backstackVisible === false) { - transaction.remove(this._currentEntry.fragment); - } transaction.commitNowAllowingStateLoss(); }