* removed an old sampel and added new one

* added assets

* updated docs

* resized screenshots
This commit is contained in:
Mykyta Bondarenko 2018-11-15 12:47:54 -05:00 коммит произвёл Craig Dunn
Родитель 5c39477785
Коммит 50024628f8
67 изменённых файлов: 837 добавлений и 900 удалений

Просмотреть файл

@ -1,54 +0,0 @@
using System;
using UIKit;
using Foundation;
namespace FontList {
[Register("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
protected UIWindow window;
protected UINavigationController mainNavController;
protected FontList.Screens.Universal.FontListing.FontFamiliesTableViewController home;
/// <summary>
/// The current device (iPad or iPhone)
/// </summary>
public DeviceType CurrentDevice { get; set; }
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
// create our window
window = new UIWindow (UIScreen.MainScreen.Bounds);
window.MakeKeyAndVisible ();
// are we running an iPhone or an iPad?
DetermineCurrentDevice ();
// instantiate our main navigatin controller and add it's view to the window
mainNavController = new UINavigationController ();
switch (CurrentDevice)
{
case DeviceType.iPhone:
case DeviceType.iPad:
home = new FontList.Screens.Universal.FontListing.FontFamiliesTableViewController ();
mainNavController.PushViewController (home, false);
break;
}
window.RootViewController = mainNavController;
return true;
}
protected void DetermineCurrentDevice ()
{
// figure out the current device type
if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) {
CurrentDevice = DeviceType.iPad;
} else {
CurrentDevice = DeviceType.iPhone;
}
}
}
}

Просмотреть файл

@ -1,20 +0,0 @@
using System;
using UIKit;
namespace FontList
{
public class Application
{
public static void Main (string[] args)
{
try
{
UIApplication.Main (args, null, "AppDelegate");
}
catch (Exception e)
{
Console.WriteLine (e.ToString ());
}
}
}
}

Просмотреть файл

@ -1,106 +0,0 @@
using System;
using UIKit;
namespace FontList.Code {
public class NavItem
{
/// <summary>
/// The name of the nav item, shows up as the label
/// </summary>
public string Name { get; set; }
/// <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; set; }
/// <summary>
/// Path to the image to show in the nav item
/// </summary>
public string ImagePath { get; set; }
/// <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; set; }
/// <summary>
/// The font used to display the item.
/// </summary>
public UIFont Font { get; set; }
/// <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[this.controllerConstructorArgs.Length];
for(int i = 0; i < this.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 this.controllerConstructorTypes; }
}
protected Type[] controllerConstructorTypes = Type.EmptyTypes;
public NavItem ()
{
}
public NavItem (string name) : this()
{
Name = name;
}
public NavItem (string name, UIViewController controller) : this(name)
{
Controller = controller;
}
public NavItem (string name, Type controllerType) : this(name)
{
ControllerType = controllerType;
}
public NavItem (string name, Type controllerType, object[] controllerConstructorArgs) : this(name, controllerType)
{
ControllerConstructorArgs = controllerConstructorArgs;
}
public NavItem (string name, UIViewController controller, string imagePath) : this(name, controller)
{
ImagePath = imagePath;
}
public NavItem (string name, string imagePath, Type controllerType) : this(name, controllerType)
{
ImagePath = imagePath;
}
public NavItem (string name, string imagePath, Type controllerType, object[] controllerConstructorArgs) : this(name, controllerType, controllerConstructorArgs)
{
ImagePath = imagePath;
}
}
}

Просмотреть файл

@ -1,27 +0,0 @@
using System;
using System.Collections.Generic;
namespace FontList.Code {
/// <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; set; }
public NavItemGroup ()
{
Items = new List<NavItem> ();
}
public NavItemGroup (string name)
{
Name = name;
Items = new List<NavItem> ();
}
}
}

Просмотреть файл

