Ejemplo n.º 1
0
			internal SwipeMenuView (BaseTimelineViewController parent, UIImage [] images, RectangleF frame) : base (frame)
			{
				this.parent = parent;
				this.images = images;

				Layer.MasksToBounds = true;
				Layer.AddSublayer (MakeBackgroundLayer (frame));

				layers = new CALayer [images.Length];
				
				float slotsize = frame.Width/layers.Length;
				double delay = globalDelay; 
				for (int i = 0; i < layers.Length; i++){
					var image = images [i];
					var layer = layers [i] = new CALayer ();
					Graphics.ConfigLayerHighRes (layer);					

					image = RenderImageWithShadow (image, 3, UIColor.Black);
					layer.Contents = image.CGImage;
					
					var alpha = (CAKeyFrameAnimation) CAKeyFrameAnimation.FromKeyPath ("opacity");
#if false
					var vals = new List<NSNumber> ();
					for (int j = 0; j <= i; j++)
						vals.Add (new NSNumber (0));
					vals.Add (new NSNumber (1));
					alpha.Values = vals.ToArray ();
#endif
					alpha.Values = new NSNumber [] {
						NSNumber.FromFloat (0),
						NSNumber.FromFloat (0.1f),
						NSNumber.FromFloat (1),
					};
					alpha.KeyTimes = new NSNumber [] {
						NSNumber.FromFloat (0),
						NSNumber.FromFloat (1f/(layers.Length-i)),
						NSNumber.FromFloat (1),
					};
					
					var size = (CAKeyFrameAnimation) CAKeyFrameAnimation.FromKeyPath ("transform.scale");
					size.Values = new NSNumber [] {
						NSNumber.FromFloat (0.7f),
						NSNumber.FromFloat (1.3f),
						NSNumber.FromFloat (1),
					};

#if debug
					var pos = (CAKeyFrameAnimation) CAKeyFrameAnimation.FromKeyPath ("position.y");
					pos.Values = new NSNumber [] {
						NSNumber.FromFloat (0f),
						NSNumber.FromFloat (60f),
					};
#endif					
					var group = CAAnimationGroup.CreateAnimation ();
					group.Animations = new CAAnimation [] { alpha, size /*, pos */ };
					group.Duration = delay; 
					
					layer.AddAnimation (group, "showup");					
					
					layer.Frame = new RectangleF (
						(int) (slotsize*i+image.Size.Width/2), 
						(int) (frame.Height-image.Size.Height)/2, 
						image.Size.Width, image.Size.Height);

					Layer.AddSublayer (layer);
				}
			}
Ejemplo n.º 2
0
			public SwipeDetectingTableView (RectangleF bounds, UITableViewStyle style, BaseTimelineViewController container)
				: base (bounds, style)
			{
				this.container = container;
			}
Ejemplo n.º 3
0
			public ScrollTrackingSizingSource (DialogViewController dvc) : base(dvc)
			{
				parent = dvc as BaseTimelineViewController;
			}