Example #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();


            swtCriticalBugs.SetAnimationElementsOn(
                AnimationElement.TextColor(lblCriticalBugs, UIColor.White),
                AnimationElement.TextColor(lblCriticalBugsDescription, UIColor.White)
                );

            swtCriticalBugs.SetAnimationElementsOff(
                AnimationElement.TextColor(lblCriticalBugs, "514F52".ToUIColor()),
                AnimationElement.TextColor(lblCriticalBugsDescription, "514F52".ToUIColor())
                );

            swtCriticalBugs.OnCompleted += delegate
            {
                imgCriticalBugIcon.Image     = imgCriticalBugIcon.Image.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
                imgCriticalBugIcon.TintColor = UIColor.White;
            };

            swtCriticalBugs.OffCompleted += delegate
            {
                imgCriticalBugIcon.Image     = imgCriticalBugIcon.Image.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
                imgCriticalBugIcon.TintColor = BeerDrinkin.Helpers.Colours.Blue.ToNative();
            };
        }
Example #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // blue switch logging
            blueSwitch.OnCompleted += delegate {
                Console.WriteLine("Animation On");
            };
            blueSwitch.OffCompleted += delegate {
                Console.WriteLine("Animation Off");
            };

            // the blue switch effects
            blueSwitch.SetAnimationElementsOn(
                AnimationElement.TextColor(blueLabel, UIColor.White),
                AnimationElement.TintColor(infoButton, UIColor.White));
            blueSwitch.SetAnimationElementsOff(
                AnimationElement.TextColor(blueLabel, UIColor.Black),
                AnimationElement.TintColor(infoButton, UIColor.Black));

            // the blue switch events
            blueSwitch.OnCompleted += delegate {
                UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;
            };
            blueSwitch.OffCompleted += delegate {
                UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.Default;
            };

            // the green switch effects
            greenSwitch.SetAnimationElementsOn(
                AnimationElement.Layer(greenView.Layer, "backgroundColor", UIColor.Clear.CGColor, UIColor.White.CGColor)
                );
            greenSwitch.SetAnimationElementsOff(
                AnimationElement.Layer(greenView.Layer, "backgroundColor", UIColor.White.CGColor, UIColor.Clear.CGColor)
                );
        }