Skip to content

Commit

Permalink
Make some things public to support react-native (#201)
Browse files Browse the repository at this point in the history
Expose library classes to allow reusing them in other View types

---------

Co-authored-by: stemy <[email protected]>
  • Loading branch information
stemyke and stemy authored Jul 29, 2023
1 parent 1050f74 commit 425b875
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.graphics.Canvas;

interface BlurController extends BlurViewFacade {
public interface BlurController extends BlurViewFacade {

float DEFAULT_SCALE_FACTOR = 6f;
float DEFAULT_BLUR_RADIUS = 16f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import androidx.annotation.Nullable;

//Used in edit mode and in case if no BlurController was set
class NoOpController implements BlurController {
// Used in edit mode and in case if no BlurController was set
public class NoOpController implements BlurController {
@Override
public boolean draw(Canvas canvas) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;

Expand All @@ -22,10 +23,10 @@
* blur should be updated.
* <p>
*/
final class PreDrawBlurController implements BlurController {
public final class PreDrawBlurController implements BlurController {

@ColorInt
static final int TRANSPARENT = 0;
public static final int TRANSPARENT = 0;

private float blurRadius = DEFAULT_BLUR_RADIUS;

Expand All @@ -34,7 +35,7 @@ final class PreDrawBlurController implements BlurController {
private Bitmap internalBitmap;

@SuppressWarnings("WeakerAccess")
final BlurView blurView;
final View blurView;
private int overlayColor;
private final ViewGroup rootView;
private final int[] rootLocation = new int[2];
Expand Down Expand Up @@ -64,7 +65,7 @@ public boolean onPreDraw() {
* Can be Activity's root content layout (android.R.id.content)
* @param algorithm sets the blur algorithm
*/
PreDrawBlurController(@NonNull BlurView blurView, @NonNull ViewGroup rootView, @ColorInt int overlayColor, BlurAlgorithm algorithm) {
public PreDrawBlurController(@NonNull View blurView, @NonNull ViewGroup rootView, @ColorInt int overlayColor, BlurAlgorithm algorithm) {
this.rootView = rootView;
this.blurView = blurView;
this.overlayColor = overlayColor;
Expand Down

0 comments on commit 425b875

Please sign in to comment.