From c27fad86edff2a71b62c71797f92ca254e6068f0 Mon Sep 17 00:00:00 2001 From: Yash Garg Date: Fri, 13 Jan 2023 09:50:47 +0530 Subject: [PATCH] fix: increase dock blur and cleanup blur_offset --- .../e/blisslauncher/core/blur/BlurViewDelegate.kt | 7 +++---- .../e/blisslauncher/core/blur/BlurWallpaperProvider.kt | 8 +------- .../blisslauncher/core/customviews/SquareFrameLayout.java | 2 -- app/src/main/res/layout/activity_main.xml | 4 +--- app/src/main/res/values/colors.xml | 1 - 5 files changed, 5 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurViewDelegate.kt b/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurViewDelegate.kt index 3a46792ba3..1f36761395 100644 --- a/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurViewDelegate.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurViewDelegate.kt @@ -65,7 +65,7 @@ class BlurViewDelegate( } var blurCornerRadius = 0f - var overlayOffset = 70f + val outlineProvider = object : ViewOutlineProvider() { override fun getOutline(view: View, outline: Outline) { @@ -92,7 +92,6 @@ class BlurViewDelegate( val a = context.obtainStyledAttributes(attrs, R.styleable.BlurLayout) blurCornerRadius = a.getDimension(R.styleable.BlurLayout_blurCornerRadius, 0f) overlayColor = a.getColor(R.styleable.BlurLayout_blurOverlayColor, 0) - overlayOffset = a.getInt(R.styleable.BlurLayout_blurOverlayOffset, 70).toFloat() a.recycle() } } @@ -125,8 +124,8 @@ class BlurViewDelegate( } if (overlayColor != 0) { canvas.drawRoundRect( - view.left.toFloat() - overlayOffset, - view.top.toFloat() - overlayOffset, + view.left.toFloat(), + view.top.toFloat(), view.right.toFloat(), view.bottom.toFloat(), view.x, diff --git a/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurWallpaperProvider.kt b/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurWallpaperProvider.kt index afa55ca301..23a27e432d 100644 --- a/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurWallpaperProvider.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurWallpaperProvider.kt @@ -212,12 +212,6 @@ class BlurWallpaperProvider(val context: Context) { fun onEnabledChanged() {} } - /*fun clear() { - listener = null - cancelPreTask(true) - sInstance = null - }*/ - data class BlurSizes( val background: Bitmap, val dock: Bitmap, @@ -241,7 +235,7 @@ class BlurWallpaperProvider(val context: Context) { val blurConfigBackground = BlurConfig({ it.background }, 2, 8) - val blurConfigDock = BlurConfig({ it.dock }, 1, 2) + val blurConfigDock = BlurConfig({ it.dock }, 2, 2) val blurConfigAppGroup = BlurConfig({ it.appGroup }, 6, 8) diff --git a/app/src/main/java/foundation/e/blisslauncher/core/customviews/SquareFrameLayout.java b/app/src/main/java/foundation/e/blisslauncher/core/customviews/SquareFrameLayout.java index 511549e018..d8f58d4af8 100755 --- a/app/src/main/java/foundation/e/blisslauncher/core/customviews/SquareFrameLayout.java +++ b/app/src/main/java/foundation/e/blisslauncher/core/customviews/SquareFrameLayout.java @@ -7,7 +7,6 @@ import android.widget.FrameLayout; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import foundation.e.blisslauncher.R; import foundation.e.blisslauncher.core.DeviceProfile; import foundation.e.blisslauncher.core.blur.BlurViewDelegate; import foundation.e.blisslauncher.core.blur.BlurWallpaperProvider; @@ -42,7 +41,6 @@ public class SquareFrameLayout extends FrameLayout { public void enableBlur() { mBlurDelegate = new BlurViewDelegate(this, BlurWallpaperProvider.Companion.getBlurConfigAppGroup(), null); - mBlurDelegate.setOverlayColor(getContext().getColor(R.color.blur_overlay)); setWillNotDraw(false); } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index ca45e2043b..69839982e7 100755 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -71,9 +71,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" - app:blurCornerRadius="12dp" - app:blurOverlayColor="@color/blur_overlay" - app:blurOverlayOffset="2000"> + app:blurCornerRadius="12dp"> #26ffffff @color/colorAccent - #38202020 -- GitLab