CameraKit / blurkit-android

The missing Android blurring library. Fast blur-behind layout that parallels iOS.
MIT License
3.72k stars 309 forks source link

New feature request: Support for use behind dialogs #46

Closed TeTRA99 closed 5 years ago

TeTRA99 commented 5 years ago

Other library (fogger) that did this does not work any more using androidx

emersoncloud commented 5 years ago

Hi @TeTRA99 thanks for the feature request. We always appreciate hearing feedback! In our current BlurKit implementation you could blur the background if it's a view by blurring the view just before you create a dialog, then resetting the view content once the dialog is closed.

Something like this

@Override
protected void onCreate(Bundle savedInstanceState) {
        BlurKit.init(this);
}

// ...

// On dialog open
Bitmap bitmap = ((BitmapDrawable)imageView.getDrawable()).getBitmap();
imageView.setImageBitmap(BlurKit.getInstance().fastBlur(imageView, 12, 0.12f));
dialog.show(getSupportFragmentManager(), "dialog");

// On dialog close
imageView.setImageBitmap(bitmap);

We will keep this issue in mind going forward, but it is not currently on our roadmap of features to hit. Thanks again!

TeTRA99 commented 5 years ago

Hi @emersoncloud, thanks for the example. Unfortunatelly I have a complex view behind the dialogs.. not sure it would be as simple as in your example..