From 0e8c27eeb8dfc5daaf619322be275d22c4cd96f0 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 29 Aug 2021 16:40:32 -0700 Subject: Fix blur and deps --- .../allanwang/kau/mediapicker/BlurredImageView.kt | 40 ++++++++-------------- 1 file changed, 15 insertions(+), 25 deletions(-) (limited to 'mediapicker') diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/BlurredImageView.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/BlurredImageView.kt index 8e78abf..77ac04c 100644 --- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/BlurredImageView.kt +++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/BlurredImageView.kt @@ -30,8 +30,7 @@ import ca.allanwang.kau.utils.setBackgroundColorRes import ca.allanwang.kau.utils.setIcon import ca.allanwang.kau.utils.visible import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial -import jp.wasabeef.blurry.internal.BlurFactor -import jp.wasabeef.blurry.internal.BlurTask +import jp.wasabeef.blurry.Blurry /** * Created by Allan Wang on 2017-07-14. @@ -53,7 +52,8 @@ class BlurredImageView @JvmOverloads constructor( val imageBase: ImageView get() = binding.imageBase - private val binding: KauBlurredImageviewBinding = KauBlurredImageviewBinding.inflate(LayoutInflater.from(context), this) + private val binding: KauBlurredImageviewBinding = + KauBlurredImageviewBinding.inflate(LayoutInflater.from(context), this) init { initAttrs(context, attrs) @@ -87,17 +87,12 @@ class BlurredImageView @JvmOverloads constructor( fun blur() { if (isBlurred) return isBlurred = true - val factor = BlurFactor() - factor.width = width - factor.height = height - BlurTask(imageBase, factor) { - with(binding) { - imageBlur.setImageDrawable(it) - scaleAnimate(ANIMATION_SCALE).start() - imageBlur.alphaAnimate(1f).start() - imageForeground.alphaAnimate(1f).start() - } - }.execute() + with(binding) { + Blurry.with(imageBase.context).capture(imageBase).into(imageBlur) + scaleAnimate(ANIMATION_SCALE).start() + imageBlur.alphaAnimate(1f).start() + imageForeground.alphaAnimate(1f).start() + } } /** @@ -108,17 +103,12 @@ class BlurredImageView @JvmOverloads constructor( fun blurInstantly() { isBlurred = true clearAnimation() - val factor = BlurFactor() - factor.width = width - factor.height = height - BlurTask(imageBase, factor) { drawable -> - with(binding) { - imageBlur.setImageDrawable(drawable) - scaleXY = ANIMATION_SCALE - imageBlur.alpha = 1f - imageForeground.alpha = 1f - } - }.execute() + with(binding) { + Blurry.with(imageBase.context).capture(imageBase).into(imageBlur) + scaleXY = ANIMATION_SCALE + imageBlur.alpha = 1f + imageForeground.alpha = 1f + } } /** -- cgit v1.2.3 From 2ae078cedca3516a60d88d7157ab1612def32972 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 29 Aug 2021 21:49:16 -0700 Subject: Remove iconics google from dep api --- core/build.gradle | 2 +- mediapicker/build.gradle | 2 ++ sample/build.gradle | 2 ++ searchview/build.gradle | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) (limited to 'mediapicker') diff --git a/core/build.gradle b/core/build.gradle index 0f9bd5e..57ad8fe 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -14,7 +14,7 @@ dependencies { api kau.Dependencies.coroutines api kau.Dependencies.iconics - api kau.Dependencies.iconicsGoogle + implementation kau.Dependencies.iconicsGoogle api kau.Dependencies.materialDialog } diff --git a/mediapicker/build.gradle b/mediapicker/build.gradle index 06a18d0..12fa56a 100644 --- a/mediapicker/build.gradle +++ b/mediapicker/build.gradle @@ -7,6 +7,8 @@ dependencies { implementation project(':core-ui') implementation project(':fastadapter') + implementation kau.Dependencies.iconicsGoogle + api kau.Dependencies.glide api kau.Dependencies.blurry } diff --git a/sample/build.gradle b/sample/build.gradle index ff25f50..c2682e7 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -132,6 +132,8 @@ dependencies { implementation project(':searchview') implementation project(':mediapicker') + implementation Dependencies.iconicsGoogle + implementation Dependencies.hilt kapt Dependencies.hiltCompiler diff --git a/searchview/build.gradle b/searchview/build.gradle index 64a88b3..13a3829 100644 --- a/searchview/build.gradle +++ b/searchview/build.gradle @@ -7,6 +7,8 @@ apply from: '../android-lib.gradle' dependencies { implementation project(':core-ui') implementation project(':fastadapter') + + implementation kau.Dependencies.iconicsGoogle } apply from: '../artifacts.gradle' -- cgit v1.2.3 From 0c0cc7776a6b21bb6c8c83f74619ea6660429f2c Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 30 Aug 2021 01:33:49 -0700 Subject: Revert iconics api removal --- .idea/runConfigurations.xml | 10 ---------- core/build.gradle | 2 +- mediapicker/build.gradle | 2 -- sample/build.gradle | 2 -- searchview/build.gradle | 2 -- 5 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 .idea/runConfigurations.xml (limited to 'mediapicker') diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 797acea..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/core/build.gradle b/core/build.gradle index 57ad8fe..0f9bd5e 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -14,7 +14,7 @@ dependencies { api kau.Dependencies.coroutines api kau.Dependencies.iconics - implementation kau.Dependencies.iconicsGoogle + api kau.Dependencies.iconicsGoogle api kau.Dependencies.materialDialog } diff --git a/mediapicker/build.gradle b/mediapicker/build.gradle index 12fa56a..06a18d0 100644 --- a/mediapicker/build.gradle +++ b/mediapicker/build.gradle @@ -7,8 +7,6 @@ dependencies { implementation project(':core-ui') implementation project(':fastadapter') - implementation kau.Dependencies.iconicsGoogle - api kau.Dependencies.glide api kau.Dependencies.blurry } diff --git a/sample/build.gradle b/sample/build.gradle index c2682e7..ff25f50 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -132,8 +132,6 @@ dependencies { implementation project(':searchview') implementation project(':mediapicker') - implementation Dependencies.iconicsGoogle - implementation Dependencies.hilt kapt Dependencies.hiltCompiler diff --git a/searchview/build.gradle b/searchview/build.gradle index 13a3829..64a88b3 100644 --- a/searchview/build.gradle +++ b/searchview/build.gradle @@ -7,8 +7,6 @@ apply from: '../android-lib.gradle' dependencies { implementation project(':core-ui') implementation project(':fastadapter') - - implementation kau.Dependencies.iconicsGoogle } apply from: '../artifacts.gradle' -- cgit v1.2.3