@sbaiahmed1/react-native-blur 3.1.2 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +319 -308
- package/ReactNativeBlur.podspec +1 -1
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeBlurViewManagerDelegate.java +18 -3
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeBlurViewManagerInterface.java +6 -1
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassEffectContainerManagerDelegate.java +53 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassEffectContainerManagerInterface.java +25 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassViewManagerDelegate.java +38 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassViewManagerInterface.java +20 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ComponentDescriptors.cpp +1 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ComponentDescriptors.h +1 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/EventEmitters.cpp +1 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/EventEmitters.h +7 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/Props.cpp +21 -2
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/Props.h +70 -2
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ShadowNodes.cpp +1 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ShadowNodes.h +11 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/States.h +12 -0
- package/android/build.gradle +2 -3
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurView.kt +62 -269
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurViewManager.kt +13 -8
- package/ios/Helpers/BlurStyleHelpers.swift +1 -1
- package/ios/Helpers/ReactNativeBlurViewHelper.swift +8 -32
- package/ios/Helpers/ReactNativeLiquidGlassViewHelper.swift +44 -0
- package/ios/ReactNativeBlurView.mm +28 -74
- package/ios/{ReactNativeBlurViewManager.m → ReactNativeBlurViewManager.mm} +15 -39
- package/ios/ReactNativeLiquidGlassView.h +14 -0
- package/ios/ReactNativeLiquidGlassView.mm +284 -0
- package/ios/ReactNativeLiquidGlassViewManager.h +6 -0
- package/ios/ReactNativeLiquidGlassViewManager.mm +20 -0
- package/ios/Views/AdvancedBlurView.swift +6 -34
- package/ios/Views/BasicColoredView.swift +37 -44
- package/ios/Views/LiquidGlassContainerView.swift +173 -0
- package/lib/module/BlurView.js +17 -31
- package/lib/module/BlurView.js.map +1 -1
- package/lib/module/LiquidGlassView.js +75 -0
- package/lib/module/LiquidGlassView.js.map +1 -0
- package/lib/module/ReactNativeBlurViewNativeComponent.ts +1 -7
- package/lib/module/ReactNativeLiquidGlassViewNativeComponent.ts +57 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/BlurView.d.ts +19 -39
- package/lib/typescript/src/BlurView.d.ts.map +1 -1
- package/lib/typescript/src/LiquidGlassView.d.ts +85 -0
- package/lib/typescript/src/LiquidGlassView.d.ts.map +1 -0
- package/lib/typescript/src/ReactNativeBlurViewNativeComponent.d.ts +1 -6
- package/lib/typescript/src/ReactNativeBlurViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/ReactNativeLiquidGlassViewNativeComponent.d.ts +44 -0
- package/lib/typescript/src/ReactNativeLiquidGlassViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +6 -3
- package/src/BlurView.tsx +37 -68
- package/src/LiquidGlassView.tsx +138 -0
- package/src/ReactNativeBlurViewNativeComponent.ts +1 -7
- package/src/ReactNativeLiquidGlassViewNativeComponent.ts +57 -0
- package/src/index.tsx +6 -0
package/ReactNativeBlur.podspec
CHANGED
|
@@ -22,14 +22,29 @@ public class ReactNativeBlurViewManagerDelegate<T extends View, U extends BaseVi
|
|
|
22
22
|
@Override
|
|
23
23
|
public void setProperty(T view, String propName, @Nullable Object value) {
|
|
24
24
|
switch (propName) {
|
|
25
|
-
case "
|
|
26
|
-
mViewManager.
|
|
25
|
+
case "glassTintColor":
|
|
26
|
+
mViewManager.setGlassTintColor(view, value == null ? "clear" : (String) value);
|
|
27
|
+
break;
|
|
28
|
+
case "glassOpacity":
|
|
29
|
+
mViewManager.setGlassOpacity(view, value == null ? 1f : ((Double) value).doubleValue());
|
|
27
30
|
break;
|
|
28
31
|
case "blurAmount":
|
|
29
32
|
mViewManager.setBlurAmount(view, value == null ? 10f : ((Double) value).doubleValue());
|
|
30
33
|
break;
|
|
34
|
+
case "type":
|
|
35
|
+
mViewManager.setType(view, (String) value);
|
|
36
|
+
break;
|
|
37
|
+
case "blurType":
|
|
38
|
+
mViewManager.setBlurType(view, (String) value);
|
|
39
|
+
break;
|
|
40
|
+
case "glassType":
|
|
41
|
+
mViewManager.setGlassType(view, (String) value);
|
|
42
|
+
break;
|
|
31
43
|
case "reducedTransparencyFallbackColor":
|
|
32
|
-
mViewManager.setReducedTransparencyFallbackColor(view, value == null ?
|
|
44
|
+
mViewManager.setReducedTransparencyFallbackColor(view, value == null ? "#FFFFFF" : (String) value);
|
|
45
|
+
break;
|
|
46
|
+
case "isInteractive":
|
|
47
|
+
mViewManager.setIsInteractive(view, value == null ? true : (boolean) value);
|
|
33
48
|
break;
|
|
34
49
|
default:
|
|
35
50
|
super.setProperty(view, propName, value);
|
|
@@ -14,7 +14,12 @@ import androidx.annotation.Nullable;
|
|
|
14
14
|
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
|
|
15
15
|
|
|
16
16
|
public interface ReactNativeBlurViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
|
|
17
|
-
void
|
|
17
|
+
void setGlassTintColor(T view, @Nullable String value);
|
|
18
|
+
void setGlassOpacity(T view, double value);
|
|
18
19
|
void setBlurAmount(T view, double value);
|
|
20
|
+
void setType(T view, @Nullable String value);
|
|
21
|
+
void setBlurType(T view, @Nullable String value);
|
|
22
|
+
void setGlassType(T view, @Nullable String value);
|
|
19
23
|
void setReducedTransparencyFallbackColor(T view, @Nullable String value);
|
|
24
|
+
void setIsInteractive(T view, boolean value);
|
|
20
25
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
package com.facebook.react.viewmanagers;
|
|
11
|
+
|
|
12
|
+
import android.view.View;
|
|
13
|
+
import androidx.annotation.Nullable;
|
|
14
|
+
import com.facebook.react.uimanager.BaseViewManager;
|
|
15
|
+
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
16
|
+
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
17
|
+
|
|
18
|
+
public class ReactNativeGlassEffectContainerManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ReactNativeGlassEffectContainerManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
19
|
+
public ReactNativeGlassEffectContainerManagerDelegate(U viewManager) {
|
|
20
|
+
super(viewManager);
|
|
21
|
+
}
|
|
22
|
+
@Override
|
|
23
|
+
public void setProperty(T view, String propName, @Nullable Object value) {
|
|
24
|
+
switch (propName) {
|
|
25
|
+
case "glassType":
|
|
26
|
+
mViewManager.setGlassType(view, (String) value);
|
|
27
|
+
break;
|
|
28
|
+
case "glassTintColor":
|
|
29
|
+
mViewManager.setGlassTintColor(view, value == null ? "clear" : (String) value);
|
|
30
|
+
break;
|
|
31
|
+
case "glassOpacity":
|
|
32
|
+
mViewManager.setGlassOpacity(view, value == null ? 1f : ((Double) value).doubleValue());
|
|
33
|
+
break;
|
|
34
|
+
case "isInteractive":
|
|
35
|
+
mViewManager.setIsInteractive(view, value == null ? true : (boolean) value);
|
|
36
|
+
break;
|
|
37
|
+
case "spacing":
|
|
38
|
+
mViewManager.setSpacing(view, value == null ? 8f : ((Double) value).doubleValue());
|
|
39
|
+
break;
|
|
40
|
+
case "enableMorphing":
|
|
41
|
+
mViewManager.setEnableMorphing(view, value == null ? true : (boolean) value);
|
|
42
|
+
break;
|
|
43
|
+
case "morphingDuration":
|
|
44
|
+
mViewManager.setMorphingDuration(view, value == null ? 300 : ((Double) value).intValue());
|
|
45
|
+
break;
|
|
46
|
+
case "reducedTransparencyFallbackColor":
|
|
47
|
+
mViewManager.setReducedTransparencyFallbackColor(view, value == null ? "#FFFFFF" : (String) value);
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
super.setProperty(view, propName, value);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GeneratePropsJavaInterface.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
package com.facebook.react.viewmanagers;
|
|
11
|
+
|
|
12
|
+
import android.view.View;
|
|
13
|
+
import androidx.annotation.Nullable;
|
|
14
|
+
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
|
|
15
|
+
|
|
16
|
+
public interface ReactNativeGlassEffectContainerManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
|
|
17
|
+
void setGlassType(T view, @Nullable String value);
|
|
18
|
+
void setGlassTintColor(T view, @Nullable String value);
|
|
19
|
+
void setGlassOpacity(T view, double value);
|
|
20
|
+
void setIsInteractive(T view, boolean value);
|
|
21
|
+
void setSpacing(T view, double value);
|
|
22
|
+
void setEnableMorphing(T view, boolean value);
|
|
23
|
+
void setMorphingDuration(T view, int value);
|
|
24
|
+
void setReducedTransparencyFallbackColor(T view, @Nullable String value);
|
|
25
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
package com.facebook.react.viewmanagers;
|
|
11
|
+
|
|
12
|
+
import android.view.View;
|
|
13
|
+
import androidx.annotation.Nullable;
|
|
14
|
+
import com.facebook.react.uimanager.BaseViewManager;
|
|
15
|
+
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
16
|
+
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
17
|
+
|
|
18
|
+
public class ReactNativeGlassViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ReactNativeGlassViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
19
|
+
public ReactNativeGlassViewManagerDelegate(U viewManager) {
|
|
20
|
+
super(viewManager);
|
|
21
|
+
}
|
|
22
|
+
@Override
|
|
23
|
+
public void setProperty(T view, String propName, @Nullable Object value) {
|
|
24
|
+
switch (propName) {
|
|
25
|
+
case "glassType":
|
|
26
|
+
mViewManager.setGlassType(view, (String) value);
|
|
27
|
+
break;
|
|
28
|
+
case "glassAmount":
|
|
29
|
+
mViewManager.setGlassAmount(view, value == null ? 50f : ((Double) value).doubleValue());
|
|
30
|
+
break;
|
|
31
|
+
case "reducedTransparencyFallbackColor":
|
|
32
|
+
mViewManager.setReducedTransparencyFallbackColor(view, value == null ? null : (String) value);
|
|
33
|
+
break;
|
|
34
|
+
default:
|
|
35
|
+
super.setProperty(view, propName, value);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GeneratePropsJavaInterface.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
package com.facebook.react.viewmanagers;
|
|
11
|
+
|
|
12
|
+
import android.view.View;
|
|
13
|
+
import androidx.annotation.Nullable;
|
|
14
|
+
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
|
|
15
|
+
|
|
16
|
+
public interface ReactNativeGlassViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
|
|
17
|
+
void setGlassType(T view, @Nullable String value);
|
|
18
|
+
void setGlassAmount(T view, double value);
|
|
19
|
+
void setReducedTransparencyFallbackColor(T view, @Nullable String value);
|
|
20
|
+
}
|
|
@@ -17,6 +17,7 @@ namespace facebook::react {
|
|
|
17
17
|
void ReactNativeBlurViewSpec_registerComponentDescriptorsFromCodegen(
|
|
18
18
|
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
|
19
19
|
registry->add(concreteComponentDescriptorProvider<ReactNativeBlurViewComponentDescriptor>());
|
|
20
|
+
registry->add(concreteComponentDescriptorProvider<ReactNativeGlassEffectContainerComponentDescriptor>());
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
} // namespace facebook::react
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
namespace facebook::react {
|
|
18
18
|
|
|
19
19
|
using ReactNativeBlurViewComponentDescriptor = ConcreteComponentDescriptor<ReactNativeBlurViewShadowNode>;
|
|
20
|
+
using ReactNativeGlassEffectContainerComponentDescriptor = ConcreteComponentDescriptor<ReactNativeGlassEffectContainerShadowNode>;
|
|
20
21
|
|
|
21
22
|
void ReactNativeBlurViewSpec_registerComponentDescriptorsFromCodegen(
|
|
22
23
|
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
|
@@ -19,5 +19,12 @@ class ReactNativeBlurViewEventEmitter : public ViewEventEmitter {
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
};
|
|
23
|
+
class ReactNativeGlassEffectContainerEventEmitter : public ViewEventEmitter {
|
|
24
|
+
public:
|
|
25
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
22
29
|
};
|
|
23
30
|
} // namespace facebook::react
|
|
@@ -19,9 +19,28 @@ ReactNativeBlurViewProps::ReactNativeBlurViewProps(
|
|
|
19
19
|
const ReactNativeBlurViewProps &sourceProps,
|
|
20
20
|
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
glassTintColor(convertRawProp(context, rawProps, "glassTintColor", sourceProps.glassTintColor, {"clear"})),
|
|
23
|
+
glassOpacity(convertRawProp(context, rawProps, "glassOpacity", sourceProps.glassOpacity, {1.0})),
|
|
23
24
|
blurAmount(convertRawProp(context, rawProps, "blurAmount", sourceProps.blurAmount, {10.0})),
|
|
24
|
-
|
|
25
|
+
type(convertRawProp(context, rawProps, "type", sourceProps.type, {ReactNativeBlurViewType::Blur})),
|
|
26
|
+
blurType(convertRawProp(context, rawProps, "blurType", sourceProps.blurType, {ReactNativeBlurViewBlurType::Xlight})),
|
|
27
|
+
glassType(convertRawProp(context, rawProps, "glassType", sourceProps.glassType, {ReactNativeBlurViewGlassType::Clear})),
|
|
28
|
+
reducedTransparencyFallbackColor(convertRawProp(context, rawProps, "reducedTransparencyFallbackColor", sourceProps.reducedTransparencyFallbackColor, {"#FFFFFF"})),
|
|
29
|
+
isInteractive(convertRawProp(context, rawProps, "isInteractive", sourceProps.isInteractive, {true}))
|
|
30
|
+
{}
|
|
31
|
+
ReactNativeGlassEffectContainerProps::ReactNativeGlassEffectContainerProps(
|
|
32
|
+
const PropsParserContext &context,
|
|
33
|
+
const ReactNativeGlassEffectContainerProps &sourceProps,
|
|
34
|
+
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
35
|
+
|
|
36
|
+
glassType(convertRawProp(context, rawProps, "glassType", sourceProps.glassType, {ReactNativeGlassEffectContainerGlassType::Clear})),
|
|
37
|
+
glassTintColor(convertRawProp(context, rawProps, "glassTintColor", sourceProps.glassTintColor, {"clear"})),
|
|
38
|
+
glassOpacity(convertRawProp(context, rawProps, "glassOpacity", sourceProps.glassOpacity, {1.0})),
|
|
39
|
+
isInteractive(convertRawProp(context, rawProps, "isInteractive", sourceProps.isInteractive, {true})),
|
|
40
|
+
spacing(convertRawProp(context, rawProps, "spacing", sourceProps.spacing, {8.0})),
|
|
41
|
+
enableMorphing(convertRawProp(context, rawProps, "enableMorphing", sourceProps.enableMorphing, {true})),
|
|
42
|
+
morphingDuration(convertRawProp(context, rawProps, "morphingDuration", sourceProps.morphingDuration, {300})),
|
|
43
|
+
reducedTransparencyFallbackColor(convertRawProp(context, rawProps, "reducedTransparencyFallbackColor", sourceProps.reducedTransparencyFallbackColor, {"#FFFFFF"}))
|
|
25
44
|
{}
|
|
26
45
|
|
|
27
46
|
} // namespace facebook::react
|
|
@@ -14,6 +14,21 @@
|
|
|
14
14
|
|
|
15
15
|
namespace facebook::react {
|
|
16
16
|
|
|
17
|
+
enum class ReactNativeBlurViewType { Blur, LiquidGlass };
|
|
18
|
+
|
|
19
|
+
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ReactNativeBlurViewType &result) {
|
|
20
|
+
auto string = (std::string)value;
|
|
21
|
+
if (string == "blur") { result = ReactNativeBlurViewType::Blur; return; }
|
|
22
|
+
if (string == "liquidGlass") { result = ReactNativeBlurViewType::LiquidGlass; return; }
|
|
23
|
+
abort();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static inline std::string toString(const ReactNativeBlurViewType &value) {
|
|
27
|
+
switch (value) {
|
|
28
|
+
case ReactNativeBlurViewType::Blur: return "blur";
|
|
29
|
+
case ReactNativeBlurViewType::LiquidGlass: return "liquidGlass";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
17
32
|
enum class ReactNativeBlurViewBlurType { Xlight, Light, Dark, ExtraDark, Regular, Prominent, SystemUltraThinMaterial, SystemThinMaterial, SystemMaterial, SystemThickMaterial, SystemChromeMaterial };
|
|
18
33
|
|
|
19
34
|
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ReactNativeBlurViewBlurType &result) {
|
|
@@ -47,6 +62,21 @@ static inline std::string toString(const ReactNativeBlurViewBlurType &value) {
|
|
|
47
62
|
case ReactNativeBlurViewBlurType::SystemChromeMaterial: return "systemChromeMaterial";
|
|
48
63
|
}
|
|
49
64
|
}
|
|
65
|
+
enum class ReactNativeBlurViewGlassType { Clear, Regular };
|
|
66
|
+
|
|
67
|
+
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ReactNativeBlurViewGlassType &result) {
|
|
68
|
+
auto string = (std::string)value;
|
|
69
|
+
if (string == "clear") { result = ReactNativeBlurViewGlassType::Clear; return; }
|
|
70
|
+
if (string == "regular") { result = ReactNativeBlurViewGlassType::Regular; return; }
|
|
71
|
+
abort();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
static inline std::string toString(const ReactNativeBlurViewGlassType &value) {
|
|
75
|
+
switch (value) {
|
|
76
|
+
case ReactNativeBlurViewGlassType::Clear: return "clear";
|
|
77
|
+
case ReactNativeBlurViewGlassType::Regular: return "regular";
|
|
78
|
+
}
|
|
79
|
+
}
|
|
50
80
|
|
|
51
81
|
class ReactNativeBlurViewProps final : public ViewProps {
|
|
52
82
|
public:
|
|
@@ -55,9 +85,47 @@ class ReactNativeBlurViewProps final : public ViewProps {
|
|
|
55
85
|
|
|
56
86
|
#pragma mark - Props
|
|
57
87
|
|
|
58
|
-
|
|
88
|
+
std::string glassTintColor{"clear"};
|
|
89
|
+
double glassOpacity{1.0};
|
|
59
90
|
double blurAmount{10.0};
|
|
60
|
-
|
|
91
|
+
ReactNativeBlurViewType type{ReactNativeBlurViewType::Blur};
|
|
92
|
+
ReactNativeBlurViewBlurType blurType{ReactNativeBlurViewBlurType::Xlight};
|
|
93
|
+
ReactNativeBlurViewGlassType glassType{ReactNativeBlurViewGlassType::Clear};
|
|
94
|
+
std::string reducedTransparencyFallbackColor{"#FFFFFF"};
|
|
95
|
+
bool isInteractive{true};
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
enum class ReactNativeGlassEffectContainerGlassType { Clear, Regular };
|
|
99
|
+
|
|
100
|
+
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ReactNativeGlassEffectContainerGlassType &result) {
|
|
101
|
+
auto string = (std::string)value;
|
|
102
|
+
if (string == "clear") { result = ReactNativeGlassEffectContainerGlassType::Clear; return; }
|
|
103
|
+
if (string == "regular") { result = ReactNativeGlassEffectContainerGlassType::Regular; return; }
|
|
104
|
+
abort();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
static inline std::string toString(const ReactNativeGlassEffectContainerGlassType &value) {
|
|
108
|
+
switch (value) {
|
|
109
|
+
case ReactNativeGlassEffectContainerGlassType::Clear: return "clear";
|
|
110
|
+
case ReactNativeGlassEffectContainerGlassType::Regular: return "regular";
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
class ReactNativeGlassEffectContainerProps final : public ViewProps {
|
|
115
|
+
public:
|
|
116
|
+
ReactNativeGlassEffectContainerProps() = default;
|
|
117
|
+
ReactNativeGlassEffectContainerProps(const PropsParserContext& context, const ReactNativeGlassEffectContainerProps &sourceProps, const RawProps &rawProps);
|
|
118
|
+
|
|
119
|
+
#pragma mark - Props
|
|
120
|
+
|
|
121
|
+
ReactNativeGlassEffectContainerGlassType glassType{ReactNativeGlassEffectContainerGlassType::Clear};
|
|
122
|
+
std::string glassTintColor{"clear"};
|
|
123
|
+
double glassOpacity{1.0};
|
|
124
|
+
bool isInteractive{true};
|
|
125
|
+
double spacing{8.0};
|
|
126
|
+
bool enableMorphing{true};
|
|
127
|
+
int morphingDuration{300};
|
|
128
|
+
std::string reducedTransparencyFallbackColor{"#FFFFFF"};
|
|
61
129
|
};
|
|
62
130
|
|
|
63
131
|
} // namespace facebook::react
|
|
@@ -29,4 +29,15 @@ using ReactNativeBlurViewShadowNode = ConcreteViewShadowNode<
|
|
|
29
29
|
ReactNativeBlurViewEventEmitter,
|
|
30
30
|
ReactNativeBlurViewState>;
|
|
31
31
|
|
|
32
|
+
JSI_EXPORT extern const char ReactNativeGlassEffectContainerComponentName[];
|
|
33
|
+
|
|
34
|
+
/*
|
|
35
|
+
* `ShadowNode` for <ReactNativeGlassEffectContainer> component.
|
|
36
|
+
*/
|
|
37
|
+
using ReactNativeGlassEffectContainerShadowNode = ConcreteViewShadowNode<
|
|
38
|
+
ReactNativeGlassEffectContainerComponentName,
|
|
39
|
+
ReactNativeGlassEffectContainerProps,
|
|
40
|
+
ReactNativeGlassEffectContainerEventEmitter,
|
|
41
|
+
ReactNativeGlassEffectContainerState>;
|
|
42
|
+
|
|
32
43
|
} // namespace facebook::react
|
|
@@ -26,4 +26,16 @@ public:
|
|
|
26
26
|
#endif
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
+
class ReactNativeGlassEffectContainerState {
|
|
30
|
+
public:
|
|
31
|
+
ReactNativeGlassEffectContainerState() = default;
|
|
32
|
+
|
|
33
|
+
#ifdef ANDROID
|
|
34
|
+
ReactNativeGlassEffectContainerState(ReactNativeGlassEffectContainerState const &previousState, folly::dynamic data){};
|
|
35
|
+
folly::dynamic getDynamic() const {
|
|
36
|
+
return {};
|
|
37
|
+
};
|
|
38
|
+
#endif
|
|
39
|
+
};
|
|
40
|
+
|
|
29
41
|
} // namespace facebook::react
|
package/android/build.gradle
CHANGED
|
@@ -9,13 +9,12 @@ buildscript {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
dependencies {
|
|
12
|
-
classpath "com.android.tools.build:gradle:8.
|
|
12
|
+
classpath "com.android.tools.build:gradle:8.9.1"
|
|
13
13
|
// noinspection DifferentKotlinGradleVersion
|
|
14
14
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
apply plugin: "com.android.library"
|
|
20
19
|
apply plugin: "kotlin-android"
|
|
21
20
|
|
|
@@ -75,7 +74,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
|
75
74
|
dependencies {
|
|
76
75
|
implementation "com.facebook.react:react-android"
|
|
77
76
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
78
|
-
implementation 'com.
|
|
77
|
+
implementation 'com.qmdeve:QmBlurView:1.0.4.3'
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
react {
|