Make it possible to use and create a custom BlurController
#230
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
Hi!
In
expo-blur
we would like to create our own version ofPreDrawBlurController
unfortunately a lot of stuff has been made package private. Making it impossible to do without creating a fork of the library.How
I've split the PR into three commits:
Allow setting up with a custom blur controller - Adds one more constructor to the BlurView, which accepts the desired blur controller. I also changed the other constructors to use it, and made the blurController protected so that views, which extend the
BlurView
can access it.Expose methods necessary for custom BlurControllers - The idea was to make it possible to copy contents of
PreDrawBlurController
into another package and still have it working. This mostly requires changes in theSizeScaler
class where a lot of the methods were package private, and making thesetContext
method of theRenderEffectBlur
public.Make it possible to extend
PreDrawBlurController
- I'm not sure if you will be ok with these changes, we can manage without them, but it would be quite a bit easier for us if we could extendPreDrawBlurController
. Makes the class non-final and changes the access of some variables and methods toprotected
so inheriting classes have access to them.The first two commits would be necessary for us to do what we want, the third one is nice to have.
Can you let me know if you would be ok with those changes?
Test Plan
Tested in the included test app and our react-native library.