From 075961314fe06345925320621d62f395e86b97a4 Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Mon, 5 Jul 2021 14:48:28 -0400 Subject: [PATCH] Adding blur to manga details' backdrop --- .../kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt index 10fc11fadf..78355625b8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt @@ -4,6 +4,9 @@ import android.annotation.SuppressLint import android.content.res.ColorStateList import android.graphics.Color import android.view.LayoutInflater +import android.graphics.RenderEffect +import android.graphics.Shader +import android.os.Build import android.view.MotionEvent import android.view.View import androidx.constraintlayout.widget.ConstraintLayout @@ -28,7 +31,7 @@ import eu.kanade.tachiyomi.util.system.isLTR import eu.kanade.tachiyomi.util.view.resetStrokeColor import eu.kanade.tachiyomi.util.view.updateLayoutParams -@SuppressLint("ClickableViewAccessibility") +@SuppressLint("ClickableViewAccessibility", "NewApi") class MangaHeaderHolder( view: View, private val adapter: MangaDetailsAdapter, @@ -124,6 +127,15 @@ class MangaHeaderHolder( ) true } + if (Build.VERSION.PREVIEW_SDK_INT + Build.VERSION.SDK_INT >= 31) { + backdrop.setRenderEffect( + RenderEffect.createBlurEffect( + 10f, + 10f, + Shader.TileMode.MIRROR + ) + ) + } mangaCover.setOnClickListener { adapter.delegate.zoomImageFromThumb(coverCard) } trackButton.setOnClickListener { adapter.delegate.showTrackingSheet() } if (startExpanded) expandDesc()