@ TargetApi ( Build . VERSION_CODES . LOLLIPOP ) public void setElevationCompat ( float elevation ) { mShadowColor = 0x26000000 ; mShadowRadius = Math . round ( elevation / 2 ) ; mShadowXOffset = 0 ; mShadowYOffset = Math . round ( mFabSize == SIZE_NORMAL ? elevation : elevation / 2 ) ; if ( Util . hasLollipop ( ) ) { super . setElevation ( elevation ) ; mUsingElevationCompat = true ; mShowShadow = false ; updateBackground ( ) ; ViewGroup . LayoutParams layoutParams = getLayoutParams ( ) ; if ( layoutParams != null ) { setLayoutParams ( layoutParams ) ; } } else { mShowShadow = true ; updateBackground ( ) ; } }
Sets the shadow color and radius to mimic the native elevation .