@ -1,137 +0,0 @@
using System;
using System.Collections.Generic;
using UIKit;
using Foundation;
using System.Reflection;
namespace FontList.Code {
/// <summary>
/// Combined DataSource and Delegate for our UITableView
/// </summary>
public class NavItemTableSource : UITableViewSource
{
protected List<NavItemGroup> navItems;
string cellIdentifier = "NavTableCellView";
UINavigationController navigationController;
public NavItemTableSource (UINavigationController navigationController, List<NavItemGroup> items)
{
navItems = items;
this.navigationController = navigationController;
}
/// <summary>
/// Called by the TableView to determine how many sections(groups) there are.
/// </summary>
public override nint 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 nint RowsInSection (UITableView tableview, nint section)
{
return navItems[(int)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, nint section)
{
return navItems[(int)section].Name;
}
/// <summary>
/// Called by the TableView to retrieve the footer text for the particular section(group)
/// </summary>
public override string TitleForFooter (UITableView tableView, nint section)
{
return navItems[(int)section].Footer;
}
/// <summary>
/// Called by the TableView to actually build each cell.
/// </summary>
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
{
NavItem navItem = this.navItems[indexPath.Section].Items[indexPath.Row];
var cell = tableView.DequeueReusableCell (this.cellIdentifier);
if (cell == null) {
cell = new UITableViewCell (UITableViewCellStyle.Default, this.cellIdentifier);
cell.Tag = Environment.TickCount;
}
//---- set the cell properties
cell.TextLabel.Text = this.navItems[indexPath.Section].Items[indexPath.Row].Name;
cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
if (navItem.Font != null)
{
cell.TextLabel.Font = navItem.Font;
}
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 the nav item has a proper controller, push it on to the NavigationController
// NOTE: we could also raise an event here, to loosely couple this, but isn't neccessary,
// because we'll only ever use this this way
if (navItem.Controller != null) {
navigationController.PushViewController (navItem.Controller, true);
// show the nav bar (we don't show it on the home page)
navigationController.NavigationBarHidden = false;
} else {
if (navItem.ControllerType != null) {
ConstructorInfo ctor = null;
// if the nav item has constructor aguments
if (navItem.ControllerConstructorArgs.Length > 0) {
// look for the constructor
ctor = navItem.ControllerType.GetConstructor (navItem.ControllerConstructorTypes);
} else {
// search for the default constructor
ctor = navItem.ControllerType.GetConstructor (System.Type.EmptyTypes);
}
// if we found the constructor
if (ctor != null) {
UIViewController instance = null;
if (navItem.ControllerConstructorArgs.Length > 0) {
// instance the view controller
instance = ctor.Invoke (navItem.ControllerConstructorArgs) as UIViewController;
} else {
// instance the view controller
instance = ctor.Invoke (null) as UIViewController;
}
if (instance != null) {
// save the object
navItem.Controller = instance;
// push the view controller onto the stack
navigationController.PushViewController (navItem.Controller, true);
} else {
Console.WriteLine ("instance of view controller not created");
}
} else {
Console.WriteLine ("constructor not found");
}
}
}
}
}
}

Просмотреть файл

@ -1,13 +0,0 @@
using System;
namespace FontList
{
/// <summary>
/// The type of device, e.g. iPhone, or iPad
/// </summary>
public enum DeviceType
{
iPhone,
iPad
}
}

Просмотреть файл

@ -1,141 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0181730D-31E9-4DCA-8C52-6455A0963E1C}</ProjectGuid>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>FontList</RootNamespace>
<TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchDebug>True</MtouchDebug>
<ConsolePause>False</ConsolePause>
<MtouchLink>None</MtouchLink>
<MtouchI18n></MtouchI18n>
<MtouchArch>x86_64</MtouchArch>
<AssemblyName>FontList</AssemblyName>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<MtouchLink>None</MtouchLink>
<MtouchI18n></MtouchI18n>
<MtouchArch>x86_64</MtouchArch>
<AssemblyName>FontList</AssemblyName>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchDebug>True</MtouchDebug>
<ConsolePause>False</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchI18n></MtouchI18n>
<MtouchArch>ARM64</MtouchArch>
<IpaPackageName></IpaPackageName>
<AssemblyName>Example_Fonts</AssemblyName>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchI18n></MtouchI18n>
<MtouchArch>ARM64</MtouchArch>
<AssemblyName>Example_Fonts</AssemblyName>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<Compile Include="AppDelegate.cs" />
<Compile Include="Application.cs" />
<Compile Include="DeviceType.cs" />
<Compile Include="Code\NavItem.cs" />
<Compile Include="Code\NavItemGroup.cs" />
<Compile Include="Code\NavItemTableSource.cs" />
<Compile Include="Screens\iPhone\FontViewer\FontViewerScreen_iPhone.xib.cs">
<DependentUpon>FontViewerScreen_iPhone.xib</DependentUpon>
</Compile>
<Compile Include="Screens\iPhone\FontViewer\FontViewerScreen_iPhone.xib.designer.cs">
<DependentUpon>FontViewerScreen_iPhone.xib</DependentUpon>
</Compile>
<Compile Include="Screens\Universal\FontListing\FontFamiliesTableViewController.cs" />
<Compile Include="Screens\iPad\FontViewer\FontViewerScreen_iPad.xib.cs">
<DependentUpon>FontViewerScreen_iPad.xib</DependentUpon>
</Compile>
<Compile Include="Screens\iPad\FontViewer\FontViewerScreen_iPad.xib.designer.cs">
<DependentUpon>FontViewerScreen_iPad.xib</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="Code\" />
<Folder Include="Screens\" />
<Folder Include="Screens\iPhone\" />
<Folder Include="Screens\iPhone\FontViewer\" />
<Folder Include="Screens\Universal\" />
<Folder Include="Screens\Universal\FontListing\" />
<Folder Include="Screens\iPad\" />
<Folder Include="Screens\iPad\FontViewer\" />
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="Screens\iPhone\FontViewer\FontViewerScreen_iPhone.xib" />
<InterfaceDefinition Include="Screens\iPad\FontViewer\FontViewerScreen_iPad.xib" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\icon-72.png" />
<BundleResource Include="Resources\icon-29.png" />
<BundleResource Include="Resources\icon-50.png" />
<BundleResource Include="Resources\icon-58.png" />
<BundleResource Include="Resources\icon-100.png" />
<BundleResource Include="Resources\iTunesArtwork%402x.png" />
<BundleResource Include="Resources\Default-568h%402x.png" />
<BundleResource Include="Resources\Default-Landscape%402x~ipad.png" />
<BundleResource Include="Resources\Default-Landscape~ipad.png" />
<BundleResource Include="Resources\Default-Portrait%402x~ipad.png" />
<BundleResource Include="Resources\Default-Portrait~ipad.png" />
<BundleResource Include="Resources\Default.png" />
<BundleResource Include="Resources\Default%402x.png" />
<BundleResource Include="Resources\icon-57.png" />
<BundleResource Include="Resources\icon-114.png" />
<BundleResource Include="Resources\icon-144.png" />
</ItemGroup>
<ItemGroup>
<ITunesArtwork Include="Resources\iTunesArtwork.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
</Project>

