From e9b5ef293507a5bde4876679dbd55699eda24a81 Mon Sep 17 00:00:00 2001 From: brian-pitsch Date: Thu, 24 Oct 2019 16:36:47 -0500 Subject: [PATCH] Run onLayout whenever the video dimensions change --- .../main/java/com/twiliorn/library/RNVideoViewGroup.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/android/src/main/java/com/twiliorn/library/RNVideoViewGroup.java b/android/src/main/java/com/twiliorn/library/RNVideoViewGroup.java index 55aa5e77..7acfc122 100644 --- a/android/src/main/java/com/twiliorn/library/RNVideoViewGroup.java +++ b/android/src/main/java/com/twiliorn/library/RNVideoViewGroup.java @@ -8,6 +8,8 @@ import android.content.Context; import android.graphics.Point; +import android.os.Handler; +import android.os.Looper; import android.view.ViewGroup; import com.twilio.video.VideoRenderer; @@ -44,6 +46,13 @@ public void onFrameDimensionsChanged(int vw, int vh, int rotation) { videoWidth = vw; RNVideoViewGroup.this.forceLayout(); } + new Handler(Looper.getMainLooper()).post(new Runnable(){ + @Override + public void run() { + RNVideoViewGroup me = RNVideoViewGroup.this; + me.onLayout(true, me.getLeft(), me.getTop(), me.getRight(), me.getBottom()); + } + }); } } );