wasabeef / Blurry

Blurry is an easy blur library for Android
Apache License 2.0
5.57k stars 602 forks source link

Does Blurry working over Google Map ? #39

Open nindzyago opened 8 years ago

nindzyago commented 8 years ago

I've tried to apply Blurry on google map but it only blurs the Google logo. Am I doing something wrong or it's just a bug ?

marianocordoba commented 7 years ago

Same here. It blurs everything but the map.

Gregliest commented 7 years ago

I got this to work by taking a snapshot of the map, and then having a separate imageview to show the blurred view:


map.snapshot(new GoogleMap.SnapshotReadyCallback() {
                @Override
                public void onSnapshotReady(Bitmap bitmap) {
                    mapBlurImage.setVisibility(View.VISIBLE);

                    Blurry.with(SUActivity.this)
                            .radius(12)
                            .sampling(3)
                            .from(bitmap)
                            .into(mapBlurImage);
newmanw commented 6 years ago

I am initializing a view that does not currently have a map. I initialize the map on the users current location and then grab a screenshot and blur. However to grab a screenshot I believe that the map has to be visible. This means that the map shows unblurred for a few seconds and then blurs.

tangxianqiang commented 6 years ago

It can not work on SurfaceView or other opengl view

arberg commented 2 years ago

I have added surface-copy using PixelCopy. See my pull request: https://github.com/wasabeef/Blurry/pull/120

PixelCopy can copy pixels on the Google Map surface, and as far as I know any other surface shown in the window. It only works for API-26+, so snapshot into ImageView is still needed before API-26. I have also added some code to the Readme that can help with that, like the suggestion of Gregliest above.