Skip to content
Permalink
Browse files
Merge pull request #9243 from JosJuice/android-input-overlay-null
Android: Add null check for InputOverlay
  • Loading branch information
JosJuice committed Nov 11, 2020
2 parents ae83685 + 32ad2dc commit 9e3e325
Showing 1 changed file with 10 additions and 7 deletions.
@@ -94,14 +94,17 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
doneButton.setOnClickListener(v -> stopConfiguringControls());
}

contents.post(() ->
if (mInputOverlay != null)
{
int overlayX = mInputOverlay.getLeft();
int overlayY = mInputOverlay.getTop();
mInputOverlay.setSurfacePosition(new Rect(
surfaceView.getLeft() - overlayX, surfaceView.getTop() - overlayY,
surfaceView.getRight() - overlayX, surfaceView.getBottom() - overlayY));
});
contents.post(() ->
{
int overlayX = mInputOverlay.getLeft();
int overlayY = mInputOverlay.getTop();
mInputOverlay.setSurfacePosition(new Rect(
surfaceView.getLeft() - overlayX, surfaceView.getTop() - overlayY,
surfaceView.getRight() - overlayX, surfaceView.getBottom() - overlayY));
});
}

// The new Surface created here will get passed to the native code via onSurfaceChanged.

0 comments on commit 9e3e325

Please sign in to comment.