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

Commit 83b34533 authored by Thales Lima's avatar Thales Lima
Browse files

Stop using bottom inset in preview

We are not using the bottom inset (navbar) in Launcher anymore, so we should not use it in preview as well.

Fixes 205284107
Test: manual

Change-Id: Iefd71b3cbe8e738c4559716af8c85015ba7c3c41
parent bf96683e
Loading
Loading
Loading
Loading
+8 −14
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
 *   3) Place appropriate elements like icons and first-page qsb
 *   4) Measure and draw the view on a canvas
 */
@TargetApi(Build.VERSION_CODES.O)
@TargetApi(Build.VERSION_CODES.R)
public class LauncherPreviewRenderer extends ContextWrapper
        implements ActivityContext, WorkspaceLayoutManager, LayoutInflater.Factory2 {

@@ -186,19 +186,13 @@ public class LauncherPreviewRenderer extends ContextWrapper
        mIdp = idp;
        mDp = idp.getDeviceProfile(context).copy(context);

        if (Utilities.ATLEAST_R) {
        WindowInsets currentWindowInsets = context.getSystemService(WindowManager.class)
                .getCurrentWindowMetrics().getWindowInsets();
        mInsets = new Rect(
                currentWindowInsets.getSystemWindowInsetLeft(),
                currentWindowInsets.getSystemWindowInsetTop(),
                currentWindowInsets.getSystemWindowInsetRight(),
                    currentWindowInsets.getSystemWindowInsetBottom());
        } else {
            mInsets = new Rect();
            mInsets.left = mInsets.right = (mDp.widthPx - mDp.availableWidthPx) / 2;
            mInsets.top = mInsets.bottom = (mDp.heightPx - mDp.availableHeightPx) / 2;
        }
                mDp.isTaskbarPresent ? 0 : currentWindowInsets.getSystemWindowInsetBottom());
        mDp.updateInsets(mInsets);

        BaseIconFactory iconFactory =