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

Verified Commit 8769af52 authored by Kshitij's avatar Kshitij Committed by Saalim Quadri
Browse files

feat: Fade out dock blur on scroll to minus one



- Reduces some ugly clipping

Signed-off-by: default avatarSaalim Quadri <danascape@gmail.com>
parent ac44ba45
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ class BlurViewDelegate(
    private val blurWallpaperProvider by lazy { BlurWallpaperProvider.getInstance(context) }

    private var fullBlurDrawable: BlurDrawable? = null
    private var blurAlpha = 255
    var blurAlpha = 255

    private val blurDrawableCallback by lazy {
        object : Drawable.Callback {
+9 −0
Original line number Diff line number Diff line
@@ -295,6 +295,15 @@ public class Hotseat extends CellLayout implements Insettable, OffsetParent {
        return false;
    }

    public void setBlurAlpha(int alpha) {
        if (alpha > 255) {
            alpha = 255;
        } else if (alpha < 0) {
            alpha = 0;
        }
        mBlurDelegate.setBlurAlpha(alpha);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        // See comment in #onInterceptTouchEvent
+2 −0
Original line number Diff line number Diff line
@@ -1450,6 +1450,7 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
            return;

        boolean isVerticalBar = mLauncher.getDeviceProfile().isVerticalBarLayout();
        getHotseat().setBlurAlpha((int) ((1 - (progress * 2)) * 255));
        if (isVerticalBar) {
            int dockWidth = getHotseat().getWidth();
            float dockTranslationX = (mLauncher.getDeviceProfile().isSeascape() ? -1 : 1) *
@@ -1459,6 +1460,7 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
            // Initialize with safe height to completely hide indicator
            int safeBottomInset = getPageIndicator().getHeight();
            WindowInsets rootInsets = mLauncher.getWindow().getDecorView().getRootWindowInsets();

            // rootInsets may be null in case launcher restarts and view hasn't yet been inflated
            if (rootInsets != null) {
                safeBottomInset = rootInsets.getInsetsIgnoringVisibility(WindowInsets.Type.systemBars()).bottom;