If anyone else is having problems with this, you gotta use the Blurry library.
But since the MapView is a surface view, it doesn't work properly with google maps, so you have to capture the MapView
's image into an ImageView
and then call to Blurry, like this:
mGoogleMap.snapshot(new GoogleMap.SnapshotReadyCallback() {
@Override
public void onSnapshotReady(Bitmap bitmap) {
blurView.setVisibility(View.VISIBLE);
blurView.setImageBitmap(bitmap);
Blurry.with(getContext())
.radius(15)
.sampling(2)
.onto(mRootLayout);
mAddressBarLayout.expand();
}
});
as you can imagine, the ImageView is placed on the MapView but it's hidden at first:
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:orientation="vertical">
<com.google.android.gms.maps.MapView
android:id="@+id/map_fragment_mv"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ImageView
android:id="@+id/blur_view"
android:visibility="visible"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</android.support.design.widget.CoordinatorLayout>
Hope this helps someone.