Просмотреть файл

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FontList", "FontList.csproj", "{0181730D-31E9-4DCA-8C52-6455A0963E1C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FontList", "FontList\FontList.csproj", "{B62DF180-BA8C-4F2D-8D0E-1BA98DDDAF0E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -11,14 +11,14 @@ Global
Release|iPhone = Release|iPhone
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0181730D-31E9-4DCA-8C52-6455A0963E1C}.Debug|iPhone.ActiveCfg = Debug|iPhone
{0181730D-31E9-4DCA-8C52-6455A0963E1C}.Debug|iPhone.Build.0 = Debug|iPhone
{0181730D-31E9-4DCA-8C52-6455A0963E1C}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{0181730D-31E9-4DCA-8C52-6455A0963E1C}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{0181730D-31E9-4DCA-8C52-6455A0963E1C}.Release|iPhone.ActiveCfg = Release|iPhone
{0181730D-31E9-4DCA-8C52-6455A0963E1C}.Release|iPhone.Build.0 = Release|iPhone
{0181730D-31E9-4DCA-8C52-6455A0963E1C}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{0181730D-31E9-4DCA-8C52-6455A0963E1C}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{B62DF180-BA8C-4F2D-8D0E-1BA98DDDAF0E}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{B62DF180-BA8C-4F2D-8D0E-1BA98DDDAF0E}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{B62DF180-BA8C-4F2D-8D0E-1BA98DDDAF0E}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{B62DF180-BA8C-4F2D-8D0E-1BA98DDDAF0E}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{B62DF180-BA8C-4F2D-8D0E-1BA98DDDAF0E}.Debug|iPhone.ActiveCfg = Debug|iPhone
{B62DF180-BA8C-4F2D-8D0E-1BA98DDDAF0E}.Debug|iPhone.Build.0 = Debug|iPhone
{B62DF180-BA8C-4F2D-8D0E-1BA98DDDAF0E}.Release|iPhone.ActiveCfg = Release|iPhone
{B62DF180-BA8C-4F2D-8D0E-1BA98DDDAF0E}.Release|iPhone.Build.0 = Release|iPhone
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = FontList.csproj

Просмотреть файл

@ -0,0 +1,21 @@
using Foundation;
using UIKit;
namespace FontList
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to application events from iOS.
[Register("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
public override UIWindow Window { get; set; }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
// Override point for customization after application launch.
// If not required for your application you can safely delete this method
return true;
}
}
}

Просмотреть файл

