-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build(deps): update react-native * feat: codegen setup for BlurView component * feat: add basic Fabric component for BlurView (iOS) * feat(iOS): implement updateProps Fabric method * feat(iOS): migrate VibrancyView * feat(Android): add code for new and old architecture * chore: update dependencies and example app * fix(iOS): interface VibrancyViewComponentView * refactor: separate codegen specs by platform * refactor: rename Android component file to avoid a bug in Codegen * refactor: delete/rename files * refactor: conditionally include Fabric code in the original views * refactor: remove unnecessary code in build.gradle
- Loading branch information
Showing
25 changed files
with
3,084 additions
and
2,425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
android/src/newarch/java/com/reactnativecommunity/blurview/BlurViewManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package com.reactnativecommunity.blurview; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
|
||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.module.annotations.ReactModule; | ||
import com.facebook.react.uimanager.ThemedReactContext; | ||
import com.facebook.react.uimanager.ViewGroupManager; | ||
import com.facebook.react.uimanager.ViewManagerDelegate; | ||
import com.facebook.react.uimanager.annotations.ReactProp; | ||
import com.facebook.react.viewmanagers.AndroidBlurViewManagerDelegate; | ||
import com.facebook.react.viewmanagers.AndroidBlurViewManagerInterface; | ||
|
||
import eightbitlab.com.blurview.BlurView; | ||
|
||
@ReactModule(name = BlurViewManagerImpl.REACT_CLASS) | ||
class BlurViewManager extends ViewGroupManager<BlurView> | ||
implements AndroidBlurViewManagerInterface<BlurView> { | ||
|
||
private final ViewManagerDelegate<BlurView> mDelegate; | ||
|
||
public BlurViewManager(ReactApplicationContext context) { | ||
mDelegate = new AndroidBlurViewManagerDelegate<>(this); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
protected ViewManagerDelegate<BlurView> getDelegate() { | ||
return mDelegate; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String getName() { | ||
return BlurViewManagerImpl.REACT_CLASS; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
protected BlurView createViewInstance(@NonNull ThemedReactContext context) { | ||
return BlurViewManagerImpl.createViewInstance(context); | ||
} | ||
|
||
@Override | ||
@ReactProp(name = "blurRadius", defaultInt = BlurViewManagerImpl.defaultRadius) | ||
public void setBlurRadius(BlurView view, int radius) { | ||
BlurViewManagerImpl.setRadius(view, radius); | ||
} | ||
|
||
@Override | ||
@ReactProp(name = "overlayColor", customType = "Color") | ||
public void setOverlayColor(BlurView view, Integer color) { | ||
BlurViewManagerImpl.setColor(view, color); | ||
} | ||
|
||
@Override | ||
@ReactProp(name = "downsampleFactor", defaultInt = BlurViewManagerImpl.defaultSampling) | ||
public void setDownsampleFactor(BlurView view, int factor) {} | ||
|
||
@Override | ||
@ReactProp(name = "autoUpdate", defaultBoolean = true) | ||
public void setAutoUpdate(BlurView view, boolean autoUpdate) { | ||
BlurViewManagerImpl.setAutoUpdate(view, autoUpdate); | ||
} | ||
|
||
@Override | ||
@ReactProp(name = "enabled", defaultBoolean = true) | ||
public void setEnabled(BlurView view, boolean enabled) { | ||
BlurViewManagerImpl.setBlurEnabled(view, enabled); | ||
} | ||
|
||
@Override | ||
public void setBlurAmount(BlurView view, int value) {} | ||
|
||
@Override | ||
public void setBlurType(BlurView view, @Nullable String value) {} | ||
} |
53 changes: 53 additions & 0 deletions
53
android/src/oldarch/java/com/reactnativecommunity/blurview/BlurViewManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.reactnativecommunity.blurview; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.uimanager.ThemedReactContext; | ||
import com.facebook.react.uimanager.ViewGroupManager; | ||
import com.facebook.react.uimanager.annotations.ReactProp; | ||
|
||
import eightbitlab.com.blurview.BlurView; | ||
|
||
class BlurViewManager extends ViewGroupManager<BlurView> { | ||
|
||
ReactApplicationContext mCallerContext; | ||
|
||
public BlurViewManager(ReactApplicationContext reactContext) { | ||
mCallerContext = reactContext; | ||
} | ||
|
||
@Override | ||
public BlurView createViewInstance(ThemedReactContext context) { | ||
return BlurViewManagerImpl.createViewInstance(context); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String getName() { | ||
return BlurViewManagerImpl.REACT_CLASS; | ||
} | ||
|
||
@ReactProp(name = "blurRadius", defaultInt = BlurViewManagerImpl.defaultRadius) | ||
public void setRadius(BlurView view, int radius) { | ||
BlurViewManagerImpl.setRadius(view, radius); | ||
} | ||
|
||
@ReactProp(name = "overlayColor", customType = "Color") | ||
public void setColor(BlurView view, int color) { | ||
BlurViewManagerImpl.setColor(view, color); | ||
} | ||
|
||
@ReactProp(name = "downsampleFactor", defaultInt = BlurViewManagerImpl.defaultSampling) | ||
public void setDownsampleFactor(BlurView view, int factor) {} | ||
|
||
@ReactProp(name = "autoUpdate", defaultBoolean = true) | ||
public void setAutoUpdate(BlurView view, boolean autoUpdate) { | ||
BlurViewManagerImpl.setAutoUpdate(view, autoUpdate); | ||
} | ||
|
||
@ReactProp(name = "enabled", defaultBoolean = true) | ||
public void setBlurEnabled(BlurView view, boolean enabled) { | ||
BlurViewManagerImpl.setBlurEnabled(view, enabled); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ use_flipper! | |
|
||
workspace 'BlurExample.xcworkspace' | ||
|
||
use_test_app! | ||
use_test_app! :hermes_enabled => true |
Oops, something went wrong.