Permalink
Browse files

Added CoreAnimation Sample + Chmod +x on git hook install

Added a sample for Core Animation, along with screenshots, metadata,
etc.

Also, did chmod +x on the git hook install.
  • Loading branch information...
1 parent c253d38 commit 1360fcec32197ddf6113d1a406cf4e3150f42487 Bryan Costanich committed Sep 30, 2011
Showing with 4,239 additions and 0 deletions.
  1. +26 −0 CoreAnimation/CoreAnimation.sln
  2. +33 −0 CoreAnimation/CoreAnimation/AppDelegate.cs
  3. +20 −0 CoreAnimation/CoreAnimation/Application.cs
  4. +136 −0 CoreAnimation/CoreAnimation/Code/NavigationTable/NavItem.cs
  5. +35 −0 CoreAnimation/CoreAnimation/Code/NavigationTable/NavItemGroup.cs
  6. +96 −0 CoreAnimation/CoreAnimation/Code/NavigationTable/NavItemTableSource.cs
  7. +12 −0 CoreAnimation/CoreAnimation/Code/NavigationTable/RowClickedEventArgs.cs
  8. +153 −0 CoreAnimation/CoreAnimation/CoreAnimation.csproj
  9. BIN CoreAnimation/CoreAnimation/Default-Landscape.png
  10. BIN CoreAnimation/CoreAnimation/Default-Portrait.png
  11. BIN CoreAnimation/CoreAnimation/Default.png
  12. BIN CoreAnimation/CoreAnimation/Default@2x.png
  13. BIN CoreAnimation/CoreAnimation/Images/Icons/114_icon.png
  14. BIN CoreAnimation/CoreAnimation/Images/Icons/29_icon.png
  15. BIN CoreAnimation/CoreAnimation/Images/Icons/50_icon.png
  16. BIN CoreAnimation/CoreAnimation/Images/Icons/512_icon.png
  17. BIN CoreAnimation/CoreAnimation/Images/Icons/57_icon.png
  18. BIN CoreAnimation/CoreAnimation/Images/Icons/58_icon.png
  19. BIN CoreAnimation/CoreAnimation/Images/Icons/72_icon.png
  20. +36 −0 CoreAnimation/CoreAnimation/Info.plist
  21. +348 −0 CoreAnimation/CoreAnimation/Screens/iPad/BasicUIViewAnimation/BasicUIViewAnimationScreen.xib
  22. +107 −0 CoreAnimation/CoreAnimation/Screens/iPad/BasicUIViewAnimation/BasicUIViewAnimationScreen.xib.cs
  23. +23 −0 ...mation/CoreAnimation/Screens/iPad/BasicUIViewAnimation/BasicUIViewAnimationScreen.xib.designer.cs
  24. +839 −0 ...tion/CoreAnimation/Screens/iPad/CustomizableAnimationViewer/CustomizableAnimationViewerScreen.xib
  25. +132 −0 ...n/CoreAnimation/Screens/iPad/CustomizableAnimationViewer/CustomizableAnimationViewerScreen.xib.cs
  26. +38 −0 ...mation/Screens/iPad/CustomizableAnimationViewer/CustomizableAnimationViewerScreen.xib.designer.cs
  27. +117 −0 CoreAnimation/CoreAnimation/Screens/iPad/Home/MainSplitView.cs
  28. +11 −0 CoreAnimation/CoreAnimation/Screens/iPad/IDetailView.cs
  29. +301 −0 CoreAnimation/CoreAnimation/Screens/iPad/LayerAnimation/ImplicitAnimationScreen.xib
  30. +128 −0 CoreAnimation/CoreAnimation/Screens/iPad/LayerAnimation/ImplicitAnimationScreen.xib.cs
  31. +61 −0 CoreAnimation/CoreAnimation/Screens/iPad/LayerAnimation/ImplicitAnimationScreen.xib.designer.cs
  32. +351 −0 CoreAnimation/CoreAnimation/Screens/iPad/LayerAnimation/LayerAnimationScreen.xib
  33. +137 −0 CoreAnimation/CoreAnimation/Screens/iPad/LayerAnimation/LayerAnimationScreen.xib.cs
  34. +75 −0 CoreAnimation/CoreAnimation/Screens/iPad/LayerAnimation/LayerAnimationScreen.xib.designer.cs
  35. +63 −0 CoreAnimation/CoreAnimation/Screens/iPad/NavTable/MasterNavTableViewController.cs
  36. +256 −0 CoreAnimation/CoreAnimation/Screens/iPad/ViewTransitions/BackTransitionViewController.xib
  37. +52 −0 CoreAnimation/CoreAnimation/Screens/iPad/ViewTransitions/BackTransitionViewController.xib.cs
  38. +47 −0 ...Animation/CoreAnimation/Screens/iPad/ViewTransitions/BackTransitionViewController.xib.designer.cs
  39. +74 −0 CoreAnimation/CoreAnimation/Screens/iPad/ViewTransitions/Controller.cs
  40. +355 −0 CoreAnimation/CoreAnimation/Screens/iPad/ViewTransitions/TransitionViewController.xib
  41. +77 −0 CoreAnimation/CoreAnimation/Screens/iPad/ViewTransitions/TransitionViewController.xib.cs
  42. +61 −0 CoreAnimation/CoreAnimation/Screens/iPad/ViewTransitions/TransitionViewController.xib.designer.cs
  43. +7 −0 CoreAnimation/Metadata.xml
  44. +32 −0 CoreAnimation/README.md
  45. BIN CoreAnimation/Screenshots/01.png
  46. BIN CoreAnimation/Screenshots/02.png
  47. BIN CoreAnimation/Screenshots/03.png
  48. BIN CoreAnimation/Screenshots/04.png
  49. BIN CoreAnimation/Screenshots/05.png
  50. 0 install-hook.sh