@ -0,0 +1,244 @@
{
"images": [
{
"size": "20x20",
"scale": "2x",
"idiom": "iphone"
},
{
"size": "20x20",
"scale": "3x",
"idiom": "iphone"
},
{
"filename": "icon-spotlight-29@2x.png",
"size": "29x29",
"scale": "2x",
"idiom": "iphone"
},
{
"filename": "icon-spotlight-29@3x.png",
"size": "29x29",
"scale": "3x",
"idiom": "iphone"
},
{
"filename": "icon-spotlight-40@2x.png",
"size": "40x40",
"scale": "2x",
"idiom": "iphone"
},
{
"filename": "icon-spotlight-40@3x.png",
"size": "40x40",
"scale": "3x",
"idiom": "iphone"
},
{
"filename": "icon-app-60@2x.png",
"size": "60x60",
"scale": "2x",
"idiom": "iphone"
},
{
"filename": "Icon-app-60@3x.png",
"size": "60x60",
"scale": "3x",
"idiom": "iphone"
},
{
"size": "20x20",
"scale": "1x",
"idiom": "ipad"
},
{
"size": "20x20",
"scale": "2x",
"idiom": "ipad"
},
{
"filename": "icon-spotlight-29.png",
"size": "29x29",
"scale": "1x",
"idiom": "ipad"
},
{
"filename": "icon-spotlight-29@2x.png",
"size": "29x29",
"scale": "2x",
"idiom": "ipad"
},
{
"size": "40x40",
"scale": "1x",
"idiom": "ipad"
},
{
"filename": "icon-spotlight-40@2x.png",
"size": "40x40",
"scale": "2x",
"idiom": "ipad"
},
{
"filename": "Icon-app-83.5@2x.png",
"size": "83.5x83.5",
"scale": "2x",
"idiom": "ipad"
},
{
"filename": "icon-app-76.png",
"size": "76x76",
"scale": "1x",
"idiom": "ipad"
},
{
"filename": "icon-app-76@2x.png",
"size": "76x76",
"scale": "2x",
"idiom": "ipad"
},
{
"filename": "app-store-logo.png",
"size": "1024x1024",
"scale": "1x",
"idiom": "ios-marketing"
},
{
"size": "60x60",
"scale": "2x",
"idiom": "car"
},
{
"size": "60x60",
"scale": "3x",
"idiom": "car"
},
{
"role": "notificationCenter",
"size": "24x24",
"subtype": "38mm",
"scale": "2x",
"idiom": "watch"
},
{
"role": "notificationCenter",
"size": "27.5x27.5",
"subtype": "42mm",
"scale": "2x",
"idiom": "watch"
},
{
"role": "companionSettings",
"size": "29x29",
"scale": "2x",
"idiom": "watch"
},
{
"role": "companionSettings",
"size": "29x29",
"scale": "3x",
"idiom": "watch"
},
{
"role": "appLauncher",
"size": "40x40",
"subtype": "38mm",
"scale": "2x",
"idiom": "watch"
},
{
"role": "appLauncher",
"size": "44x44",
"subtype": "40mm",
"scale": "2x",
"idiom": "watch"
},
{
"role": "appLauncher",
"size": "50x50",
"subtype": "44mm",
"scale": "2x",
"idiom": "watch"
},
{
"role": "quickLook",
"size": "86x86",
"subtype": "38mm",
"scale": "2x",
"idiom": "watch"
},
{
"role": "quickLook",
"size": "98x98",
"subtype": "42mm",
"scale": "2x",
"idiom": "watch"
},
{
"role": "quickLook",
"size": "108x108",
"subtype": "44mm",
"scale": "2x",
"idiom": "watch"
},
{
"size": "1024x1024",
"scale": "1x",
"idiom": "watch-marketing"
},
{
"size": "16x16",
"scale": "1x",
"idiom": "mac"
},
{
"size": "16x16",
"scale": "2x",
"idiom": "mac"
},
{
"size": "32x32",
"scale": "1x",
"idiom": "mac"
},
{
"size": "32x32",
"scale": "2x",
"idiom": "mac"
},
{
"size": "128x128",
"scale": "1x",
"idiom": "mac"
},
{
"size": "128x128",
"scale": "2x",
"idiom": "mac"
},
{
"size": "256x256",
"scale": "1x",
"idiom": "mac"
},
{
"size": "256x256",
"scale": "2x",
"idiom": "mac"
},
{
"size": "512x512",
"scale": "1x",
"idiom": "mac"
},
{
"size": "512x512",
"scale": "2x",
"idiom": "mac"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.0 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 8.6 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 22 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.3 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.3 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 900 B

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.8 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.5 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.2 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.3 KiB

Просмотреть файл

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,21 @@
using FontList.Models;
using System;
using UIKit;
namespace FontList
{
public partial class FontDetailsViewController : UIViewController
{
public FontDetailsViewController(IntPtr handle) : base(handle) { }
public FontItem FontItem { get; internal set; }
public override void ViewDidLoad()
{
base.ViewDidLoad();
Title = FontItem.Name;
textView.Font = FontItem.Font;
}
}
}

29
FontList/FontList/FontDetailsViewController.designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,29 @@
// WARNING
//
// This file has been generated automatically by Visual Studio from the outlets and
// actions declared in your storyboard file.
// Manual changes to this file will not be maintained.
//
using Foundation;
using System;
using System.CodeDom.Compiler;
using UIKit;
namespace FontList
{
[Register ("FontDetailsViewController")]
partial class FontDetailsViewController
{
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UIKit.UITextView textView { get; set; }
void ReleaseDesignerOutlets ()
{
if (textView != null) {
textView.Dispose ();
textView = null;
}
}
}
}

Просмотреть файл

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B62DF180-BA8C-4F2D-8D0E-1BA98DDDAF0E}</ProjectGuid>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>FontList</RootNamespace>
<AssemblyName>FontList</AssemblyName>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG;ENABLE_TEST_CLOUD;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
<MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>
<MtouchFastDev>true</MtouchFastDev>
<IOSDebuggerPort>31224</IOSDebuggerPort>
<MtouchLink>None</MtouchLink>
<MtouchArch>x86_64</MtouchArch>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<DeviceSpecificBuild>false</DeviceSpecificBuild>
<MtouchVerbosity></MtouchVerbosity>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<DefineConstants></DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchUseLlvm>true</MtouchUseLlvm>
<MtouchFloat32>true</MtouchFloat32>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchLink>SdkOnly</MtouchLink>
<MtouchArch>ARM64</MtouchArch>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<MtouchVerbosity></MtouchVerbosity>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<DefineConstants></DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>
<MtouchLink>None</MtouchLink>
<MtouchArch>x86_64</MtouchArch>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<MtouchVerbosity></MtouchVerbosity>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG;ENABLE_TEST_CLOUD;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<DeviceSpecificBuild>true</DeviceSpecificBuild>
<MtouchDebug>true</MtouchDebug>
<MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>
<MtouchFastDev>true</MtouchFastDev>
<MtouchFloat32>true</MtouchFloat32>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<IOSDebuggerPort>44420</IOSDebuggerPort>
<MtouchLink>SdkOnly</MtouchLink>
<MtouchArch>ARM64</MtouchArch>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<MtouchVerbosity></MtouchVerbosity>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json" />
<ImageAsset Include="Assets.xcassets\Contents.json" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\app-store-logo.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon-app-83.5%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\icon-app-76%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\icon-app-76.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\icon-spotlight-29%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\icon-spotlight-29.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon-app-60%403x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\icon-app-60%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\icon-spotlight-29%403x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\icon-spotlight-40%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\icon-spotlight-40%403x.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="Models\" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="LaunchScreen.storyboard" />
<InterfaceDefinition Include="Main.storyboard" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
<None Include="Entitlements.plist" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<Compile Include="FontsViewController.cs" />
<Compile Include="FontsViewController.designer.cs">
<DependentUpon>FontsViewController.cs</DependentUpon>
</Compile>
<Compile Include="FontDetailsViewController.cs" />
<Compile Include="FontDetailsViewController.designer.cs">
<DependentUpon>FontDetailsViewController.cs</DependentUpon>
</Compile>
<Compile Include="Models\FontItem.cs" />
<Compile Include="Models\FontFamilyItem.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
</Project>

Просмотреть файл

@ -0,0 +1,100 @@
using FontList.Models;
using Foundation;
using System;
using System.Collections.Generic;
using System.Linq;
using UIKit;
namespace FontList
{
public partial class FontsViewController : UITableViewController
{
private const string CellIdentifier = "FontCellView";
private const string FontDetailsSegueIdentifier = "fontDetailsSegue";
private readonly List<FontFamilyItem> items = new List<FontFamilyItem>();
private FontItem selectedItem;
public FontsViewController(IntPtr handle) : base(handle) { }
public override void ViewDidLoad()
{
base.ViewDidLoad();
foreach (var fontFamily in UIFont.FamilyNames)
{
// create a nav group
var group = new FontFamilyItem(fontFamily);
var fontNames = UIFont.FontNamesForFamilyName(fontFamily);
if (fontNames.Any())
{
foreach (var fontName in fontNames)
{
var font = UIFont.FromName(fontName, UIFont.LabelFontSize);
if (font != null)
{
group.Items.Add(new FontItem { Name = fontName, Font = font });
}
}
}
else
{
var font = UIFont.FromName(fontFamily, UIFont.LabelFontSize);
group.Items.Add(new FontItem { Name = fontFamily, Font = font });
}
items.Add(group);
}
}
public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender)
{
if (!string.IsNullOrEmpty(segue?.Identifier) && segue.Identifier == FontDetailsSegueIdentifier)
{
if (segue.DestinationViewController is FontDetailsViewController controller)
{
controller.FontItem = selectedItem;
selectedItem = null;
}
}
}
#region table delegate
public override nint NumberOfSections(UITableView tableView)
{
return items.Count;
}
public override nint RowsInSection(UITableView tableView, nint section)
{
return items[(int)section].Items.Count;
}
public override string TitleForHeader(UITableView tableView, nint section)
{
return items[(int)section].Name;
}
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
{
var item = items[indexPath.Section].Items[indexPath.Row];
var cell = tableView.DequeueReusableCell(CellIdentifier);
cell.TextLabel.Text = item.Name;
cell.TextLabel.Font = item.Font;
return cell;
}
public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
{
selectedItem = items[indexPath.Section].Items[indexPath.Row];
PerformSegue(FontDetailsSegueIdentifier, this);
}
#endregion
}
}

21
FontList/FontList/FontsViewController.designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,21 @@
// WARNING
//
// This file has been generated automatically by Visual Studio from the outlets and
// actions declared in your storyboard file.
// Manual changes to this file will not be maintained.
//
using Foundation;
using System;
using System.CodeDom.Compiler;
using UIKit;
namespace FontList
{
[Register ("FontsViewController")]
partial class FontsViewController
{
void ReleaseDesignerOutlets ()
{
}
}
}

Просмотреть файл

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>Font List</string>
<key>CFBundleIdentifier</key>
<string>com.xamarin.font-list</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MinimumOSVersion</key>
<string>9.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Xamarin" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NNP-o5-iHj">
<rect key="frame" x="117" y="320" width="142" height="48"/>
<fontDescription key="fontDescription" type="system" pointSize="40"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="NNP-o5-iHj" firstAttribute="centerX" secondItem="7kK-Dt-qxf" secondAttribute="centerX" id="EPM-yx-nbg"/>
<constraint firstItem="NNP-o5-iHj" firstAttribute="centerY" secondItem="7kK-Dt-qxf" secondAttribute="centerY" id="Y4V-br-DBp"/>
</constraints>
<viewLayoutGuide key="safeArea" id="7kK-Dt-qxf"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>

15
FontList/FontList/Main.cs Normal file
Просмотреть файл

@ -0,0 +1,15 @@
using UIKit;
namespace FontList
{
public class Application
{
// This is the main entry point of the application.
static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, "AppDelegate");
}
}
}

