Esempio n. 1
0
        public static void StartSkeletonAnimation(this UIView This, SkeletonLayerAnimation anim = null)
        {
            var views = SubviewsSkeletonables(This);

            views.RecursiveSearch(
                () => StartSkeletonAnimation(This, anim),
                v => StartSkeletonAnimation(v, anim));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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);
        }
Esempio n. 5
0
 private static void StartSkeletonLayerAnimationBlock(UIView view, SkeletonLayerAnimation anim = null)
 {
     view.GetSkeletonLayer()?.StartAnimation(anim);
 }
Esempio n. 6
0
 public static void ShowAnimatedGradientSkeleton(this UIView This, SkeletonGradient gradient, SkeletonLayerAnimation animation = null)
 {
     ShowSkeleton(This, gradient.Colors, animated: true, animation: animation);
 }
Esempio n. 7
0
 public static void PlayAnimation(this CALayer This, SkeletonLayerAnimation anim, string key)
 {
     This.SkeletonSublayers()
     .RecursiveSearch(() => This.AddAnimation(anim(This), key),
                      l => PlayAnimation(l, anim, key));
 }