@@ -0,0 +1,26 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreAnimation", "CoreAnimation\CoreAnimation.csproj", "{98F6ED66-B4E9-45F2-948E-5DCF19E18B24}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|iPhoneSimulator = Debug|iPhoneSimulator
+ Release|iPhoneSimulator = Release|iPhoneSimulator
+ Debug|iPhone = Debug|iPhone
+ Release|iPhone = Release|iPhone
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {98F6ED66-B4E9-45F2-948E-5DCF19E18B24}.Debug|iPhone.ActiveCfg = Debug|iPhone
+ {98F6ED66-B4E9-45F2-948E-5DCF19E18B24}.Debug|iPhone.Build.0 = Debug|iPhone
+ {98F6ED66-B4E9-45F2-948E-5DCF19E18B24}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
+ {98F6ED66-B4E9-45F2-948E-5DCF19E18B24}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
+ {98F6ED66-B4E9-45F2-948E-5DCF19E18B24}.Release|iPhone.ActiveCfg = Release|iPhone
+ {98F6ED66-B4E9-45F2-948E-5DCF19E18B24}.Release|iPhone.Build.0 = Release|iPhone
+ {98F6ED66-B4E9-45F2-948E-5DCF19E18B24}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
+ {98F6ED66-B4E9-45F2-948E-5DCF19E18B24}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ StartupItem = CoreAnimation\CoreAnimation.csproj
+ EndGlobalSection
+EndGlobal
@@ -0,0 +1,33 @@
+using System;
+using MonoTouch.UIKit;
+using MonoTouch.Foundation;
+
+namespace Example_CoreAnimation
+{
+ [Register("AppDelegate")]
+ public class AppDelegate : UIApplicationDelegate
+ {
+
+ #region declarations and properties
+
+ protected UIWindow window;
+ protected Screens.iPad.Home.MainSplitView splitView;
+
+ #endregion
+
+ public override bool FinishedLaunching (UIApplication app, NSDictionary options)
+ {
+ // create our window
+ window = new UIWindow (UIScreen.MainScreen.Bounds);
+ window.MakeKeyAndVisible ();
+
+ // instantiate our main split view controller
+ splitView = new Screens.iPad.Home.MainSplitView ();
+
+ window.RootViewController = splitView;
+
+ //
+ return true;
+ }
+ }
+}
@@ -0,0 +1,20 @@
+using System;
+using MonoTouch.UIKit;
+
+namespace Example_CoreAnimation
+{
+ public class Application
+ {
+ public static void Main (string[] args)
+ {
+ try
+ {
+ UIApplication.Main (args, null, "AppDelegate");
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine (e.ToString ());
+ }
+ }
+ }
+}
@@ -0,0 +1,136 @@
+using System;
+using MonoTouch.UIKit;
+
+namespace Example_CoreAnimation.Code.NavigationTable
+{
+ /// <summary>
+ ///
+ /// </summary>
+ public class NavItem
+ {
+
+ #region declarations
+
+ /// <summary>
+ /// The name of the nav item, shows up as the label
+ /// </summary>
+ public string Name
+ {
+ get { return name; }
+ set { name = value; }
+ }
+ protected string name;
+
+ /// <summary>
+ /// The UIViewController that the nav item opens. Use this property if you
+ /// wanted to early instantiate the controller when the nav table is built out,
+ /// otherwise just set the Type property and it will lazy-instantiate when the
+ /// nav item is clicked on.
+ /// </summary>
+ public UIViewController Controller
+ {
+ get { return controller; }
+ set { controller = value; }
+ }
+ protected UIViewController controller;
+
+ /// <summary>
+ /// Path to the image to show in the nav item
+ /// </summary>
+ public string ImagePath
+ {
+ get { return imagePath; }
+ set { imagePath = value; }
+ }
+ protected string imagePath;
+
+ /// <summary>
+ /// The Type of the UIViewController. Set this to the type and leave the Controller
+ /// property empty to lazy-instantiate the ViewController when the nav item is
+ /// clicked.
+ /// </summary>
+ public Type ControllerType
+ {
+ get { return controllerType; }
+ set { controllerType = value; }
+ }
+ protected Type controllerType;
+
+ /// <summary>
+ /// a list of the constructor args (if neccesary) for the controller. use this in
+ /// conjunction with ControllerType if lazy-creating controllers.
+ /// </summary>
+ public object[] ControllerConstructorArgs
+ {
+ get { return controllerConstructorArgs; }
+ set
+ {
+ controllerConstructorArgs = value;
+
+ controllerConstructorTypes = new Type[controllerConstructorArgs.Length];
+ for(int i = 0; i < controllerConstructorArgs.Length; i++) {
+ controllerConstructorTypes[i] = controllerConstructorArgs[i].GetType();
+ }
+ }
+ }
+ protected object[] controllerConstructorArgs = new object[] {};
+
+ /// <summary>
+ /// The types of constructor args.
+ /// </summary>
+ public Type[] ControllerConstructorTypes
+ {
+ get { return controllerConstructorTypes; }
+ }
+ protected Type[] controllerConstructorTypes = Type.EmptyTypes;
+
+ #endregion
+
+
+
+
+ #region constructors
+
+ public NavItem ()
+ {
+ }
+
+ public NavItem (string name) : this ()
+ {
+ this.name = name;
+ }
+
+ public NavItem (string name, UIViewController controller) : this (name)
+ {
+ this.controller = controller;
+ }
+
+ public NavItem (string name, Type controllerType) : this (name)
+ {
+ this.controllerType = controllerType;
+ }
+
+ public NavItem (string name, Type controllerType, object[] controllerConstructorArgs) : this (name, controllerType)
+ {
+ this.ControllerConstructorArgs = controllerConstructorArgs;
+ }
+
+ public NavItem (string name, UIViewController controller, string imagePath) : this (name, controller)
+ {
+ this.imagePath = imagePath;
+ }
+
+ public NavItem (string name, string imagePath, Type controllerType) : this (name, controllerType)
+ {
+ this.imagePath = imagePath;
+ }
+
+ public NavItem (string name, string imagePath, Type controllerType, object[] controllerConstructorArgs) : this (name, controllerType, controllerConstructorArgs)
+ {
+ this.imagePath = imagePath;
+ }
+
+ #endregion
+
+ }
+}
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+
+namespace Example_CoreAnimation.Code.NavigationTable
+{
+
+ /// <summary>
+ /// A group that contains table items
+ /// </summary>
+ public class NavItemGroup
+ {
+ public string Name { get; set; }
+
+ public string Footer { get; set; }
+
+ public List<NavItem> Items
+ {
+ get { return items; }
+ set { items = value; }
+ }
+ protected List<NavItem> items = new List<NavItem> ();
+
+ public NavItemGroup ()
+ {
+ }
+
+ public NavItemGroup (string name)
+ {
+ this.Name = name;
+ }
+
+ }
+
+}
+
@@ -0,0 +1,96 @@
+using System;
+using System.Collections.Generic;
+using MonoTouch.UIKit;
+using MonoTouch.Foundation;
+using System.Reflection;
+
+namespace Example_CoreAnimation.Code.NavigationTable
+{
+
+ /// <summary>
+ /// Combined DataSource and Delegate for our UITableView
+ /// </summary>
+ public class NavItemTableSource : UITableViewSource
+ {
+ public event EventHandler<RowClickedEventArgs> RowClicked;
+
+ protected List<NavItemGroup> navItems;
+ string cellIdentifier = "NavTableCellView";
+
+ public NavItemTableSource (List<NavItemGroup> items)
+ {
+ navItems = items;
+ }
+
+ /// <summary>
+ /// Called by the TableView to determine how many sections(groups) there are.
+ /// </summary>
+ public override int NumberOfSections (UITableView tableView)
+ {
+ return navItems.Count;
+ }
+
+ /// <summary>
+ /// Called by the TableView to determine how many cells to create for that particular section.
+ /// </summary>
+ public override int RowsInSection (UITableView tableview, int section)
+ {
+ return navItems[section].Items.Count;
+ }
+
+ /// <summary>
+ /// Called by the TableView to retrieve the header text for the particular section(group)
+ /// </summary>
+ public override string TitleForHeader (UITableView tableView, int section)
+ {
+ return navItems[section].Name;
+ }
+
+ /// <summary>
+ /// Called by the TableView to retrieve the footer text for the particular section(group)
+ /// </summary>
+ public override string TitleForFooter (UITableView tableView, int section)
+ {
+ return navItems[section].Footer;
+ }
+
+ /// <summary>
+ /// Called by the TableView to actually build each cell.
+ /// </summary>
+ public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
+ {
+ // declare vars
+ NavItem navItem = navItems[indexPath.Section].Items[indexPath.Row];
+ UIImage navIcon = null;
+
+ var cell = tableView.DequeueReusableCell (cellIdentifier);
+ if (cell == null) {
+ cell = new UITableViewCell (UITableViewCellStyle.Default, cellIdentifier);
+ cell.Tag = Environment.TickCount;
+ }
+
+ // set the cell properties
+ cell.TextLabel.Text = navItems[indexPath.Section].Items[indexPath.Row].Name;
+ cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
+
+ // return the cell
+ return cell;
+ }
+
+
+ /// <summary>
+ /// Is called when a row is selected
+ /// </summary>
+ public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
+ {
+ // get a reference to the nav item
+ NavItem navItem = navItems[indexPath.Section].Items[indexPath.Row];
+
+ if(this.RowClicked != null)
+ this.RowClicked(this, new RowClickedEventArgs(navItem));
+ }
+
+
+ }
+}
+
@@ -0,0 +1,12 @@
+using System;
+namespace Example_CoreAnimation.Code.NavigationTable
+{
+ public class RowClickedEventArgs : EventArgs
+ {
+ public NavItem Item { get; set; }
+
+ public RowClickedEventArgs(NavItem item) : base()
+ { this.Item = item; }
+ }
+}
+
Oops, something went wrong.

0 comments on commit 1360fce

Please sign in to comment.