public static void StartSkeletonAnimation(this UIView This, SkeletonLayerAnimation anim = null) { var views = SubviewsSkeletonables(This); views.RecursiveSearch( () => StartSkeletonAnimation(This, anim), v => StartSkeletonAnimation(v, anim)); }
public static void ShowSkeleton( this UIView This, UIColor[] colors, SkeletonType type = SkeletonType.Solid, bool animated = false, SkeletonLayerAnimation animation = null) { AddDummyDataSourceIfNeeded(This); var views = SubviewsSkeletonables(This); views.RecursiveSearch(() => { if (This.IsSkeletonActive()) { return; } This.UserInteractionEnabled = false; This.PrepareForSkeleton(); AddSkeletonLayer(This, colors, type, animated: animated, animation: animation); }, (v) => v.ShowSkeleton(colors, type, animated, animation)); }
public static void AddSkeletonLayer( this UIView This, UIColor[] colors, SkeletonType type, GradientDirection?direction = null, bool animated = false, SkeletonLayerAnimation animation = null) { var skeletonLayer = SkeletonLayerFactory.MakeLayer(type, colors, This); if (direction.HasValue && animation == null) { animation = direction.Value.SlidingAnimation(); } This.SetSkeletonLayer(skeletonLayer); This.Layer.InsertSublayer(skeletonLayer.ContentLayer, int.MaxValue); if (animated) { skeletonLayer.StartAnimation(animation); } This.SetSkeletonStatus(Views.Status.On); }
public void StartAnimation(SkeletonLayerAnimation anim = null) { var animation = anim ?? SkeletonType.GetLayerAnimation(); ContentLayer.PlayAnimation(animation, SkeletonAnimationKey); }
private static void StartSkeletonLayerAnimationBlock(UIView view, SkeletonLayerAnimation anim = null) { view.GetSkeletonLayer()?.StartAnimation(anim); }
public static void ShowAnimatedGradientSkeleton(this UIView This, SkeletonGradient gradient, SkeletonLayerAnimation animation = null) { ShowSkeleton(This, gradient.Colors, animated: true, animation: animation); }
public static void PlayAnimation(this CALayer This, SkeletonLayerAnimation anim, string key) { This.SkeletonSublayers() .RecursiveSearch(() => This.AddAnimation(anim(This), key), l => PlayAnimation(l, anim, key)); }