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

Commit eb669ae9 authored by Daniel Norman's avatar Daniel Norman Committed by Android (Google) Code Review
Browse files

Merge "Ensure the MagThumbnail view is always inflated on the main thread." into main

parents 8635cebf d0c879bc
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -56,9 +56,9 @@ public class MagnificationThumbnail {
    private final Handler mHandler;

    @VisibleForTesting
    public final FrameLayout mThumbnailLayout;
    public FrameLayout mThumbnailLayout;

    private final View mThumbnailView;
    private View mThumbnailView;
    private int mThumbnailWidth;
    private int mThumbnailHeight;

@@ -79,13 +79,18 @@ public class MagnificationThumbnail {
        mWindowManager = windowManager;
        mHandler = handler;
        mWindowBounds =  mWindowManager.getCurrentWindowMetrics().getBounds();
        mBackgroundParams = createLayoutParams();
        mThumbnailWidth = 0;
        mThumbnailHeight = 0;
        mHandler.post(this::createThumbnailLayout);
    }

    @MainThread
    private void createThumbnailLayout() {
        mThumbnailLayout = (FrameLayout) LayoutInflater.from(mContext)
                .inflate(R.layout.thumbnail_background_view, /* root: */ null);
        mThumbnailView =
                mThumbnailLayout.findViewById(R.id.accessibility_magnification_thumbnail_view);
        mBackgroundParams = createLayoutParams();
        mThumbnailWidth = 0;
        mThumbnailHeight = 0;
    }

    /**