private void init() { SetScaleType(SCALE_TYPE); mReady = true; if (Build.VERSION.SdkInt >= Build.VERSION_CODES.Lollipop) { OutlineProvider = new MyOutlineProvider(mBorderRect); } if (mSetupPending) { setup(); mSetupPending = false; } }
private void SetBackgroundCompat (Drawable drawable) { if (HasLollipopApi) { #if __ANDROID_21__ var elevation = 0.0f; if (hasShadow) { elevation = Elevation > 0.0f ? Elevation : Resources.GetDimensionPixelSize (Resource.Dimension.fab_elevation_lollipop); } Elevation = elevation; var states = new int[][] { new int[]{ } }; var rippleDrawable = new RippleDrawable (new Android.Content.Res.ColorStateList (states, new int[]{ colorRipple }), drawable, null); OutlineProvider = new MyOutlineProvider (Resources, size); ClipToOutline = true; Background = rippleDrawable; #endif } else if (HasJellyBeanApi) { #if __ANDROID_16__ Background = drawable; #endif } else { SetBackgroundDrawable (drawable); } }