From 1c842ad34e62d8311b9475aecb0c6a75f2a59638 Mon Sep 17 00:00:00 2001 From: Rohit Dhakad Date: Fri, 27 Dec 2024 18:39:08 +0530 Subject: [PATCH] frontend/fix: Removed blur-view third party dependency --- android/build.gradle | 2 - .../blurview/BlurView.java | 68 +++++++++++++++++++ .../blurview/BlurViewManagerImpl.java | 2 - .../blurview/BlurViewPackage.java | 2 +- .../blurview/BlurViewManager.java | 1 - 5 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 android/src/main/java/com/reactnativecommunity/blurview/BlurView.java diff --git a/android/build.gradle b/android/build.gradle index acb9a88e..c3537d80 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -138,6 +138,4 @@ dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules - - implementation 'com.github.Dimezis:BlurView:version-2.0.4' } diff --git a/android/src/main/java/com/reactnativecommunity/blurview/BlurView.java b/android/src/main/java/com/reactnativecommunity/blurview/BlurView.java new file mode 100644 index 00000000..4042f026 --- /dev/null +++ b/android/src/main/java/com/reactnativecommunity/blurview/BlurView.java @@ -0,0 +1,68 @@ +package com.reactnativecommunity.blurview; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.view.View; +import android.widget.FrameLayout; + +import androidx.annotation.Nullable; + +public class BlurView extends FrameLayout { + + // TODO : Implement this if needed in android + + private Drawable frameClearDrawable; + private float blurRadius = 0f; + private int overlayColor = 0; + private boolean blurAutoUpdate = false; + private boolean blurEnabled = true; + + public BlurView(Context context) { + super(context); + } + + public BlurView(Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + } + + public BlurView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + // Dummy function for setupWith + public BlurView setupWith(View view) { + // Do setup with the provided view + return this; + } + + // Dummy function for setFrameClearDrawable + public BlurView setFrameClearDrawable(Drawable drawable) { + this.frameClearDrawable = drawable; + return this; + } + + // Dummy function for setBlurRadius + public BlurView setBlurRadius(float radius) { + this.blurRadius = radius; + return this; + } + + // Dummy function for setOverlayColor + public BlurView setOverlayColor(int color) { + this.overlayColor = color; + return this; + } + + // Dummy function for setBlurAutoUpdate + public BlurView setBlurAutoUpdate(boolean autoUpdate) { + this.blurAutoUpdate = autoUpdate; + return this; + } + + // Dummy function for setBlurEnabled + public BlurView setBlurEnabled(boolean enabled) { + this.blurEnabled = enabled; + return this; + } +} diff --git a/android/src/main/java/com/reactnativecommunity/blurview/BlurViewManagerImpl.java b/android/src/main/java/com/reactnativecommunity/blurview/BlurViewManagerImpl.java index 44443134..ccd3959c 100644 --- a/android/src/main/java/com/reactnativecommunity/blurview/BlurViewManagerImpl.java +++ b/android/src/main/java/com/reactnativecommunity/blurview/BlurViewManagerImpl.java @@ -3,8 +3,6 @@ import android.view.View; import com.facebook.react.uimanager.ThemedReactContext; -import eightbitlab.com.blurview.BlurView; - import java.util.Objects; import javax.annotation.Nonnull; diff --git a/android/src/main/java/com/reactnativecommunity/blurview/BlurViewPackage.java b/android/src/main/java/com/reactnativecommunity/blurview/BlurViewPackage.java index 7f48b1f6..bd842207 100644 --- a/android/src/main/java/com/reactnativecommunity/blurview/BlurViewPackage.java +++ b/android/src/main/java/com/reactnativecommunity/blurview/BlurViewPackage.java @@ -30,6 +30,6 @@ public List> createJSModules() { public List createViewManagers( @Nonnull ReactApplicationContext reactContext ) { - return Collections.singletonList(new BlurViewManager(reactContext)); + return Collections.singletonList(new com.reactnativecommunity.blurview.BlurViewManager(reactContext)); } } diff --git a/android/src/oldarch/java/com/reactnativecommunity/blurview/BlurViewManager.java b/android/src/oldarch/java/com/reactnativecommunity/blurview/BlurViewManager.java index 1a282095..f7dfb035 100644 --- a/android/src/oldarch/java/com/reactnativecommunity/blurview/BlurViewManager.java +++ b/android/src/oldarch/java/com/reactnativecommunity/blurview/BlurViewManager.java @@ -7,7 +7,6 @@ import com.facebook.react.uimanager.ViewGroupManager; import com.facebook.react.uimanager.annotations.ReactProp; -import eightbitlab.com.blurview.BlurView; class BlurViewManager extends ViewGroupManager {