Просмотреть файл

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="nhE-oa-Wsc">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Fonts-->
<scene sceneID="3cb-l6-cJ6">
<objects>
<tableViewController id="N7F-HJ-C2m" customClass="FontsViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="56" sectionFooterHeight="56" id="qoX-LM-Rxc">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="FontCellView" textLabel="B6p-LY-dki" style="IBUITableViewCellStyleDefault" id="s8g-Tp-bL1">
<rect key="frame" x="0.0" y="56" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="s8g-Tp-bL1" id="lwt-Oo-nvt">
<rect key="frame" x="0.0" y="0.0" width="341" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="B6p-LY-dki">
<rect key="frame" x="16" y="0.0" width="324" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="N7F-HJ-C2m" id="o3a-Fd-F4X"/>
<outlet property="delegate" destination="N7F-HJ-C2m" id="rKF-NZ-Ozr"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Fonts" id="1Ev-W4-z1K"/>
<connections>
<segue destination="BuX-Kq-TfW" kind="show" identifier="fontDetailsSegue" id="XdS-os-Y7g"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="cQa-BY-Suk" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1292" y="-10.34483"/>
</scene>
<!--Font Details View Controller-->
<scene sceneID="og1-pz-XVE">
<objects>
<viewController id="BuX-Kq-TfW" customClass="FontDetailsViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="uUS-CM-aE1">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="6s9-8i-zDb">
<rect key="frame" x="16" y="72" width="343" height="579"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="C8n-OG-hb5" firstAttribute="trailing" secondItem="6s9-8i-zDb" secondAttribute="trailing" constant="16" id="1VV-k2-Bly"/>
<constraint firstItem="6s9-8i-zDb" firstAttribute="top" secondItem="C8n-OG-hb5" secondAttribute="top" constant="8" id="GAH-ij-obx"/>
<constraint firstItem="C8n-OG-hb5" firstAttribute="bottom" secondItem="6s9-8i-zDb" secondAttribute="bottom" constant="16" id="YeQ-hB-egP"/>
<constraint firstItem="6s9-8i-zDb" firstAttribute="leading" secondItem="C8n-OG-hb5" secondAttribute="leading" constant="16" id="ssg-2k-N1R"/>
</constraints>
<viewLayoutGuide key="safeArea" id="C8n-OG-hb5"/>
</view>
<connections>
<outlet property="textView" destination="6s9-8i-zDb" id="name-outlet-6s9-8i-zDb"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="mwJ-8H-w87" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2080.8000000000002" y="-11.244377811094454"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="9pB-BU-g0R">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="nhE-oa-Wsc" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="WhA-9g-3Ht">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="N7F-HJ-C2m" kind="relationship" relationship="rootViewController" id="Ic3-AY-pTZ"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="7xC-rk-zRk" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="352.80000000000001" y="-10.34483"/>
</scene>
</scenes>
</document>

