├── images
├── phoneshot.jpg
├── propexample.jpg
├── XFGlossIcon512.png
├── XFGlossIcon64.png
├── XFGlossIcon1024.png
├── prop_tint_color.jpg
├── prop_accessory_type.jpg
├── prop_on_tint_color.jpg
├── prop_background_color.jpg
├── prop_thumb_tint_color.jpg
├── prop_background_gradient.jpg
├── prop_thumb_on_tint_color.jpg
├── prop_max_track_tint_color.jpg
├── prop_min_track_tint_color.jpg
└── android_api16_switchcompatcell.jpg
├── src
├── XFGlossSample.iOS
│ ├── Assets.xcassets
│ │ └── Contents.json
│ ├── Resources
│ │ ├── csharp.png
│ │ ├── xfgloss.png
│ │ ├── csharp@2x.png
│ │ ├── csharp@3x.png
│ │ ├── settings.png
│ │ ├── xamlcode.png
│ │ ├── infocircle.png
│ │ ├── settings@2x.png
│ │ ├── xamlcode@2x.png
│ │ ├── xamlcode@3x.png
│ │ ├── xfgloss@2x.png
│ │ ├── infocircle@2x.png
│ │ ├── infocircle@3x.png
│ │ └── Media.xcassets
│ │ │ └── AppIcon.appiconset
│ │ │ ├── Icon-120.png
│ │ │ ├── Icon-152.png
│ │ │ ├── Icon-167.png
│ │ │ ├── Icon-180.png
│ │ │ ├── Icon-20.png
│ │ │ ├── Icon-29.png
│ │ │ ├── Icon-40.png
│ │ │ ├── Icon-58.png
│ │ │ ├── Icon-60.png
│ │ │ ├── Icon-76.png
│ │ │ ├── Icon-80.png
│ │ │ ├── Icon-87.png
│ │ │ ├── Icon-1024.png
│ │ │ └── Contents.json
│ ├── Entitlements.plist
│ ├── packages.config
│ ├── Main.cs
│ ├── AppDelegate.cs
│ ├── LaunchScreen.storyboard
│ └── Info.plist
├── XFGlossSample.Droid
│ ├── Resources
│ │ ├── drawable
│ │ │ ├── csharp.png
│ │ │ ├── icon.png
│ │ │ ├── settings.png
│ │ │ ├── xamlcode.png
│ │ │ ├── xfgloss.png
│ │ │ └── infocircle.png
│ │ ├── drawable-hdpi
│ │ │ ├── csharp.png
│ │ │ ├── icon.png
│ │ │ ├── xamlcode.png
│ │ │ └── infocircle.png
│ │ ├── drawable-xhdpi
│ │ │ ├── icon.png
│ │ │ ├── csharp.png
│ │ │ ├── infocircle.png
│ │ │ └── xamlcode.png
│ │ ├── drawable-xxhdpi
│ │ │ ├── icon.png
│ │ │ ├── csharp.png
│ │ │ ├── xamlcode.png
│ │ │ └── infocircle.png
│ │ ├── layout
│ │ │ ├── Toolbar.axml
│ │ │ └── Tabbar.axml
│ │ ├── values
│ │ │ └── styles.xml
│ │ └── AboutResources.txt
│ ├── Properties
│ │ ├── AndroidManifest.xml
│ │ └── AssemblyInfo.cs
│ ├── Assets
│ │ └── AboutAssets.txt
│ ├── packages.config
│ └── MainActivity.cs
├── XFGloss
│ ├── Platforms
│ │ ├── Android
│ │ │ ├── Resources
│ │ │ │ ├── values
│ │ │ │ │ └── Strings.xml
│ │ │ │ └── AboutResources.txt
│ │ │ ├── Extensions
│ │ │ │ └── XFGlossGradientExtensions.cs
│ │ │ └── Renderers
│ │ │ │ └── XFGlossSwitchRenderer.cs
│ │ └── iOS
│ │ │ ├── XFGlossInit.cs
│ │ │ ├── Renderers
│ │ │ ├── XFGlossSwitchRenderer.cs
│ │ │ └── XFGlossSliderRenderer.cs
│ │ │ └── Extensions
│ │ │ └── XFGlossUISwitchExtensions.cs
│ ├── Shared
│ │ ├── Attributes
│ │ │ └── PreserveAttribute.cs
│ │ ├── Models
│ │ │ ├── CellGlossAccessoryType.cs
│ │ │ └── ObservableObject.cs
│ │ ├── Interfaces
│ │ │ ├── IGradientRenderer.cs
│ │ │ ├── ISwitchGloss.cs
│ │ │ └── IXFGlossRenderer.cs
│ │ ├── Events
│ │ │ └── EventUtilities.cs
│ │ └── Gloss
│ │ │ └── ContentPageGloss.cs
│ └── XFGloss.csproj
├── XFGlossSample
│ ├── App.xaml
│ ├── XFGlossSample.csproj
│ ├── Utils
│ │ └── XFGlossDevices.cs
│ ├── Examples
│ │ ├── Views
│ │ │ ├── InfoPage.xaml
│ │ │ ├── Xaml
│ │ │ │ ├── MinTrackTintColorPage.xaml
│ │ │ │ ├── MaxTrackTintColorPage.xaml
│ │ │ │ ├── TintColorPage.xaml.cs
│ │ │ │ ├── OnTintColorPage.xaml.cs
│ │ │ │ ├── AccessoryTypePage.xaml.cs
│ │ │ │ ├── MinTrackTintColorPage.xaml.cs
│ │ │ │ ├── BackgroundColorPage.xaml.cs
│ │ │ │ ├── ThumbTintColorPage.xaml.cs
│ │ │ │ ├── MaxTrackTintColorPage.xaml.cs
│ │ │ │ ├── ThumbOnTintColorPage.xaml.cs
│ │ │ │ ├── AccessoryTypePage.xaml
│ │ │ │ ├── BackgroundGradientPage.xaml.cs
│ │ │ │ ├── BackgroundColorPage.xaml
│ │ │ │ ├── OnTintColorPage.xaml
│ │ │ │ ├── ThumbOnTintColorPage.xaml
│ │ │ │ ├── ThumbTintColorPage.xaml
│ │ │ │ ├── TintColorPage.xaml
│ │ │ │ └── BackgroundGradientPage.xaml
│ │ │ ├── InfoPage.xaml.cs
│ │ │ ├── CSharp
│ │ │ │ ├── MaxTrackTintColorPage.cs
│ │ │ │ ├── MinTrackTintColorPage.cs
│ │ │ │ ├── BackgroundColorPage.cs
│ │ │ │ ├── AccessoryTypePage.cs
│ │ │ │ ├── OnTintColorPage.cs
│ │ │ │ ├── ThumbOnTintColorPage.cs
│ │ │ │ ├── ThumbTintColorPage.cs
│ │ │ │ ├── TintColorPage.cs
│ │ │ │ └── BackgroundGradientPage.cs
│ │ │ └── XFGlossSampleViewFactory.cs
│ │ └── ViewModels
│ │ │ ├── IExamplesViewModel.cs
│ │ │ ├── BackgroundColorViewModel.cs
│ │ │ ├── OnTintColorViewModel.cs
│ │ │ ├── ThumbOnTintColorViewModel.cs
│ │ │ ├── ThumbTintColorViewModel.cs
│ │ │ ├── MinTrackTintColorViewModel.cs
│ │ │ ├── MaxTrackTintColorViewModel.cs
│ │ │ ├── BackgroundGradientViewModel.cs
│ │ │ ├── AccessoryTypeViewModel.cs
│ │ │ └── TintColorViewModel.cs
│ ├── PerfTests
│ │ ├── Views
│ │ │ ├── IPerfTestPage.cs
│ │ │ ├── RecycleBackgroundColorPage.xaml.cs
│ │ │ ├── RetainBackgroundGradientPage.xaml.cs
│ │ │ ├── RetainBackgroundColorPage.xaml.cs
│ │ │ ├── RecycleBackgroundGradientPage.xaml.cs
│ │ │ ├── RetainBackgroundColorPage.xaml
│ │ │ ├── RecycleBackgroundColorPage.xaml
│ │ │ ├── RetainBackgroundGradientPage.xaml
│ │ │ └── RecycleBackgroundGradientPage.xaml
│ │ └── ViewModels
│ │ │ └── PerfTestViewModel.cs
│ ├── Views
│ │ ├── AboutPage.xaml.cs
│ │ ├── AboutPage.xaml
│ │ ├── AppMenu.xaml
│ │ └── AppMenu.xaml.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── App.xaml.cs
│ └── ViewModels
│ │ └── AppMenuViewModel.cs
├── XFGlossSample.Shared
│ ├── XFGlossSample.Shared.projitems
│ ├── XFGlossSample.Shared.shproj
│ └── AssemblyInfoGlobal.cs
├── XFGloss.sln
└── XFGlossSample.sln
├── .gitignore
└── LICENSE.MD
/images/phoneshot.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/images/phoneshot.jpg
--------------------------------------------------------------------------------
/images/propexample.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/images/propexample.jpg
--------------------------------------------------------------------------------
/images/XFGlossIcon512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/images/XFGlossIcon512.png
--------------------------------------------------------------------------------
/images/XFGlossIcon64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/images/XFGlossIcon64.png
--------------------------------------------------------------------------------
/images/XFGlossIcon1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/images/XFGlossIcon1024.png
--------------------------------------------------------------------------------
/images/prop_tint_color.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/images/prop_tint_color.jpg
--------------------------------------------------------------------------------
/images/prop_accessory_type.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/images/prop_accessory_type.jpg
--------------------------------------------------------------------------------
/images/prop_on_tint_color.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/images/prop_on_tint_color.jpg
--------------------------------------------------------------------------------
/images/prop_background_color.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/images/prop_background_color.jpg
--------------------------------------------------------------------------------
/images/prop_thumb_tint_color.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/images/prop_thumb_tint_color.jpg
--------------------------------------------------------------------------------
/images/prop_background_gradient.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/images/prop_background_gradient.jpg
--------------------------------------------------------------------------------
/images/prop_thumb_on_tint_color.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/images/prop_thumb_on_tint_color.jpg
--------------------------------------------------------------------------------
/images/prop_max_track_tint_color.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/images/prop_max_track_tint_color.jpg
--------------------------------------------------------------------------------
/images/prop_min_track_tint_color.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/images/prop_min_track_tint_color.jpg
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/images/android_api16_switchcompatcell.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/images/android_api16_switchcompatcell.jpg
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/csharp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/csharp.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/xfgloss.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/xfgloss.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/csharp@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/csharp@2x.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/csharp@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/csharp@3x.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/settings.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/xamlcode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/xamlcode.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/infocircle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/infocircle.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/settings@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/settings@2x.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/xamlcode@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/xamlcode@2x.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/xamlcode@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/xamlcode@3x.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/xfgloss@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/xfgloss@2x.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/infocircle@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/infocircle@2x.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/infocircle@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/infocircle@3x.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable/csharp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable/csharp.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable/icon.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable/settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable/settings.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable/xamlcode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable/xamlcode.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable/xfgloss.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable/xfgloss.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable-hdpi/csharp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable-hdpi/csharp.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable/infocircle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable/infocircle.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable-hdpi/xamlcode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable-hdpi/xamlcode.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable-xhdpi/csharp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable-xhdpi/csharp.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable-xxhdpi/csharp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable-xxhdpi/csharp.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable-hdpi/infocircle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable-hdpi/infocircle.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable-xhdpi/infocircle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable-xhdpi/infocircle.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable-xhdpi/xamlcode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable-xhdpi/xamlcode.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable-xxhdpi/xamlcode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable-xxhdpi/xamlcode.png
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/drawable-xxhdpi/infocircle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.Droid/Resources/drawable-xxhdpi/infocircle.png
--------------------------------------------------------------------------------
/src/XFGloss/Platforms/Android/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | XFGloss.Droid
4 |
5 |
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-120.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-152.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-167.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-180.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-20.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-29.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-40.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-58.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-60.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-76.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-80.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-87.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbaggett/xfgloss/HEAD/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Icon-1024.png
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/XFGlossSample/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/layout/Toolbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/layout/Tabbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/XFGlossSample/XFGlossSample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | false
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Utils/XFGlossDevices.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Forms;
2 |
3 | namespace XFGlossSample.Utils
4 | {
5 | public static class XFGlossDevices
6 | {
7 | public static T OnPlatform(T iOS, T android)
8 | {
9 | if (Device.RuntimePlatform == Device.iOS)
10 | {
11 | return iOS;
12 | }
13 | else if (Device.RuntimePlatform == Device.Android)
14 | {
15 | return android;
16 | }
17 |
18 | return default(T);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #Autosave files
2 | *~
3 |
4 | #build
5 | [Oo]bj/
6 | [Bb]in/
7 | src/packages/
8 | src/.vs/*
9 | TestResults/
10 |
11 | # globs
12 | Makefile.in
13 | *.DS_Store
14 | *.sln.cache
15 | *.suo
16 | *.cache
17 | *.pidb
18 | *.userprefs
19 | *.usertasks
20 | config.log
21 | config.make
22 | config.status
23 | aclocal.m4
24 | install-sh
25 | autom4te.cache/
26 | *.user
27 | *.tar.gz
28 | tarballs/
29 | test-results/
30 | Thumbs.db
31 |
32 | #Mac bundle stuff
33 | *.dmg
34 | *.app
35 |
36 | #resharper
37 | *_Resharper.*
38 | *.Resharper
39 |
40 | #dotCover
41 | *.dotCover
42 |
--------------------------------------------------------------------------------
/src/XFGlossSample.Shared/XFGlossSample.Shared.projitems:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 | true
6 | 463e2613-f6da-4823-bdeb-66f9b7c0b2ae
7 |
8 |
9 | XFGlossSample.Shared
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with your package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/InfoPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/Xaml/MinTrackTintColorPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/Xaml/MaxTrackTintColorPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/XFGlossSample/PerfTests/Views/IPerfTestPage.cs:
--------------------------------------------------------------------------------
1 | // /*
2 | // * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | // * http://github.com/tbaggett
4 | // * http://twitter.com/tbaggett
5 | // * http://tommyb.com
6 | // * http://ansuria.com
7 | // *
8 | // * The MIT License (MIT) see GitHub For more information
9 | // *
10 | // * Unless required by applicable law or agreed to in writing, software
11 | // * distributed under the License is distributed on an "AS IS" BASIS,
12 | // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // * See the License for the specific language governing permissions and
14 | // * limitations under the License.
15 | // */
16 | //
17 | using System;
18 | using Xamarin.Forms;
19 |
20 | namespace XFGlossSample.PerfTests.Views
21 | {
22 | // Marker interface to identify perf test pages
23 | public interface IPerfTestPage
24 | {
25 | }
26 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Views/AboutPage.xaml.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using System.Collections.Generic;
19 |
20 | using Xamarin.Forms;
21 |
22 | namespace XFGlossSample.Views
23 | {
24 | public partial class AboutPage : ContentPage
25 | {
26 | public AboutPage()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System.Reflection;
18 |
19 | // Information about this assembly is defined by the following attributes.
20 | // Change them to the values specific to your project.
21 |
22 | [assembly: AssemblyTitle("XFGlossSample")]
23 | [assembly: AssemblyProduct("XFGlossSample")]
24 |
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System.Reflection;
18 |
19 | // Information about this assembly is defined by the following attributes.
20 | // Change them to the values specific to your project.
21 |
22 | [assembly: AssemblyTitle("XFGlossSample.Droid")]
23 | [assembly: AssemblyProduct("XFGlossSample.Droid")]
24 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/Xaml/TintColorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using System.Collections.Generic;
19 |
20 | using Xamarin.Forms;
21 |
22 | namespace XFGlossSample.Examples.Views.Xaml
23 | {
24 | public partial class TintColorPage : ContentPage
25 | {
26 | public TintColorPage()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/Xaml/OnTintColorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using System.Collections.Generic;
19 |
20 | using Xamarin.Forms;
21 |
22 | namespace XFGlossSample.Examples.Views.Xaml
23 | {
24 | public partial class OnTintColorPage : ContentPage
25 | {
26 | public OnTintColorPage()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/Xaml/AccessoryTypePage.xaml.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using System.Collections.Generic;
19 |
20 | using Xamarin.Forms;
21 |
22 | namespace XFGlossSample.Examples.Views.Xaml
23 | {
24 | public partial class AccessoryTypePage : ContentPage
25 | {
26 | public AccessoryTypePage()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/Xaml/MinTrackTintColorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using System.Collections.Generic;
19 |
20 | using Xamarin.Forms;
21 |
22 | namespace XFGlossSample.Examples.Views.Xaml
23 | {
24 | public partial class MinTrackTintColorPage : ContentPage
25 | {
26 | public MinTrackTintColorPage()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/Xaml/BackgroundColorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using System.Collections.Generic;
19 |
20 | using Xamarin.Forms;
21 |
22 | namespace XFGlossSample.Examples.Views.Xaml
23 | {
24 | public partial class BackgroundColorPage : ContentPage
25 | {
26 | public BackgroundColorPage()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/Xaml/ThumbTintColorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using System.Collections.Generic;
19 |
20 | using Xamarin.Forms;
21 |
22 | namespace XFGlossSample.Examples.Views.Xaml
23 | {
24 | public partial class ThumbTintColorPage : ContentPage
25 | {
26 | public ThumbTintColorPage()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/Xaml/MaxTrackTintColorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using System.Collections.Generic;
19 |
20 | using Xamarin.Forms;
21 |
22 | namespace XFGlossSample.Examples.Views.Xaml
23 | {
24 | public partial class MaxTrackTintColorPage : ContentPage
25 | {
26 | public MaxTrackTintColorPage()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/Xaml/ThumbOnTintColorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using System.Collections.Generic;
19 |
20 | using Xamarin.Forms;
21 |
22 | namespace XFGlossSample.Examples.Views.Xaml
23 | {
24 | public partial class ThumbOnTintColorPage : ContentPage
25 | {
26 | public ThumbOnTintColorPage()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/src/XFGlossSample/PerfTests/Views/RecycleBackgroundColorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | // /*
2 | // * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | // * http://github.com/tbaggett
4 | // * http://twitter.com/tbaggett
5 | // * http://tommyb.com
6 | // * http://ansuria.com
7 | // *
8 | // * The MIT License (MIT) see GitHub For more information
9 | // *
10 | // * Unless required by applicable law or agreed to in writing, software
11 | // * distributed under the License is distributed on an "AS IS" BASIS,
12 | // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // * See the License for the specific language governing permissions and
14 | // * limitations under the License.
15 | // */
16 | //
17 | using System;
18 | using System.Collections.Generic;
19 |
20 | using Xamarin.Forms;
21 |
22 | namespace XFGlossSample.PerfTests.Views
23 | {
24 | public partial class RecycleBackgroundColorPage : ContentPage, IPerfTestPage
25 | {
26 | public RecycleBackgroundColorPage()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/PerfTests/Views/RetainBackgroundGradientPage.xaml.cs:
--------------------------------------------------------------------------------
1 | // /*
2 | // * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | // * http://github.com/tbaggett
4 | // * http://twitter.com/tbaggett
5 | // * http://tommyb.com
6 | // * http://ansuria.com
7 | // *
8 | // * The MIT License (MIT) see GitHub For more information
9 | // *
10 | // * Unless required by applicable law or agreed to in writing, software
11 | // * distributed under the License is distributed on an "AS IS" BASIS,
12 | // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // * See the License for the specific language governing permissions and
14 | // * limitations under the License.
15 | // */
16 | //
17 | using System;
18 | using System.Collections.Generic;
19 |
20 | using Xamarin.Forms;
21 |
22 | namespace XFGlossSample.PerfTests.Views
23 | {
24 | public partial class RetainBackgroundGradientPage : ContentPage, IPerfTestPage
25 | {
26 | public RetainBackgroundGradientPage()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/PerfTests/Views/RetainBackgroundColorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | // /*
2 | // * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | // * http://github.com/tbaggett
4 | // * http://twitter.com/tbaggett
5 | // * http://tommyb.com
6 | // * http://ansuria.com
7 | // *
8 | // * The MIT License (MIT) see GitHub For more information
9 | // *
10 | // * Unless required by applicable law or agreed to in writing, software
11 | // * distributed under the License is distributed on an "AS IS" BASIS,
12 | // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // * See the License for the specific language governing permissions and
14 | // * limitations under the License.
15 | // */
16 | //
17 | using System;
18 | using System.Collections.Generic;
19 |
20 | using Xamarin.Forms;
21 |
22 | namespace XFGlossSample.PerfTests.Views
23 | {
24 | public partial class RetainBackgroundColorPage : ContentPage, IPerfTestPage
25 | {
26 | public RetainBackgroundColorPage()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/src/XFGlossSample/PerfTests/Views/RecycleBackgroundGradientPage.xaml.cs:
--------------------------------------------------------------------------------
1 | // /*
2 | // * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | // * http://github.com/tbaggett
4 | // * http://twitter.com/tbaggett
5 | // * http://tommyb.com
6 | // * http://ansuria.com
7 | // *
8 | // * The MIT License (MIT) see GitHub For more information
9 | // *
10 | // * Unless required by applicable law or agreed to in writing, software
11 | // * distributed under the License is distributed on an "AS IS" BASIS,
12 | // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // * See the License for the specific language governing permissions and
14 | // * limitations under the License.
15 | // */
16 | //
17 | using System;
18 | using System.Collections.Generic;
19 |
20 | using Xamarin.Forms;
21 |
22 | namespace XFGlossSample.PerfTests.Views
23 | {
24 | public partial class RecycleBackgroundGradientPage : ContentPage, IPerfTestPage
25 | {
26 | public RecycleBackgroundGradientPage()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/src/XFGlossSample/PerfTests/Views/RetainBackgroundColorPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/XFGlossSample/PerfTests/Views/RecycleBackgroundColorPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/XFGlossSample.Shared/XFGlossSample.Shared.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 463e2613-f6da-4823-bdeb-66f9b7c0b2ae
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.Linq;
20 |
21 | using Foundation;
22 | using UIKit;
23 |
24 | namespace XFGlossSample.iOS
25 | {
26 | public class Application
27 | {
28 | // This is the main entry point of the application.
29 | static void Main(string[] args)
30 | {
31 | // if you want to use a different Application Delegate class from "AppDelegate"
32 | // you can specify it here.
33 | UIApplication.Main(args, null, "AppDelegate");
34 | }
35 | }
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/ViewModels/IExamplesViewModel.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using XFGloss;
19 |
20 | namespace XFGlossSample.Examples.ViewModels
21 | {
22 | public interface IExamplesViewModel
23 | {
24 | // The name of the property's type
25 | string PropertyType { get; }
26 | // The property's default value
27 | string PropertyDefault { get; }
28 | // One or more paragraphs of descriptive text
29 | string[] PropertyDescription { get; }
30 | // Comma separated list of classes that the property can be applied to
31 | string TargetClasses { get; }
32 | }
33 | }
--------------------------------------------------------------------------------
/src/XFGloss.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27130.2036
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XFGloss", "XFGloss\XFGloss.csproj", "{8C7A76D0-5D59-4C16-AB40-A438CD7386B1}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {8C7A76D0-5D59-4C16-AB40-A438CD7386B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {8C7A76D0-5D59-4C16-AB40-A438CD7386B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {8C7A76D0-5D59-4C16-AB40-A438CD7386B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {8C7A76D0-5D59-4C16-AB40-A438CD7386B1}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {61526BAE-509B-41DD-8398-9CB417CCB60E}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/src/XFGlossSample/App.xaml.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using Xamarin.Forms;
18 | using Xamarin.Forms.Xaml;
19 |
20 | [assembly: XamlCompilation(XamlCompilationOptions.Compile)]
21 | namespace XFGlossSample
22 | {
23 | public partial class App : Application
24 | {
25 | public App()
26 | {
27 | InitializeComponent();
28 |
29 | MainPage = new AppMenu();
30 | }
31 |
32 | protected override void OnStart()
33 | {
34 | // Handle when your app starts
35 | }
36 |
37 | protected override void OnSleep()
38 | {
39 | // Handle when your app sleeps
40 | }
41 |
42 | protected override void OnResume()
43 | {
44 | // Handle when your app resumes
45 | }
46 | }
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/LICENSE.MD:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016-2018 Ansuria Solutions LLC & Tommy Baggett:
4 | * http://github.com/tbaggett
5 | * http://twitter.com/tbaggett
6 | * http://tommyb.com
7 | * http://ansuria.com
8 |
9 | Permission is hereby granted, free of charge, to any person obtaining a copy
10 | of this software and associated documentation files (the "Software"), to deal
11 | in the Software without restriction, including without limitation the rights
12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | copies of the Software, and to permit persons to whom the Software is
14 | furnished to do so, subject to the following conditions:
15 |
16 | The above copyright notice and this permission notice shall be included in all
17 | copies or substantial portions of the Software.
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | SOFTWARE.
26 |
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.Linq;
20 |
21 | using Foundation;
22 | using UIKit;
23 |
24 | namespace XFGlossSample.iOS
25 | {
26 | [Register("AppDelegate")]
27 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
28 | {
29 | public override bool FinishedLaunching(UIApplication app, NSDictionary options)
30 | {
31 | Xamarin.Forms.Forms.Init();
32 |
33 | /********** ADD THIS CALL TO INITIALIZE XFGloss *********/
34 | XFGloss.iOS.Library.Init();
35 |
36 | LoadApplication(new App());
37 |
38 | return base.FinishedLaunching(app, options);
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/src/XFGloss/Shared/Attributes/PreserveAttribute.cs:
--------------------------------------------------------------------------------
1 | // /*
2 | // * Copyright (C) 2016-2017 Ansuria Solutions LLC & Tommy Baggett:
3 | // * http://github.com/tbaggett
4 | // * http://twitter.com/tbaggett
5 | // * http://tommyb.com
6 | // * http://ansuria.com
7 | // *
8 | // * The MIT License (MIT) see GitHub For more information
9 | // *
10 | // * Unless required by applicable law or agreed to in writing, software
11 | // * distributed under the License is distributed on an "AS IS" BASIS,
12 | // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // * See the License for the specific language governing permissions and
14 | // * limitations under the License.
15 | // */
16 | //
17 |
18 | namespace XFGloss
19 | {
20 | ///
21 | /// Preserve attribute used to instruct Xamarin linkers to not exclude classes/methods
22 | ///
23 | public sealed class PreserveAttribute : System.Attribute
24 | {
25 | ///
26 | /// Specifies that all members should be preserved when attribute is applied to a class
27 | ///
28 | public bool AllMembers;
29 | ///
30 | /// Specifies that class/method that attribute is applied to should only be preserved if a containing class is preserved.
31 | ///
32 | public bool Conditional;
33 | }
34 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/ViewModels/BackgroundColorViewModel.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | namespace XFGlossSample.Examples.ViewModels
18 | {
19 | public class BackgroundColorViewModel : IExamplesViewModel
20 | {
21 | public string PropertyDefault
22 | {
23 | get { return "Color.Default"; }
24 | }
25 |
26 | public string[] PropertyDescription
27 | {
28 | get
29 | {
30 | return new string[]
31 | {
32 | "Specifies a numeric or named XF.Color value to apply as the element's background color.",
33 | };
34 | }
35 | }
36 |
37 | public string PropertyType
38 | {
39 | get { return "Xamarin.Forms.Color"; }
40 | }
41 |
42 | public string TargetClasses
43 | {
44 | get { return "EntryCell, ImageCell, SwitchCell, TextCell, ViewCell"; }
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/ViewModels/OnTintColorViewModel.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | namespace XFGlossSample.Examples.ViewModels
18 | {
19 | public class OnTintColorViewModel : IExamplesViewModel
20 | {
21 | public string PropertyDefault
22 | {
23 | get { return "Color.Default"; }
24 | }
25 |
26 | public string[] PropertyDescription
27 | {
28 | get
29 | {
30 | return new string[]
31 | {
32 | "Specifies a numeric or named XF.Color value to apply to the track/border portion of the Switch control when the control is in the \"On\" position.",
33 | };
34 | }
35 | }
36 |
37 | public string PropertyType
38 | {
39 | get { return "Xamarin.Forms.Color"; }
40 | }
41 |
42 | public string TargetClasses
43 | {
44 | get { return "Switch, SwitchCell"; }
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/ViewModels/ThumbOnTintColorViewModel.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | namespace XFGlossSample.Examples.ViewModels
18 | {
19 | public class ThumbOnTintColorViewModel : IExamplesViewModel
20 | {
21 | public string PropertyDefault
22 | {
23 | get { return "Color.Default"; }
24 | }
25 |
26 | public string[] PropertyDescription
27 | {
28 | get
29 | {
30 | return new string[]
31 | {
32 | "Specifies a numeric or named XF.Color value to apply to the thumb portion of the Switch control when the control is in the \"On\" position.",
33 | };
34 | }
35 | }
36 |
37 | public string PropertyType
38 | {
39 | get { return "Xamarin.Forms.Color"; }
40 | }
41 |
42 | public string TargetClasses
43 | {
44 | get { return "Switch, SwitchCell"; }
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/PerfTests/Views/RetainBackgroundGradientPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/src/XFGlossSample/PerfTests/Views/RecycleBackgroundGradientPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/ViewModels/ThumbTintColorViewModel.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | namespace XFGlossSample.Examples.ViewModels
18 | {
19 | public class ThumbTintColorViewModel : IExamplesViewModel
20 | {
21 | public string PropertyDefault
22 | {
23 | get { return "Color.Default"; }
24 | }
25 |
26 | public string[] PropertyDescription
27 | {
28 | get
29 | {
30 | return new string[]
31 | {
32 | "Specifies a numeric or named XF.Color value to apply to the thumb portion of the Slider control " +
33 | "as well as the Switch and SwitchCell controls when they are in the \"Off\" position.",
34 | };
35 | }
36 | }
37 |
38 | public string PropertyType
39 | {
40 | get { return "Xamarin.Forms.Color"; }
41 | }
42 |
43 | public string TargetClasses
44 | {
45 | get { return "Slider, Switch, SwitchCell"; }
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/ViewModels/MinTrackTintColorViewModel.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | namespace XFGlossSample.Examples.ViewModels
18 | {
19 | public class MinTrackTintColorViewModel : IExamplesViewModel
20 | {
21 | public string PropertyDefault
22 | {
23 | get
24 | {
25 | return "Color.Default";
26 | }
27 | }
28 |
29 | public string[] PropertyDescription
30 | {
31 | get
32 | {
33 | return new string[]
34 | {
35 | "Specifies a numeric or named XF.Color value to apply to the left side of the Slider control's " +
36 | "track, up to the thumb position.",
37 | };
38 | }
39 | }
40 |
41 | public string PropertyType
42 | {
43 | get
44 | {
45 | return "Xamarin.Forms.Color";
46 | }
47 | }
48 |
49 | public string TargetClasses
50 | {
51 | get
52 | {
53 | return "Slider";
54 | }
55 | }
56 | }
57 | }
58 |
59 |
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
24 |
27 |
28 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/ViewModels/MaxTrackTintColorViewModel.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | namespace XFGlossSample.Examples.ViewModels
18 | {
19 | public class MaxTrackTintColorViewModel : IExamplesViewModel
20 | {
21 | public string PropertyDefault
22 | {
23 | get
24 | {
25 | return "Color.Default";
26 | }
27 | }
28 |
29 | public string[] PropertyDescription
30 | {
31 | get
32 | {
33 | return new string[]
34 | {
35 | "Specifies a numeric or named XF.Color value to apply to the right side of the Slider control's " +
36 | "track, beginning at the thumb position.",
37 | };
38 | }
39 | }
40 |
41 | public string PropertyType
42 | {
43 | get
44 | {
45 | return "Xamarin.Forms.Color";
46 | }
47 | }
48 |
49 | public string TargetClasses
50 | {
51 | get
52 | {
53 | return "Slider";
54 | }
55 | }
56 | }
57 | }
58 |
59 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/InfoPage.xaml.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using System.Collections.Generic;
19 |
20 | using Xamarin.Forms;
21 | using XFGlossSample.Examples.ViewModels;
22 |
23 | namespace XFGlossSample.Examples.Views
24 | {
25 | public partial class InfoPage : ContentPage
26 | {
27 | public InfoPage()
28 | {
29 | InitializeComponent();
30 | }
31 |
32 | protected override void OnBindingContextChanged()
33 | {
34 | base.OnBindingContextChanged();
35 |
36 | // Reset/add children to our PropertyDescription stack layout
37 | PropertyDescription.Children.Clear();
38 |
39 | if (BindingContext is IExamplesViewModel)
40 | {
41 | foreach (string description in (BindingContext as IExamplesViewModel).PropertyDescription)
42 | {
43 | PropertyDescription.Children.Add(new Label() { Text = description });
44 | }
45 | }
46 | }
47 | }
48 | }
49 |
50 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/Xaml/AccessoryTypePage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/XFGloss/Platforms/iOS/XFGlossInit.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using XFGloss.iOS.Renderers;
19 |
20 | namespace XFGloss.iOS
21 | {
22 | ///
23 | /// Library class used to provide static initializer to be called from XFGloss iOS client projects to insure
24 | /// the XFGloss library is included in the client project's build.
25 | ///
26 | public class Library
27 | {
28 | ///
29 | /// Initializer to be called from XFGloss iOS client project to insure the XFGloss library is inclued in the
30 | /// client project's build.
31 | ///
32 | public static void Init()
33 | {
34 | // Have to instantiate one of the renderers to stop the Xamarin linker removing them
35 | // from release builds
36 | #pragma warning disable CS0219 // Variable is assigned but its value is never used
37 | XFGlossContentPageRenderer r = new XFGlossContentPageRenderer();
38 | #pragma warning restore CS0219 // Variable is assigned but its value is never used
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDisplayName
6 | XFGlossSample
7 | CFBundleName
8 | XFGlossSample
9 | CFBundleIdentifier
10 | com.tommyb.xfglosssample
11 | CFBundleShortVersionString
12 | 1.0
13 | CFBundleVersion
14 | 1.0
15 | LSRequiresIPhoneOS
16 |
17 | MinimumOSVersion
18 | 8.0
19 | UIDeviceFamily
20 |
21 | 1
22 | 2
23 |
24 | UILaunchStoryboardName
25 | LaunchScreen
26 | UIRequiredDeviceCapabilities
27 |
28 | armv7
29 |
30 | UISupportedInterfaceOrientations
31 |
32 | UIInterfaceOrientationPortrait
33 | UIInterfaceOrientationLandscapeLeft
34 | UIInterfaceOrientationLandscapeRight
35 |
36 | UISupportedInterfaceOrientations~ipad
37 |
38 | UIInterfaceOrientationPortrait
39 | UIInterfaceOrientationPortraitUpsideDown
40 | UIInterfaceOrientationLandscapeLeft
41 | UIInterfaceOrientationLandscapeRight
42 |
43 | XSAppIconAssets
44 | Resources/Media.xcassets/AppIcon.appiconset
45 |
46 |
47 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/ViewModels/BackgroundGradientViewModel.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | namespace XFGlossSample.Examples.ViewModels
18 | {
19 | public class BackgroundGradientViewModel : IExamplesViewModel
20 | {
21 | public string PropertyDefault
22 | {
23 | get { return "null"; }
24 | }
25 |
26 | public string[] PropertyDescription
27 | {
28 | get
29 | {
30 | return new string[]
31 | {
32 | "Specifies a multi-color gradient to fill the background of the associated control instance with." +
33 | " You can specify as many colors as you like and control their distribution across the fill at " +
34 | "any angle. Convenience properties and constructors also make it easy to create two-color " +
35 | "horizontal or vertical fills."
36 | };
37 | }
38 | }
39 |
40 | public string PropertyType
41 | {
42 | get { return "XFGloss.GlossGradient"; }
43 | }
44 |
45 | public string TargetClasses
46 | {
47 | get { return "ContentPage, EntryCell, ImageCell, SwitchCell, TextCell, ViewCell"; }
48 | }
49 | }
50 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/CSharp/MaxTrackTintColorPage.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using Xamarin.Forms;
18 | using XFGloss;
19 |
20 | namespace XFGlossSample.Examples.Views.CSharp
21 | {
22 | public class MaxTrackTintColorPage : ContentPage
23 | {
24 | public MaxTrackTintColorPage()
25 | {
26 | var stack = new StackLayout { Padding = 10 };
27 |
28 | // Slider demo
29 |
30 | stack.Children.Add(new Label { Text = "Slider MaxTrackTintColor values set in C#:", Margin = new Thickness(10) });
31 | stack.Children.Add(CreateMaxTrackTintColorSlider(25, Color.Red));
32 | stack.Children.Add(CreateMaxTrackTintColorSlider(50, Color.Green));
33 | stack.Children.Add(CreateMaxTrackTintColorSlider(75, Color.Blue));
34 |
35 | Content = new ScrollView() { Content = stack };
36 | }
37 |
38 | Slider CreateMaxTrackTintColorSlider(double value, Color colorValue)
39 | {
40 | var slider = new Slider { Minimum = 0, Maximum = 100, Value = value };
41 |
42 | SliderGloss.SetMaxTrackTintColor(slider, colorValue);
43 |
44 | return slider;
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/CSharp/MinTrackTintColorPage.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using Xamarin.Forms;
18 | using XFGloss;
19 |
20 | namespace XFGlossSample.Examples.Views.CSharp
21 | {
22 | public class MinTrackTintColorPage : ContentPage
23 | {
24 | public MinTrackTintColorPage()
25 | {
26 | var stack = new StackLayout { Padding = 10 };
27 |
28 | // Slider demo
29 |
30 | stack.Children.Add(new Label { Text = "Slider MinTrackTintColor values set in C#:", Margin = new Thickness(10) });
31 | stack.Children.Add(CreateMinTrackTintColorSlider(25, Color.Red));
32 | stack.Children.Add(CreateMinTrackTintColorSlider(50, Color.Green));
33 | stack.Children.Add(CreateMinTrackTintColorSlider(75, Color.Blue));
34 |
35 | Content = new ScrollView() { Content = stack };
36 | }
37 |
38 | Slider CreateMinTrackTintColorSlider(double value, Color colorValue)
39 | {
40 | var slider = new Slider { Minimum = 0, Maximum = 100, Value = value };
41 |
42 | SliderGloss.SetMinTrackTintColor(slider, colorValue);
43 |
44 | return slider;
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/src/XFGlossSample.Shared/AssemblyInfoGlobal.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System.Resources;
18 | using System.Reflection;
19 |
20 | // General Information about an assembly is controlled through the following
21 | // set of attributes. Change these attribute values to modify the information
22 | // associated with an assembly.
23 | [assembly: AssemblyDescription("XFGloss Sample App Component")]
24 | [assembly: AssemblyConfiguration("")]
25 | [assembly: AssemblyCompany("Ansuria Solutions LLC")]
26 | [assembly: AssemblyCopyright("(c) 2016 Ansuria Solutions LLC and Tommy Baggett")]
27 | [assembly: AssemblyTrademark("")]
28 | [assembly: AssemblyCulture("")]
29 | [assembly: NeutralResourcesLanguage("en")]
30 |
31 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
32 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
33 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
34 |
35 | //[assembly: AssemblyVersion("1.0.*")]
36 | [assembly: AssemblyVersion("1.0.0")]
37 | [assembly: AssemblyFileVersion("1.0.0")]
38 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/ViewModels/AccessoryTypeViewModel.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using Xamarin.Forms;
19 | using XFGloss;
20 | using XFGlossSample.ViewModels;
21 |
22 | namespace XFGlossSample.Examples.ViewModels
23 | {
24 | public class AccessoryTypeViewModel : IExamplesViewModel
25 | {
26 | public string PropertyDefault
27 | {
28 | get { return "CellGlossAccessoryType.None"; }
29 | }
30 |
31 | public string[] PropertyDescription
32 | {
33 | get
34 | {
35 | return new string[]
36 | {
37 | "Specifies an indicator type to display in the right side of a table or list view cell. See the " +
38 | "CellGlossAccessoryType enumeration for the available types.",
39 | "This property is only implemented on the iOS platform. iOS is the only " +
40 | "platform that natively supports an accessory view."
41 | };
42 | }
43 | }
44 |
45 | public string PropertyType
46 | {
47 | get { return "CellGlossAccessoryType"; }
48 | }
49 |
50 | public string TargetClasses
51 | {
52 | get { return "EntryCell, ImageCell, TextCell, ViewCell"; }
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/PerfTests/ViewModels/PerfTestViewModel.cs:
--------------------------------------------------------------------------------
1 | // /*
2 | // * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | // * http://github.com/tbaggett
4 | // * http://twitter.com/tbaggett
5 | // * http://tommyb.com
6 | // * http://ansuria.com
7 | // *
8 | // * The MIT License (MIT) see GitHub For more information
9 | // *
10 | // * Unless required by applicable law or agreed to in writing, software
11 | // * distributed under the License is distributed on an "AS IS" BASIS,
12 | // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // * See the License for the specific language governing permissions and
14 | // * limitations under the License.
15 | // */
16 | //
17 | using System;
18 | using System.Collections.Generic;
19 |
20 | namespace XFGlossSample.PerfTests.ViewModels
21 | {
22 | public class PerfTestViewModel : List
23 | {
24 | public string Title { get; private set; }
25 |
26 | private PerfTestViewModel(string title)
27 | {
28 | Title = title;
29 | }
30 |
31 | public static IList ListItems { get; private set; }
32 |
33 | static PerfTestViewModel()
34 | {
35 | List listItems = new List();
36 | for (int section = 0; section < 10; section++)
37 | {
38 | var sectionItem = new PerfTestViewModel($"Section {section}");
39 | for (int item = 1; item < 10; item++)
40 | {
41 | sectionItem.Add(new SectionItem($"Item {item}"));
42 | }
43 |
44 | listItems.Add(sectionItem);
45 | }
46 |
47 | ListItems = listItems;
48 | }
49 | }
50 |
51 | public class SectionItem
52 | {
53 | public string Title { get; private set; }
54 |
55 | public SectionItem(string title)
56 | {
57 | Title = title;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.axml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable/
12 | icon.png
13 |
14 | layout/
15 | main.axml
16 |
17 | values/
18 | strings.xml
19 |
20 | In order to get the build system to recognize Android resources, set the build action to
21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called "R"
24 | (this is an Android convention) that contains the tokens for each one of the resources
25 | included. For example, for the above Resources layout, this is what the R class would expose:
26 |
27 | public class R {
28 | public class drawable {
29 | public const int icon = 0x123;
30 | }
31 |
32 | public class layout {
33 | public const int main = 0x456;
34 | }
35 |
36 | public class strings {
37 | public const int first_string = 0xabc;
38 | public const int second_string = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first
44 | string in the dictionary file values/strings.xml.
45 |
--------------------------------------------------------------------------------
/src/XFGloss/Platforms/Android/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.axml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable/
12 | icon.png
13 |
14 | layout/
15 | main.axml
16 |
17 | values/
18 | strings.xml
19 |
20 | In order to get the build system to recognize Android resources, set the build action to
21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called "R"
24 | (this is an Android convention) that contains the tokens for each one of the resources
25 | included. For example, for the above Resources layout, this is what the R class would expose:
26 |
27 | public class R {
28 | public class drawable {
29 | public const int icon = 0x123;
30 | }
31 |
32 | public class layout {
33 | public const int main = 0x456;
34 | }
35 |
36 | public class strings {
37 | public const int first_string = 0xabc;
38 | public const int second_string = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first
44 | string in the dictionary file values/strings.xml.
45 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/Xaml/BackgroundGradientPage.xaml.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using Xamarin.Forms;
19 |
20 | namespace XFGlossSample.Examples.Views.Xaml
21 | {
22 | public partial class BackgroundGradientPage : ContentPage
23 | {
24 | bool updateGradient;
25 |
26 | public BackgroundGradientPage()
27 | {
28 | InitializeComponent();
29 | }
30 |
31 | protected override void OnAppearing()
32 | {
33 | base.OnAppearing();
34 |
35 | updateGradient = true;
36 |
37 | Device.StartTimer(new TimeSpan(1000000), UpdateGradient);
38 | }
39 |
40 | protected override void OnDisappearing()
41 | {
42 | base.OnDisappearing();
43 |
44 | updateGradient = false;
45 | }
46 |
47 | /******************************************
48 | *
49 | * NOTE: This code is for gradient demonstration purposes only. I do NOT recommend you continuously update
50 | * a gradient fill in a cell or page!
51 | *
52 | ******************************************/
53 |
54 | bool UpdateGradient()
55 | {
56 | Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
57 | {
58 | if (rotatingGradient.Rotation >= 355)
59 | {
60 | rotatingGradient.Rotation = 0;
61 | }
62 | else
63 | {
64 | rotatingGradient.Rotation += 5;
65 | }
66 | });
67 |
68 | return updateGradient;
69 | }
70 | }
71 | }
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/XFGloss/Shared/Models/CellGlossAccessoryType.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 |
19 | namespace XFGloss
20 | {
21 | // Supported on iOS only currently
22 |
23 | //
24 | //
25 | //
26 |
27 | ///
28 | /// An enumeration that specifies the accessory view type for a on the iOS
29 | /// platform. The enumeration values are based on the available accessory view types on the iOS platform's
30 | /// class, however the DetailDisclosureButton and DetailButton are disabled
31 | /// until we can access the detail button tapped method in the table view source for both the
32 | /// (currently not possible) and
33 | /// (currently possible) classes. This enumeration is not used on the Android platform.
34 | ///
35 | public enum CellGlossAccessoryType
36 | {
37 | ///
38 | /// Specifies no accessory type should be displayed
39 | ///
40 | None,
41 | ///
42 | /// Specifies the disclosure indicator type should be displayed
43 | ///
44 | DisclosureIndicator,
45 | //DetailDisclosureButton,
46 | ///
47 | /// Specifies the checkmark indicator type should be displayed
48 | ///
49 | Checkmark,
50 | //DetailButton,
51 | ///
52 | /// Specifies the edit indicator type should be displayed
53 | ///
54 | EditIndicator
55 | }
56 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Views/AboutPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
18 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/ViewModels/TintColorViewModel.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using Xamarin.Forms;
18 |
19 | namespace XFGlossSample.Examples.ViewModels
20 | {
21 | public class TintColorViewModel : IExamplesViewModel
22 | {
23 | public string PropertyDefault
24 | {
25 | get { return "Color.Default"; }
26 | }
27 |
28 | public string[] PropertyDescription
29 | {
30 | get
31 | {
32 | string result;
33 |
34 | if (Device.RuntimePlatform == Device.iOS)
35 | {
36 | result = "Specifies a numeric or named XF.Color value to apply to the cell's accessory view or " +
37 | "the track/border portion of the Switch control when the control is in the \"Off\" " +
38 | "position.";
39 | }
40 | else
41 | {
42 | result = "Specifies a numeric or named XF.Color value to apply to the track/border portion of " +
43 | "the Switch control when the control is in the \"Off\" position.";
44 | }
45 |
46 | return new string[] { result };
47 | }
48 | }
49 |
50 | public string PropertyType
51 | {
52 | get { return "Xamarin.Forms.Color"; }
53 | }
54 |
55 | public string TargetClasses
56 | {
57 | get
58 | {
59 | if (Device.RuntimePlatform == Device.iOS)
60 | {
61 | return "EntryCell, ImageCell, Switch, SwitchCell, TextCell, ViewCell";
62 | }
63 | else
64 | {
65 | return "Switch, SwitchCell";
66 | }
67 | }
68 | }
69 |
70 | public bool isRunningiOS
71 | {
72 | get { return Device.RuntimePlatform == Device.iOS; }
73 | }
74 | }
75 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/Xaml/BackgroundColorPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
16 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/src/XFGloss/Shared/Interfaces/IGradientRenderer.cs:
--------------------------------------------------------------------------------
1 | // /*
2 | // * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | // * http://github.com/tbaggett
4 | // * http://twitter.com/tbaggett
5 | // * http://tommyb.com
6 | // * http://ansuria.com
7 | // *
8 | // * The MIT License (MIT) see GitHub For more information
9 | // *
10 | // * Unless required by applicable law or agreed to in writing, software
11 | // * distributed under the License is distributed on an "AS IS" BASIS,
12 | // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // * See the License for the specific language governing permissions and
14 | // * limitations under the License.
15 | // */
16 | //
17 |
18 | namespace XFGloss
19 | {
20 | ///
21 | /// -based interface that defines methods for updating the
22 | /// class's rotation and steps properties on a platform-specific basis.
23 | ///
24 | public interface IGradientRenderer : IXFGlossRenderer
25 | {
26 | ///
27 | /// Updates the rotation value, an integer number between 0 and 359. The property name specifies the attached
28 | /// bindable property that is being updated, such as the BackgroundGradient property.
29 | ///
30 | /// The name of the attached bindable property that is being updated.
31 | /// The rotation value, an integer number between 0 and 359.
32 | void UpdateRotation(string propertyName, int rotation);
33 |
34 | ///
35 | /// Updates the gradient steps. The property name specifies the attached bindable property that is being
36 | /// updated, such as the BackgroundGradient property.
37 | ///
38 | /// The name of the attached bindable property that is being updated.
39 | /// A of
40 | /// instances that specify the value and fill percentage (a double value
41 | /// between 0, which indicates the beginning of the fill, and 1, which indicates the end of the fill).
42 | void UpdateSteps(string propertyName, GradientStepCollection steps);
43 | }
44 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Views/AppMenu.xaml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/src/XFGlossSample.Droid/MainActivity.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using Android.App;
18 | using Android.Content.PM;
19 | using Android.OS;
20 |
21 | namespace XFGlossSample.Droid
22 | {
23 | [Activity(Label = "XFGlossSample.Droid", Icon = "@drawable/icon", Theme = "@style/MyTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
24 | public class MainActivity : Xamarin.Forms.Platform.Android.FormsAppCompatActivity
25 | {
26 | protected override void OnCreate(Bundle savedInstanceState)
27 | {
28 | TabLayoutResource = Resource.Layout.Tabbar;
29 | ToolbarResource = Resource.Layout.Toolbar;
30 |
31 | base.OnCreate(savedInstanceState);
32 |
33 | Xamarin.Forms.Forms.Init(this, savedInstanceState);
34 |
35 | var app = new App();
36 | LoadApplication(app);
37 |
38 | // Set this property to FALSE if you don't want XFGloss to render XF SwitchCell controls using the
39 | // material design styling on older Android APIs (16+) when the AppCompat library is being used.
40 | // NOTE: The SwitchGloss tinting properties WILL NOT WORK on older Android APIs if you set this
41 | // property to false.
42 |
43 | // XFGloss.Droid.Library.UsingSwitchCompatCell = false;
44 |
45 | // Set this property to TRUE if you want translucent slider and switch control tracks to be used
46 | // on APIs older than 21 when AppCompat is being used. This property is disabled by default due to
47 | // older devices' performance possibly being impacted by having to render partially transparent UI elements.
48 |
49 | // XFGloss.Droid.Library.UsingAppCompatAlpha = true;
50 |
51 | // IMPORTANT: Initialize XFGloss AFTER calling LoadApplication on the Android platform
52 | XFGloss.Droid.Library.Init(this, savedInstanceState);
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/src/XFGloss/Shared/Interfaces/ISwitchGloss.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using Xamarin.Forms;
19 |
20 | namespace XFGloss
21 | {
22 | ///
23 | /// An interface that defines instance property getters/setters that must be implemented by any implementors of the
24 | /// interface. The interface is implemented by both the and
25 | /// classes.
26 | ///
27 | public interface ISwitchGloss
28 | {
29 | ///
30 | /// Gets or sets the value of the track tint color when the Switch control
31 | /// is in the "off" position for the assigned instance.
32 | ///
33 | /// The color of the track tinting.
34 | Color TintColor { get; set; }
35 |
36 | ///
37 | /// Gets or sets the value of the track tint color when the Switch control
38 | /// is in the "on" position for the assigned instance.
39 | ///
40 | /// The color of the track tinting.
41 | Color OnTintColor { get; set; }
42 |
43 | ///
44 | /// Gets or sets the value of the thumb tint color when the Switch control
45 | /// is in the "off" position for the assigned instance.
46 | ///
47 | /// The color of the track tinting.
48 | Color ThumbTintColor { get; set; }
49 |
50 | ///
51 | /// Gets or sets the value of the thumb tint color when the Switch control
52 | /// is in the "on" position for the assigned instance.
53 | ///
54 | /// The color of the track tinting.
55 | Color ThumbOnTintColor { get; set; }
56 | }
57 | }
--------------------------------------------------------------------------------
/src/XFGloss/Shared/Interfaces/IXFGlossRenderer.cs:
--------------------------------------------------------------------------------
1 | // /*
2 | // * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | // * http://github.com/tbaggett
4 | // * http://twitter.com/tbaggett
5 | // * http://tommyb.com
6 | // * http://ansuria.com
7 | // *
8 | // * The MIT License (MIT) see GitHub For more information
9 | // *
10 | // * Unless required by applicable law or agreed to in writing, software
11 | // * distributed under the License is distributed on an "AS IS" BASIS,
12 | // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // * See the License for the specific language governing permissions and
14 | // * limitations under the License.
15 | // */
16 | //
17 |
18 | namespace XFGloss
19 | {
20 | //
21 | //
22 |
23 | ///
24 | /// Methods to be implemented in the platform-specific XFGlossRenderers. These methods are called by any
25 | /// XFGlossElement instance that a XFGlossRenderer registers with.
26 | ///
27 | public interface IXFGlossRenderer
28 | {
29 | ///
30 | /// Indicates if an existing element's properties can be updated or a new instance must be created
31 | ///
32 | /// true, if updating is possible, false otherwise.
33 | /// The attached BindableObject property name that a platform-specific implementation
34 | /// is being created or updated for.
35 | bool CanUpdate(string propertyName);
36 |
37 | ///
38 | /// Requests a platform-specific implementation of the specified attached BindableObject property name be created.
39 | ///
40 | /// The attached BindableObject property name that a platform-specific implementation
41 | /// is being created for.
42 | /// The -based class instance that the
43 | /// platform-specific implementation is needed for.
44 | /// The class type of the -based class.
45 | ///
46 | void CreateNativeElement(string propertyName, TElement element) where TElement : XFGlossElement;
47 |
48 | ///
49 | /// Requests the platform-specific implementation for the specified attached BindableObject property name be
50 | /// removed.
51 | ///
52 | /// The attached BindableObject property name that a platform-specific implementation
53 | /// is being removed for.
54 | void RemoveNativeElement(string propertyName);
55 | }
56 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/CSharp/BackgroundColorPage.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System.Collections.Generic;
18 | using Xamarin.Forms;
19 | using XFGloss;
20 | using XFGlossSample.Utils;
21 |
22 | namespace XFGlossSample.Examples.Views.CSharp
23 | {
24 | public class BackgroundColorPage : ContentPage
25 | {
26 | public BackgroundColorPage()
27 | {
28 | /*
29 | This is a bit of a hack. Android's renderer for TableView always adds an empty header for a
30 | TableSection declaration, while iOS doesn't. To compensate, I'm using a Label to display info text
31 | on iOS, and the TableSection on Android since there is no easy way to get rid of it.This is a
32 | long-standing bug in the XF TableView on Android.
33 | (https://forums.xamarin.com/discussion/18037/tablesection-w-out-header)
34 | */
35 | TableSection section;
36 | if (Device.RuntimePlatform == Device.Android)
37 | {
38 | section = new TableSection("Cell BackgroundColor values set in C#:");
39 | }
40 | else
41 | {
42 | section = new TableSection();
43 | }
44 |
45 | var cell = new TextCell { Text = "Red", TextColor = Color.White };
46 | CellGloss.SetBackgroundColor(cell, Color.Red);
47 | section.Add(cell);
48 |
49 | cell = new TextCell { Text = "Green", TextColor = Color.White };
50 | CellGloss.SetBackgroundColor(cell, Color.Green);
51 | section.Add(cell);
52 |
53 | cell = new TextCell { Text = "Blue", TextColor = Color.White };
54 | CellGloss.SetBackgroundColor(cell, Color.Blue);
55 | section.Add(cell);
56 |
57 | var stack = new StackLayout();
58 | if (Device.RuntimePlatform == Device.iOS)
59 | {
60 | stack.Children.Add(new Label { Text = "Cell BackgroundColor values set in C#:", Margin = new Thickness(10) });
61 | }
62 | stack.Children.Add(new TableView
63 | {
64 | Intent = TableIntent.Data,
65 | HeightRequest = XFGlossDevices.OnPlatform(132, 190),
66 | Root = new TableRoot
67 | {
68 | section
69 | }
70 | });
71 |
72 | Content = stack;
73 | }
74 | }
75 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/ViewModels/AppMenuViewModel.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using Xamarin.Forms;
20 |
21 | namespace XFGlossSample.ViewModels
22 | {
23 | // Simple data models used to group menu items into sections for menu ListView's data source
24 | public class AppMenuViewModel : List
25 | {
26 | public string Title { get; set; }
27 |
28 | private AppMenuViewModel(string title)
29 | {
30 | Title = title;
31 | }
32 |
33 | public static IList MenuItems { get; private set; }
34 |
35 | static AppMenuViewModel()
36 | {
37 | List menuItems = new List
38 | {
39 | new AppMenuViewModel("XFGloss Properties")
40 | {
41 | new AppMenuItem("BackgroundColor"),
42 | new AppMenuItem("BackgroundGradient"),
43 | new AppMenuItem("MaxTrackTintColor"),
44 | new AppMenuItem("MinTrackTintColor"),
45 | new AppMenuItem("OnTintColor"),
46 | new AppMenuItem("ThumbOnTintColor"),
47 | new AppMenuItem("ThumbTintColor"),
48 | new AppMenuItem("TintColor"),
49 | },
50 | new AppMenuViewModel("ListView Performance Tests")
51 | {
52 | new AppMenuItem("Recycle, BkgrndColor", "RecycleBackgroundColor"),
53 | new AppMenuItem("Retain, BkgrndColor", "RetainBackgroundColor"),
54 | new AppMenuItem("Recycle, BkgrndGradient", "RecycleBackgroundGradient"),
55 | new AppMenuItem("Retain, BkgrndGradient", "RetainBackgroundGradient"),
56 | }
57 | };
58 |
59 | // Add iOS only entry if we're running on iOS
60 | if (Device.RuntimePlatform == Device.iOS)
61 | {
62 | menuItems[0].Insert(0, new AppMenuItem("AccessoryType (iOS only)", "AccessoryType"));
63 | }
64 |
65 | MenuItems = menuItems;
66 | }
67 | }
68 |
69 | public class AppMenuItem
70 | {
71 | public string Title { get; set; }
72 | public string PropertyName { get; set; }
73 |
74 | public AppMenuItem(string title, string propertyName = null)
75 | {
76 | Title = title;
77 | PropertyName = propertyName ?? title;
78 | }
79 | }
80 | }
--------------------------------------------------------------------------------
/src/XFGloss/Platforms/Android/Extensions/XFGlossGradientExtensions.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using Xamarin.Forms.Platform.Android;
20 |
21 | namespace XFGloss.Droid.Extensions
22 | {
23 | ///
24 | /// Extension methods for the class to convert
25 | /// and step percentage values to Android-specific data values.
26 | ///
27 | public static class XFGlossGradientExtensions
28 | {
29 | ///
30 | /// Converts each of the steps' values to
31 | /// Android color values
32 | ///
33 | /// An array of Android color values
34 | /// The instance to apply the method to
35 | static public int[] ToAndroidColorValues(this Gradient self)
36 | {
37 | List result = new List();
38 |
39 | foreach (GradientStep step in self.Steps)
40 | {
41 | result.Add(step.StepColor.ToAndroid());
42 | }
43 |
44 | return result.ToArray();
45 | }
46 |
47 | ///
48 | /// Converts each of the steps' percentage values to Android step values
49 | ///
50 | /// An array of floats that represents the steps' percentages
51 | /// The instance to apply the method to
52 | static public float[] ToAndroidPercentages(this Gradient self)
53 | {
54 | List result = new List();
55 |
56 | float lastStep = float.MinValue;
57 | foreach (GradientStep step in self.Steps)
58 | {
59 | if (lastStep > step.StepPercentage)
60 | {
61 | throw new ArgumentOutOfRangeException(nameof(GradientStep.StepPercentage), "The current StepPercentage " +
62 | "value must be greater than zero and the previous " +
63 | " StepPercentage value.");
64 | }
65 |
66 | result.Add((float)step.StepPercentage);
67 | }
68 |
69 | return result.ToArray();
70 | }
71 | }
72 | }
--------------------------------------------------------------------------------
/src/XFGlossSample.iOS/Resources/Media.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "scale": "2x",
5 | "size": "20x20",
6 | "idiom": "iphone",
7 | "filename": "Icon-40.png"
8 | },
9 | {
10 | "scale": "3x",
11 | "size": "20x20",
12 | "idiom": "iphone",
13 | "filename": "Icon-60.png"
14 | },
15 | {
16 | "scale": "2x",
17 | "size": "29x29",
18 | "idiom": "iphone",
19 | "filename": "Icon-58.png"
20 | },
21 | {
22 | "scale": "3x",
23 | "size": "29x29",
24 | "idiom": "iphone",
25 | "filename": "Icon-87.png"
26 | },
27 | {
28 | "scale": "2x",
29 | "size": "40x40",
30 | "idiom": "iphone",
31 | "filename": "Icon-80.png"
32 | },
33 | {
34 | "scale": "3x",
35 | "size": "40x40",
36 | "idiom": "iphone",
37 | "filename": "Icon-120.png"
38 | },
39 | {
40 | "scale": "2x",
41 | "size": "60x60",
42 | "idiom": "iphone",
43 | "filename": "Icon-120.png"
44 | },
45 | {
46 | "scale": "3x",
47 | "size": "60x60",
48 | "idiom": "iphone",
49 | "filename": "Icon-180.png"
50 | },
51 | {
52 | "scale": "1x",
53 | "size": "20x20",
54 | "idiom": "ipad",
55 | "filename": "Icon-20.png"
56 | },
57 | {
58 | "scale": "2x",
59 | "size": "20x20",
60 | "idiom": "ipad",
61 | "filename": "Icon-40.png"
62 | },
63 | {
64 | "scale": "1x",
65 | "size": "29x29",
66 | "idiom": "ipad",
67 | "filename": "Icon-29.png"
68 | },
69 | {
70 | "scale": "2x",
71 | "size": "29x29",
72 | "idiom": "ipad",
73 | "filename": "Icon-58.png"
74 | },
75 | {
76 | "scale": "1x",
77 | "size": "40x40",
78 | "idiom": "ipad",
79 | "filename": "Icon-40.png"
80 | },
81 | {
82 | "scale": "2x",
83 | "size": "40x40",
84 | "idiom": "ipad",
85 | "filename": "Icon-80.png"
86 | },
87 | {
88 | "scale": "1x",
89 | "size": "76x76",
90 | "idiom": "ipad",
91 | "filename": "Icon-76.png"
92 | },
93 | {
94 | "scale": "2x",
95 | "size": "76x76",
96 | "idiom": "ipad",
97 | "filename": "Icon-152.png"
98 | },
99 | {
100 | "scale": "2x",
101 | "size": "83.5x83.5",
102 | "idiom": "ipad",
103 | "filename": "Icon-167.png"
104 | },
105 | {
106 | "scale": "1x",
107 | "size": "1024x1024",
108 | "idiom": "ios-marketing",
109 | "filename": "Icon-1024.png"
110 | }
111 | ],
112 | "properties": {},
113 | "info": {
114 | "version": 1,
115 | "author": "xcode"
116 | }
117 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/CSharp/AccessoryTypePage.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using Xamarin.Forms;
20 | using XFGloss;
21 |
22 | namespace XFGlossSample.Examples.Views.CSharp
23 | {
24 | public class AccessoryTypePage : ContentPage
25 | {
26 | public AccessoryTypePage()
27 | {
28 | var section = new TableSection();
29 | section.Add(CreateAccessoryTypeCells());
30 |
31 | Content = new StackLayout
32 | {
33 | Children =
34 | {
35 | new Label { Text = "Cell AccessoryType values set in C#:", Margin = new Thickness(10) },
36 | new TableView
37 | {
38 | Root = new TableRoot
39 | {
40 | section
41 | }
42 | }
43 | }
44 | };
45 | }
46 |
47 | Cell[] CreateAccessoryTypeCells()
48 | {
49 | List result = new List| ();
50 |
51 | // Iterate through the enumeration's values, creating a new text cell for each entity
52 | var typeNames = Enum.GetNames(typeof(CellGlossAccessoryType));
53 | foreach (string typeName in typeNames)
54 | {
55 | Cell cell;
56 | if (typeName == nameof(CellGlossAccessoryType.EditIndicator))
57 | {
58 | cell = new EntryCell();
59 | }
60 | else
61 | {
62 | cell = new TextCell();
63 | }
64 |
65 | if (cell is EntryCell)
66 | {
67 | var entryCell = cell as EntryCell;
68 | entryCell.Label = typeName;
69 | entryCell.Placeholder = "Optional";
70 | entryCell.HorizontalTextAlignment = TextAlignment.End;
71 | }
72 | else
73 | {
74 | (cell as TextCell).Text = typeName;
75 | }
76 |
77 | // Assign our gloss properties
78 | var accType = (CellGlossAccessoryType)Enum.Parse(typeof(CellGlossAccessoryType), typeName);
79 |
80 | // You can use the standard static setter...
81 | CellGloss.SetAccessoryType(cell, accType);
82 |
83 | // ...or instantiate an instance of the Gloss properties you want to assign values to
84 | // var gloss = new XFGloss.Views.Cell(cell);
85 | // gloss.AccessoryType = accType;
86 | // gloss.BackgroundColor = Color.Blue;
87 | // gloss.TintColor = Color.Red;
88 | // ...
89 |
90 | result.Add(cell);
91 | }
92 |
93 | return result.ToArray();
94 | }
95 | }
96 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/Xaml/OnTintColorPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
16 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/Xaml/ThumbOnTintColorPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
15 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/src/XFGloss/Platforms/iOS/Renderers/XFGlossSwitchRenderer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016-2017 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using Xamarin.Forms;
18 | using Xamarin.Forms.Platform.iOS;
19 | using XFGloss.iOS.Extensions;
20 |
21 | [assembly: ExportRenderer(typeof(Switch), typeof(XFGloss.iOS.Renderers.XFGlossSwitchRenderer))]
22 | namespace XFGloss.iOS.Renderers
23 | {
24 | ///
25 | /// The iOS platform-specific Xamarin.Forms renderer used for all
26 | /// derived classes.
27 | ///
28 | [Preserve(AllMembers = true)]
29 | public class XFGlossSwitchRenderer : SwitchRenderer
30 | {
31 | SwitchGloss _properties;
32 |
33 | ///
34 | /// override that is called whenever the associated
35 | /// instance changes
36 | ///
37 | /// that specifies the
38 | /// previously and newly assigned instances
39 | ///
40 | protected override void OnElementChanged(ElementChangedEventArgs e)
41 | {
42 | base.OnElementChanged(e);
43 |
44 | _properties = (e.NewElement != null) ? new SwitchGloss(e.NewElement) : null;
45 |
46 | if (Control != null && _properties != null)
47 | {
48 | Control.UpdateColorProperty(_properties, null);
49 | }
50 | }
51 |
52 | ///
53 | /// override that is called whenever the
54 | /// event is fired
55 | ///
56 | /// Sender.
57 | /// E.
58 | protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
59 | {
60 | if (_properties != null)
61 | {
62 | if (e.PropertyName == SwitchGloss.TintColorProperty.PropertyName ||
63 | e.PropertyName == SwitchGloss.OnTintColorProperty.PropertyName ||
64 | e.PropertyName == SwitchGloss.ThumbTintColorProperty.PropertyName ||
65 | e.PropertyName == SwitchGloss.ThumbOnTintColorProperty.PropertyName ||
66 | e.PropertyName == Switch.IsToggledProperty.PropertyName)
67 | {
68 | Control.UpdateColorProperty(_properties, e.PropertyName);
69 | }
70 | }
71 |
72 | base.OnElementPropertyChanged(sender, e);
73 | }
74 | }
75 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Views/AppMenu.xaml.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Ansuria Solutions LLC & Tommy Baggett:
3 | * http://github.com/tbaggett
4 | * http://twitter.com/tbaggett
5 | * http://tommyb.com
6 | * http://ansuria.com
7 | *
8 | * The MIT License (MIT) see GitHub For more information
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | using System;
18 | using Xamarin.Forms;
19 | using XFGlossSample.Examples.Views;
20 | using XFGlossSample.ViewModels;
21 | using XFGlossSample.Views;
22 |
23 | namespace XFGlossSample
24 | {
25 | public partial class AppMenu : MasterDetailPage
26 | {
27 | AppMenuItem _lastSelectedItem;
28 |
29 | public AppMenu()
30 | {
31 | InitializeComponent();
32 | }
33 |
34 | void ShowAbout(object sender, System.EventArgs e)
35 | {
36 | MenuItemsList.SelectedItem = _lastSelectedItem = null;
37 | var prevDetail = Detail as ContentPage;
38 | Detail = new NavigationPage(new AboutPage());
39 | CleanupPreviousDetailPage(prevDetail);
40 |
41 | IsPresented = false;
42 | }
43 |
44 | void ShowPage(object sender, System.EventArgs e)
45 | {
46 | try
47 | {
48 | var appMenuItem = (sender as BindableObject).BindingContext as AppMenuItem;
49 | if (ShowPage(appMenuItem.PropertyName, appMenuItem.Title))
50 | {
51 | _lastSelectedItem = (AppMenuItem)MenuItemsList.SelectedItem;
52 | }
53 | }
54 | catch (Exception)
55 | {
56 | DisplayPageError();
57 | }
58 | }
59 |
60 | bool ShowPage(string propertyName, string pageTitle = null)
61 | {
62 | bool result = false;
63 | var examplePage = XFGlossSampleViewFactory.CreateSampleAppPage(propertyName, pageTitle);
64 | if (examplePage != null)
65 | {
66 | var prevDetail = Detail as ContentPage;
67 | Detail = examplePage;
68 | CleanupPreviousDetailPage(prevDetail);
69 | result = true;
70 | }
71 | else
72 | {
73 | // The newly-selected page failed to be displayed. Restore the menu's previous selection
74 | // so the selection will match the currently-displayed page.
75 | MenuItemsList.SelectedItem = _lastSelectedItem;
76 | DisplayPageError(propertyName);
77 | }
78 |
79 | IsPresented = false;
80 |
81 | return result;
82 | }
83 |
84 | void CleanupPreviousDetailPage(ContentPage prevPage)
85 | {
86 | if (prevPage is IDisposable)
87 | {
88 | (prevPage as IDisposable).Dispose();
89 | }
90 |
91 | if (prevPage != null)
92 | {
93 | prevPage.Content = null;
94 | }
95 | }
96 |
97 | void DisplayPageError(string propertyName = "")
98 | {
99 | string errMsg = $"An error occurred while trying to display the {propertyName} page.";
100 |
101 | DisplayAlert("Display Error", errMsg, "OK");
102 | }
103 | }
104 | }
--------------------------------------------------------------------------------
/src/XFGlossSample/Examples/Views/Xaml/ThumbTintColorPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
22 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/src/XFGloss/Shared/Events/EventUtilities.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Rico Suter. All rights reserved.
4 | //
5 | // https://github.com/MyToolkit/MyToolkit/blob/master/LICENSE.md
6 | // Rico Suter, mail@rsuter.com
7 | //-----------------------------------------------------------------------
8 |
9 | // FYI, only included here because it is referenced by the WeakEvent class
10 |
11 | using System;
12 | using System.Reflection;
13 |
14 | namespace XFGloss
15 | {
16 | /// Provides methods for event management.
17 | [Preserve(AllMembers = true)]
18 | class EventUtilities
19 | {
20 | /// Registers an event on the given target object.
21 | /// The target object.
22 | /// The event name.
23 | /// The callback.
24 | /// The registration token to deregister the event.
25 | public static object RegisterEvent(object target, string eventName, Action | |