Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 731a7c82 authored by Santiago Etchebehere's avatar Santiago Etchebehere
Browse files

Always recreate the SurfaceView when updating the grid preview

This fixes a problem where the preview was rendereed in the wrong
position

Fixes: 221856837
Test: manual
Change-Id: Ib8605a04e4a4ae5e0d5a83b3afe94d0954169198
parent 652520b2
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -64,8 +64,10 @@ class GridOptionPreviewer {
        if (mSurfaceCallback != null) {
            mSurfaceCallback.cleanUp();
            mSurfaceCallback.resetLastSurface();
            if (mGridOptionSurface != null) {
                mGridOptionSurface.getHolder().removeCallback(mSurfaceCallback);
            }
        }
        if (mGridOptionSurface == null) {
        mGridOptionSurface = new SurfaceView(mPreviewContainer.getContext());
        mGridOptionSurface.setLayoutParams(new ViewGroup.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
@@ -73,7 +75,6 @@ class GridOptionPreviewer {
        mSurfaceCallback = new GridOptionSurfaceHolderCallback(mGridOptionSurface,
                mGridOptionSurface.getContext());
        mGridOptionSurface.getHolder().addCallback(mSurfaceCallback);
        }
        mPreviewContainer.addView(mGridOptionSurface);
    }