Просмотреть файл

@ -0,0 +1,24 @@
using System.Collections.Generic;
namespace FontList.Models
{
/// <summary>
/// A group that contains table items
/// </summary>
public class FontFamilyItem
{
public string Name { get; set; }
public List<FontItem> Items { get; set; }
public FontFamilyItem()
{
Items = new List<FontItem>();
}
public FontFamilyItem(string name) : this()
{
Name = name;
}
}
}

Просмотреть файл

@ -0,0 +1,17 @@
using UIKit;
namespace FontList.Models
{
public class FontItem
{
/// <summary>
/// The name of the nav item, shows up as the label
/// </summary>
public string Name { get; set; }
/// <summary>
/// The font used to display the item.
/// </summary>
public UIFont Font { get; set; }
}
}

Просмотреть файл

@ -1,43 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>FontExample</string>
<key>CFBundleIconFiles</key>
<array>
<string>Resources/icon-57.png</string>
<string>Resources/icon-114.png</string>
<string>Resources/icon-72.png</string>
<string>Resources/icon-144.png</string>
<string>Resources/icon-29.png</string>
<string>Resources/icon-58.png</string>
<string>Resources/icon-50.png</string>
<string>Resources/icon-100.png</string>
</array>
<key>CFBundleIdentifier</key>
<string>com.xamarin.samples.fontlist</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

