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

Verified Commit fe64fc02 authored by Yash Garg's avatar Yash Garg 💬
Browse files

fix: do not draw blur over hotseat if in preview

parent 27f1ddbb
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
@@ -29,7 +28,6 @@ import android.view.ViewDebug;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.android.launcher3.folder.Folder;
import com.android.launcher3.pageindicators.PageIndicatorDots;

import androidx.annotation.NonNull;

@@ -56,6 +54,7 @@ public class Hotseat extends CellLayout implements Insettable, OffsetParent {
    private boolean mSendTouchToWorkspace;

    private final View mQsb;
    public boolean drawBlur;

    public Hotseat(Context context) {
        this(context, null);
@@ -70,6 +69,7 @@ public class Hotseat extends CellLayout implements Insettable, OffsetParent {

        mQsb = LayoutInflater.from(context).inflate(R.layout.search_container_hotseat, this, false);
        mBlurDelegate = new BlurViewDelegate(this, BlurWallpaperProvider.Companion.getBlurConfigDock(), null);
        drawBlur = true;
        setWillNotDraw(false);
        addView(mQsb);
    }
@@ -145,6 +145,14 @@ public class Hotseat extends CellLayout implements Insettable, OffsetParent {
        return false;
    }

    @Override
    protected void onDraw(Canvas canvas) {
        if (mBlurDelegate != null && drawBlur) {
            mBlurDelegate.draw(canvas);
        }
        super.onDraw(canvas);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        // See comment in #onInterceptTouchEvent
@@ -216,14 +224,6 @@ public class Hotseat extends CellLayout implements Insettable, OffsetParent {
        return mQsb;
    }

    @Override
    protected void onDraw(Canvas canvas) {
        if (mBlurDelegate != null) {
            mBlurDelegate.draw(canvas);
        }
        super.onDraw(canvas);
    }

    public Workspace<?> getWorkspace() {
        return mWorkspace;
    }
+1 −0
Original line number Diff line number Diff line
@@ -252,6 +252,7 @@ public class LauncherPreviewRenderer extends ContextWrapper

        mHotseat = mRootView.findViewById(R.id.hotseat);
        mHotseat.resetLayout(false);
        mHotseat.drawBlur = false;

        mLauncherWidgetSpanInfo = launcherWidgetSpanInfo == null ? new SparseArray<>() :
                launcherWidgetSpanInfo;