private void renderBlurLayer ( float slideOffset ) { if ( enableBlur ) { if ( slideOffset == 0 || forceRedraw ) { clearBlurView ( ) ; } if ( slideOffset > 0f && blurView == null ) { if ( drawerLayout . getChildCount ( ) == 2 ) { blurView = new ImageView ( drawerLayout . getContext ( ) ) ; blurView . setLayoutParams ( new ViewGroup . LayoutParams ( ViewGroup . LayoutParams . MATCH_PARENT , ViewGroup . LayoutParams . MATCH_PARENT ) ) ; blurView . setScaleType ( ImageView . ScaleType . FIT_CENTER ) ; drawerLayout . addView ( blurView , 1 ) ; } if ( BuilderUtil . isOnUiThread ( ) ) { if ( cacheMode . equals ( CacheMode . AUTO ) || forceRedraw ) { dali . load ( drawerLayout . getChildAt ( 0 ) ) . blurRadius ( blurRadius ) . downScale ( downSample ) . noFade ( ) . error ( Dali . NO_RESID ) . concurrent ( ) . skipCache ( ) . into ( blurView ) ; forceRedraw = false ; } else { dali . load ( drawerLayout . getChildAt ( 0 ) ) . blurRadius ( blurRadius ) . downScale ( downSample ) . noFade ( ) . error ( Dali . NO_RESID ) . concurrent ( ) . into ( blurView ) ; } } } if ( slideOffset > 0f && slideOffset < 1f ) { int alpha = ( int ) Math . ceil ( ( double ) slideOffset * 255d ) ; LegacySDKUtil . setImageAlpha ( blurView , alpha ) ; } } }
This will blur the view behind it and set it in a imageview over the content with a alpha value that corresponds to slideOffset .