Просмотреть файл

@ -3,6 +3,12 @@ Font Example
Lists the fonts available on the device and shows a preview of each font.
![Main Screen](Screenshots/screenshot-1.png)
License
-------
Code is released under the MIT license
Authors
-------

Двоичные данные
FontList/Resources/1024_icon.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.1 MiB

Двоичные данные
FontList/Resources/Default-568h@2x.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 12 KiB

Двоичные данные
FontList/Resources/Default-Landscape@2x~ipad.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 24 KiB

Двоичные данные
FontList/Resources/Default-Landscape~ipad.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 9.4 KiB

Двоичные данные
FontList/Resources/Default-Portrait@2x~ipad.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 25 KiB

Двоичные данные
FontList/Resources/Default-Portrait~ipad.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 9.8 KiB

Двоичные данные
FontList/Resources/Default.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 5.2 KiB

Двоичные данные
FontList/Resources/Default@2x.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 12 KiB

Двоичные данные
FontList/Resources/iTunesArtwork.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 106 KiB

Двоичные данные
FontList/Resources/iTunesArtwork@2x.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 273 KiB

Двоичные данные
FontList/Resources/icon-100.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 11 KiB

Двоичные данные
FontList/Resources/icon-114.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 14 KiB

Двоичные данные
FontList/Resources/icon-144.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 18 KiB

Двоичные данные
FontList/Resources/icon-29.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Двоичные данные
FontList/Resources/icon-50.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 4.2 KiB

Двоичные данные
FontList/Resources/icon-57.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 5.1 KiB

Двоичные данные
FontList/Resources/icon-58.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 5.2 KiB

Двоичные данные
FontList/Resources/icon-72.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 6.6 KiB

Просмотреть файл

@ -1,67 +0,0 @@
using System;
using UIKit;
using FontList.Code;
using System.Collections.Generic;
namespace FontList.Screens.Universal.FontListing
{
public class FontFamiliesTableViewController : UITableViewController
{
// declare vars
List<NavItemGroup> navItems = new List<NavItemGroup>();
NavItemTableSource tableSource;
public FontFamiliesTableViewController () : base(UITableViewStyle.Grouped)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
Title = "Fonts";
// declare vars
NavItemGroup navGroup;
string fontName;
UIFont font;
NavItem navItem;
Type controller;
for (int i = 0; i < UIFont.FamilyNames.Length; i++)
{
// create a nav group
navGroup = new NavItemGroup (UIFont.FamilyNames[i]);
navItems.Add (navGroup);
// loop through each font name in the family
for (int j = 0; j < UIFont.FontNamesForFamilyName (UIFont.FamilyNames[i]).Length; j++)
{
// add an item of that font
fontName = UIFont.FontNamesForFamilyName (UIFont.FamilyNames[i])[j];
font = UIFont.FromName (fontName, UIFont.SystemFontSize);
if((UIApplication.SharedApplication.Delegate as AppDelegate).CurrentDevice == DeviceType.iPad) {
controller = typeof(Screens.iPad.FontViewer.FontViewerScreen_iPad);
} else {
controller = typeof(Screens.iPhone.FontViewer.FontViewerScreen_iPhone);
}
navItem = new NavItem (fontName, "", controller, new object[] { font });
navItem.Font = font;
navGroup.Items.Add (navItem);
}
}
// create a table source from our nav items
tableSource = new NavItemTableSource (NavigationController, navItems);
// set the source on the table to our data source
base.TableView.Source = tableSource;
}
public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
{
return true;
}
}
}

Просмотреть файл

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="12121" systemVersion="16F73" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" colorMatched="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="FontViewerScreen_iPad">
<connections>
<outlet property="txtMain" destination="8" id="9"/>
<outlet property="view" destination="1" id="7"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="1">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" id="8">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<metadata/>
</view>
</objects>
</document>

