Skip to content

Commit

Permalink
demo updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Apr 27, 2020
1 parent 959620f commit f28c94e
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?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>
Expand All @@ -16,7 +16,6 @@
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>true</AndroidUseAapt2>
Expand Down
14 changes: 4 additions & 10 deletions sample/SampleFonts/SampleFonts.iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;

using Foundation;
using Foundation;
using UIKit;

namespace SampleFonts.iOS
{
// 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
// 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 partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//
// This method is invoked when the application has loaded and is ready to run. In this
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
Expand Down
2 changes: 1 addition & 1 deletion sample/SampleFonts/SampleFonts.iOS/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "namespace", Target = "~N:SampleFonts.iOS")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "iOS is the correct capitalization", Scope = "namespace", Target = "~N:SampleFonts.iOS")]
7 changes: 1 addition & 6 deletions sample/SampleFonts/SampleFonts.iOS/Main.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;

using Foundation;
using UIKit;
using UIKit;

namespace SampleFonts.iOS
{
Expand Down
3 changes: 2 additions & 1 deletion sample/SampleFonts/SampleFonts.iOS/SampleFonts.iOS.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -68,6 +68,7 @@
<None Include="Entitlements.plist" />
<None Include="Info.plist" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="GlobalSuppressions.cs" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
Expand Down
57 changes: 51 additions & 6 deletions sample/SampleFonts/SampleFonts/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
</ContentPage.ToolbarItems>
<ScrollView>
<StackLayout Padding="{OnPlatform Default=20, iOS='20,40'}">
<Image Source="{FontImage Glyph={ap:Icon 'far fa-check-circle'}, Color=Blue, Size=60}" />
<Image>
<Image.Source>
<FontImageSource Glyph="{x:Static ap:FontAwesomeRegular.Eye}"
FontFamily="fa-regular-400.ttf"
Size="60"
Color="Red" />
</Image.Source>
</Image>
<Label Text="Labels" />
<Grid>
<Grid.ColumnDefinitions>
Expand All @@ -33,13 +42,42 @@
Grid.Row="2"
Grid.Column="1" />
</Grid>
<Label Text="Spans" />
<Label>
<Label.FormattedText>
<FormattedString>
<ap:IconSpan GlyphName="far fa-user" />
<Span Text=" Font Awesome Regular - User" />
</FormattedString>
</Label.FormattedText>
</Label>
<Label>
<Label.FormattedText>
<FormattedString>
<ap:IconSpan GlyphName="fas fa-user" />
<Span Text=" Font Awesome Solid - User" />
</FormattedString>
</Label.FormattedText>
</Label>
<Label>
<Label.FormattedText>
<FormattedString>
<ap:IconSpan GlyphName="fab fa-github" />
<Span Text=" Font Awesome Brands - GitHub" />
</FormattedString>
</Label.FormattedText>
</Label>

<Label Text="Buttons" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<Button Text="{x:Static ap:FontAwesomeRegular.AddressBook}"
FontFamily="fa-regular-400.ttf"
Grid.Row="3"/>
<Button Text="{ap:Icon 'far fa-user'}" />
<Label Text="Font Awesome Regular - User"
Grid.Column="1" />
Expand Down Expand Up @@ -71,28 +109,34 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<Image>
<Image HeightRequest="40"
Aspect="AspectFit">
<Image.Source>
<ap:IconImageSource Name="far fa-dashboard"
<ap:IconImageSource Name="far fa-user"
Size="40"
Color="Black" />
</Image.Source>
</Image>
<Label Text="Font Awesome Regular - User"
Grid.Column="1" />

<Image Grid.Row="1">
<Image HeightRequest="40"
Aspect="AspectFit"
BackgroundColor="Gray"
Grid.Row="1">
<Image.Source>
<ap:IconImageSource Name="fas fa-user"
Size="40"
Color="Black" />
Color="White" />
</Image.Source>
</Image>
<Label Text="Font Awesome Solid - User"
Grid.Row="1"
Grid.Column="1" />

<Image Grid.Row="1">
<Image HeightRequest="40"
Aspect="AspectFit"
Grid.Row="1">
<Image.Source>
<ap:IconImageSource Name="fab fa-github"
Size="40"
Expand All @@ -114,7 +158,8 @@
<Label Text="Font Awesome Regular - User"
Grid.Column="1" />

<Image Source="{ap:IconImageSource 'fas fa-user', Size=40, Color=Black}"
<Image Source="{ap:IconImageSource 'fas fa-user', Size=40, Color=White}"
BackgroundColor="Gray"
Grid.Row="1" />
<Label Text="Font Awesome Solid - User"
Grid.Row="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using AP.MobileToolkit.Controls;
using Xamarin.Forms;

[assembly: ExportImageSourceHandler(typeof(IconImageSource), typeof(AP.MobileToolkit.Platform.IconImageSourceHandler))]
namespace AP.MobileToolkit.Platform
{
internal static class FontExtensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading;
using System.Threading.Tasks;
using Android.Content;
using Android.Graphics;
Expand All @@ -12,10 +7,8 @@
using AP.MobileToolkit.Fonts;
using AP.MobileToolkit.Platform;
using Xamarin.Forms;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Platform.Android;
using Color = Xamarin.Forms.Color;
using Path = System.IO.Path;

[assembly: ExportImageSourceHandler(typeof(IconImageSource), typeof(IconImageSourceHandler))]
namespace AP.MobileToolkit.Platform
Expand Down
1 change: 0 additions & 1 deletion src/AP.MobileToolkit.Fonts/Platform/iOS/FontExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Xamarin.Forms.Core;
using Xamarin.Forms.Internals;

[assembly: ExportImageSourceHandler(typeof(IconImageSource), typeof(AP.MobileToolkit.Platform.IconImageSourceHandler))]
namespace AP.MobileToolkit.Platform
{
internal static class FontExtensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
[assembly: ExportImageSourceHandler(typeof(IconImageSource), typeof(AP.MobileToolkit.Platform.IconImageSourceHandler))]
namespace AP.MobileToolkit.Platform
{
internal class IconImageSourceHandler : IImageSourceHandler
public class IconImageSourceHandler : IImageSourceHandler
{
// should this be the default color on the BP for iOS?
readonly Color _defaultColor = UIColor.LabelColor.ToColor();
Expand Down

0 comments on commit f28c94e

Please sign in to comment.