Просмотреть файл

@ -1,58 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
namespace FontList.Screens.iPad.FontViewer
{
public partial class FontViewerScreen_iPad : UIViewController
{
UIFont displayFont;
#region Constructors
// The IntPtr and initWithCoder constructors are required for controllers that need
// to be able to be created from a xib rather than from managed code
public FontViewerScreen_iPad (IntPtr handle) : base(handle)
{
Initialize ();
}
[Export("initWithCoder:")]
public FontViewerScreen_iPad (NSCoder coder) : base(coder)
{
Initialize ();
}
public FontViewerScreen_iPad (UIFont font) : base("FontViewerScreen_iPad", null)
{
Initialize ();
displayFont = font;
}
void Initialize ()
{
}
#endregion
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
Title = displayFont.Name;
txtMain.Editable = true;
txtMain.Font = displayFont;
txtMain.Editable = false;
}
public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
{
return true;
}
}
}

Просмотреть файл

@ -1,46 +0,0 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
namespace FontList.Screens.iPad.FontViewer {
// Base type probably should be MonoTouch.UIKit.UIViewController or subclass
[Foundation.Register("FontViewerScreen_iPad")]
public partial class FontViewerScreen_iPad {
private UIKit.UIView __mt_view;
private UIKit.UITextView __mt_txtMain;
#pragma warning disable 0169
[Foundation.Connect("view")]
private UIKit.UIView view {
get {
this.__mt_view = ((UIKit.UIView)(this.GetNativeField("view")));
return this.__mt_view;
}
set {
this.__mt_view = value;
this.SetNativeField("view", value);
}
}
[Foundation.Connect("txtMain")]
private UIKit.UITextView txtMain {
get {
this.__mt_txtMain = ((UIKit.UITextView)(this.GetNativeField("txtMain")));
return this.__mt_txtMain;
}
set {
this.__mt_txtMain = value;
this.SetNativeField("txtMain", value);
}
}
}
}

Просмотреть файл

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12121" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" colorMatched="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="FontViewerScreen_iPhone">
<connections>
<outlet property="txtMain" destination="12" id="13"/>
<outlet property="view" destination="1" id="7"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="1">
<rect key="frame" x="0.0" y="0.0" width="320" height="416"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" id="12">
<rect key="frame" x="0.0" y="0.0" width="320" height="416"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
</objects>
</document>

Просмотреть файл

@ -1,58 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
namespace FontList.Screens.iPhone.FontViewer
{
public partial class FontViewerScreen_iPhone : UIViewController
{
UIFont displayFont;
#region Constructors
// The IntPtr and initWithCoder constructors are required for items that need
// to be able to be created from a xib rather than from managed code
public FontViewerScreen_iPhone (IntPtr handle) : base(handle)
{
Initialize ();
}
[Export("initWithCoder:")]
public FontViewerScreen_iPhone (NSCoder coder) : base(coder)
{
Initialize ();
}
public FontViewerScreen_iPhone (UIFont font) : base("FontViewerScreen_iPhone", null)
{
Initialize ();
displayFont = font;
}
void Initialize ()
{
}
#endregion
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
Title = displayFont.Name;
txtMain.Editable = true;
txtMain.Font = displayFont;
txtMain.Editable = false;
}
public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
{
return true;
}
}
}

Просмотреть файл

@ -1,46 +0,0 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
namespace FontList.Screens.iPhone.FontViewer {
// Base type probably should be MonoTouch.UIKit.UIViewController or subclass
[Foundation.Register("FontViewerScreen_iPhone")]
public partial class FontViewerScreen_iPhone {
private UIKit.UIView __mt_view;
private UIKit.UITextView __mt_txtMain;
#pragma warning disable 0169
[Foundation.Connect("view")]
private UIKit.UIView view {
get {
this.__mt_view = ((UIKit.UIView)(this.GetNativeField("view")));
return this.__mt_view;
}
set {
this.__mt_view = value;
this.SetNativeField("view", value);
}
}
[Foundation.Connect("txtMain")]
private UIKit.UITextView txtMain {
get {
this.__mt_txtMain = ((UIKit.UITextView)(this.GetNativeField("txtMain")));
return this.__mt_txtMain;
}
set {
this.__mt_txtMain = value;
this.SetNativeField("txtMain", value);
}
}
}
}

Двоичные данные
FontList/Screenshots/01-list.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 110 KiB

Двоичные данные
FontList/Screenshots/02-fontdetail.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 118 KiB

Двоичные данные
FontList/Screenshots/03-listipad.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 97 KiB

Двоичные данные
FontList/Screenshots/04-fontdetailipad.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 198 KiB

Двоичные данные
FontList/Screenshots/screenshot-1.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 45 KiB

Двоичные данные
FontList/Screenshots/screenshot-2.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 46 KiB