├── iOS
├── Resources
│ ├── about.png
│ ├── news.png
│ ├── about@2x.png
│ ├── news@2x.png
│ ├── refresh.png
│ ├── slideout.png
│ ├── refresh@2x.png
│ ├── slideout@2x.png
│ └── Default-568h@2x.png
├── Entitlements.plist
├── packages.config
├── Main.cs
├── AppDelegate.cs
├── Info.plist
└── FootballTournament2014.iOS.csproj
├── Android
├── Resources
│ ├── drawable
│ │ ├── Icon.png
│ │ └── slideout.png
│ ├── drawable-hdpi
│ │ ├── about.png
│ │ ├── news.png
│ │ └── refresh.png
│ ├── drawable-mdpi
│ │ ├── about.png
│ │ ├── news.png
│ │ └── refresh.png
│ ├── drawable-xhdpi
│ │ ├── news.png
│ │ ├── about.png
│ │ └── refresh.png
│ ├── drawable-xxhdpi
│ │ ├── about.png
│ │ ├── news.png
│ │ └── refresh.png
│ ├── values
│ │ └── Strings.xml
│ ├── layout
│ │ └── Main.axml
│ └── AboutResources.txt
├── Properties
│ ├── AndroidManifest.xml
│ └── AssemblyInfo.cs
├── packages.config
├── Assets
│ └── AboutAssets.txt
├── MainActivity.cs
└── FootballTournament2014.Android.csproj
├── FootballTournament2014.WindowsPhone
├── about.png
├── news.png
├── refresh.png
├── slideout.png
├── Assets
│ ├── AlignmentGrid.png
│ ├── ApplicationIcon.png
│ └── Tiles
│ │ ├── IconicTileSmall.png
│ │ ├── FlipCycleTileLarge.png
│ │ ├── FlipCycleTileSmall.png
│ │ ├── FlipCycleTileMedium.png
│ │ └── IconicTileMediumLarge.png
├── Toolkit.Content
│ ├── ApplicationBar.Add.png
│ ├── ApplicationBar.Check.png
│ ├── ApplicationBar.Cancel.png
│ ├── ApplicationBar.Delete.png
│ └── ApplicationBar.Select.png
├── README_FIRST.txt
├── Properties
│ ├── AppManifest.xml
│ ├── AssemblyInfo.cs
│ └── WMAppManifest.xml
├── LocalizedStrings.cs
├── packages.config
├── MainPage.xaml.cs
├── MainPage.xaml
├── App.xaml
├── Resources
│ ├── AppResources.Designer.cs
│ └── AppResources.resx
├── App.xaml.cs
└── FootballTournament2014.WindowsPhone.csproj
├── FootballTournament2014
├── Helpers
│ ├── ListTextCell.cs
│ ├── ListImageCell.cs
│ ├── HorizontalListTextCell.cs
│ ├── GroupHelper.cs
│ ├── KnockoutMatchCell.cs
│ ├── Color.cs
│ └── ScoreCell.cs
├── App.cs
├── Views
│ ├── BaseView.cs
│ ├── NewsDetailsView.cs
│ ├── PodcastDetalView.cs
│ ├── TeamDetailView.cs
│ ├── MapView.cs
│ ├── HomeView.cs
│ ├── KnockoutMatchView.cs
│ ├── TeamsView.cs
│ ├── NewsView.cs
│ ├── PodcastView.cs
│ ├── GroupMatchView.cs
│ ├── AboutView.cs
│ └── HomeMasterView.cs
├── FootballTournament2014.shproj
├── ViewModels
│ ├── MapViewModel.cs
│ ├── HomeViewModel.cs
│ ├── KnockoutMatchesViewModel.cs
│ ├── PodcastViewModel.cs
│ ├── NewsViewModel.cs
│ ├── TeamsViewModel.cs
│ ├── GroupMatchesViewModel.cs
│ └── BaseViewModel.cs
└── FootballTournament2014.projitems
├── FootballTournament.Common
├── Models
│ ├── BaseModel.cs
│ ├── Headline.cs
│ ├── Links.cs
│ ├── Podcast.cs
│ ├── MenuItem.cs
│ ├── SearchResults.cs
│ ├── Location.cs
│ ├── KnockoutMatch.cs
│ ├── Team.cs
│ └── Match.cs
├── packages.config
├── Services
│ ├── NewsService.cs
│ ├── TeamsService.cs
│ ├── PodcastService.cs
│ ├── MatchService.cs
│ └── LocationService.cs
├── Properties
│ └── AssemblyInfo.cs
└── FootballTournament.Common.csproj
├── README.md
├── FootballTournament2014.userprefs
├── LICENSE
├── .gitignore
└── FootballTournament2014.sln
/iOS/Resources/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/iOS/Resources/about.png
--------------------------------------------------------------------------------
/iOS/Resources/news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/iOS/Resources/news.png
--------------------------------------------------------------------------------
/iOS/Resources/about@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/iOS/Resources/about@2x.png
--------------------------------------------------------------------------------
/iOS/Resources/news@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/iOS/Resources/news@2x.png
--------------------------------------------------------------------------------
/iOS/Resources/refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/iOS/Resources/refresh.png
--------------------------------------------------------------------------------
/iOS/Resources/slideout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/iOS/Resources/slideout.png
--------------------------------------------------------------------------------
/iOS/Resources/refresh@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/iOS/Resources/refresh@2x.png
--------------------------------------------------------------------------------
/iOS/Resources/slideout@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/iOS/Resources/slideout@2x.png
--------------------------------------------------------------------------------
/iOS/Resources/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/iOS/Resources/Default-568h@2x.png
--------------------------------------------------------------------------------
/Android/Resources/drawable/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/Android/Resources/drawable/Icon.png
--------------------------------------------------------------------------------
/Android/Resources/drawable-hdpi/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/Android/Resources/drawable-hdpi/about.png
--------------------------------------------------------------------------------
/Android/Resources/drawable-hdpi/news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/Android/Resources/drawable-hdpi/news.png
--------------------------------------------------------------------------------
/Android/Resources/drawable-mdpi/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/Android/Resources/drawable-mdpi/about.png
--------------------------------------------------------------------------------
/Android/Resources/drawable-mdpi/news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/Android/Resources/drawable-mdpi/news.png
--------------------------------------------------------------------------------
/Android/Resources/drawable-xhdpi/news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/Android/Resources/drawable-xhdpi/news.png
--------------------------------------------------------------------------------
/Android/Resources/drawable/slideout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/Android/Resources/drawable/slideout.png
--------------------------------------------------------------------------------
/Android/Resources/drawable-hdpi/refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/Android/Resources/drawable-hdpi/refresh.png
--------------------------------------------------------------------------------
/Android/Resources/drawable-mdpi/refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/Android/Resources/drawable-mdpi/refresh.png
--------------------------------------------------------------------------------
/Android/Resources/drawable-xhdpi/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/Android/Resources/drawable-xhdpi/about.png
--------------------------------------------------------------------------------
/Android/Resources/drawable-xxhdpi/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/Android/Resources/drawable-xxhdpi/about.png
--------------------------------------------------------------------------------
/Android/Resources/drawable-xxhdpi/news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/Android/Resources/drawable-xxhdpi/news.png
--------------------------------------------------------------------------------
/Android/Resources/drawable-xhdpi/refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/Android/Resources/drawable-xhdpi/refresh.png
--------------------------------------------------------------------------------
/Android/Resources/drawable-xxhdpi/refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/Android/Resources/drawable-xxhdpi/refresh.png
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/FootballTournament2014.WindowsPhone/about.png
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/FootballTournament2014.WindowsPhone/news.png
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/FootballTournament2014.WindowsPhone/refresh.png
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/slideout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/FootballTournament2014.WindowsPhone/slideout.png
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/Assets/AlignmentGrid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/FootballTournament2014.WindowsPhone/Assets/AlignmentGrid.png
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/Assets/ApplicationIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/FootballTournament2014.WindowsPhone/Assets/ApplicationIcon.png
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/Assets/Tiles/IconicTileSmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/FootballTournament2014.WindowsPhone/Assets/Tiles/IconicTileSmall.png
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/Assets/Tiles/FlipCycleTileLarge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/FootballTournament2014.WindowsPhone/Assets/Tiles/FlipCycleTileLarge.png
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/Assets/Tiles/FlipCycleTileSmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/FootballTournament2014.WindowsPhone/Assets/Tiles/FlipCycleTileSmall.png
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/Assets/Tiles/FlipCycleTileMedium.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/FootballTournament2014.WindowsPhone/Assets/Tiles/FlipCycleTileMedium.png
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/Assets/Tiles/IconicTileMediumLarge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/FootballTournament2014.WindowsPhone/Assets/Tiles/IconicTileMediumLarge.png
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/Toolkit.Content/ApplicationBar.Add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/FootballTournament2014.WindowsPhone/Toolkit.Content/ApplicationBar.Add.png
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/Toolkit.Content/ApplicationBar.Check.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/FootballTournament2014.WindowsPhone/Toolkit.Content/ApplicationBar.Check.png
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/Toolkit.Content/ApplicationBar.Cancel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/FootballTournament2014.WindowsPhone/Toolkit.Content/ApplicationBar.Cancel.png
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/Toolkit.Content/ApplicationBar.Delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/FootballTournament2014.WindowsPhone/Toolkit.Content/ApplicationBar.Delete.png
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/Toolkit.Content/ApplicationBar.Select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trsneed/FootballTournament2014/HEAD/FootballTournament2014.WindowsPhone/Toolkit.Content/ApplicationBar.Select.png
--------------------------------------------------------------------------------
/FootballTournament2014/Helpers/ListTextCell.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms;
3 |
4 | namespace FootballTournament2014
5 | {
6 | public class ListTextCell : TextCell
7 | {
8 |
9 | }
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Android/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | FootballTournament2014.Android.Android
5 |
6 |
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/README_FIRST.txt:
--------------------------------------------------------------------------------
1 | For the Windows Phone toolkit make sure that you have
2 | marked the icons in the "Toolkit.Content" folder as content. That way they
3 | can be used as the icons for the ApplicationBar control.
--------------------------------------------------------------------------------
/iOS/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/Properties/AppManifest.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/FootballTournament2014/Helpers/ListImageCell.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms;
3 |
4 | namespace FootballTournament2014
5 | {
6 | public class ListImageCell : ImageCell
7 | {
8 | public ListImageCell()
9 | {
10 | }
11 | }
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/Android/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/FootballTournament2014/App.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms;
3 |
4 | namespace FootballTournament2014
5 | {
6 | public class App
7 | {
8 | private static Page homeView;
9 | public static Page RootPage
10 | {
11 | get { return homeView ?? (homeView = new HomeView ()); }
12 | }
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/FootballTournament2014/Helpers/HorizontalListTextCell.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms;
3 |
4 | namespace FootballTournament2014
5 | {
6 | public class HorizontalListTextCell : TextCell
7 | {
8 | public HorizontalListTextCell()
9 | {
10 | // Style = TextCellStyle.Vertical;
11 |
12 | }
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/FootballTournament.Common/Models/BaseModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FootballTournament2014.Common.Models
4 | {
5 | public class BaseModel
6 | {
7 | public BaseModel ()
8 | {
9 | }
10 |
11 | public string Title {get;set;}
12 | public string Details { get; set; }
13 | public int Id { get; set; }
14 |
15 | }
16 |
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/FootballTournament.Common/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Android/Resources/layout/Main.axml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/LocalizedStrings.cs:
--------------------------------------------------------------------------------
1 | using FootballTournament2014.WindowsPhone.Resources;
2 |
3 | namespace FootballTournament2014.WindowsPhone
4 | {
5 | ///
6 | /// Provides access to string resources.
7 | ///
8 | public class LocalizedStrings
9 | {
10 | private static AppResources _localizedResources = new AppResources();
11 |
12 | public AppResources LocalizedResources { get { return _localizedResources; } }
13 | }
14 | }
--------------------------------------------------------------------------------
/FootballTournament2014/Helpers/GroupHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.ObjectModel;
3 | using FootballTournament2014.Common.Models;
4 |
5 | namespace FootballTournament2014
6 | {
7 | public class GroupHelper : ObservableCollection
8 | {
9 | public GroupHelper (string date)
10 | {
11 | Date = date;
12 | }
13 |
14 | public string Date
15 | {
16 | get;
17 | private set;
18 | }
19 | }
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/FootballTournament2014/Views/BaseView.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms;
3 |
4 | namespace FootballTournament2014
5 | {
6 | public class BaseView : ContentPage
7 | {
8 | public BaseView ()
9 | {
10 | SetBinding (Page.TitleProperty, new Binding(BaseViewModel.TitlePropertyName));
11 | SetBinding (Page.IconProperty, new Binding(BaseViewModel.IconPropertyName));
12 | }
13 |
14 | ActivityIndicator activity {get;set;}
15 |
16 |
17 | }
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/FootballTournament.Common/Services/NewsService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FootballTournament2014.Common.Models;
3 | using System.Collections.Generic;
4 | using Newtonsoft.Json;
5 |
6 | namespace FootballTournament2014.Common.Services
7 | {
8 | public static class NewsService
9 | {
10 | public static List GetNewsItems(string jsonResult)
11 | {
12 | var result = JsonConvert.DeserializeObject(jsonResult);
13 | return result.headlines;
14 | }
15 | }
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/FootballTournament.Common/Services/TeamsService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using FootballTournament2014.Common.Models;
4 | using Newtonsoft.Json;
5 |
6 | namespace FootballTournament2014.Common.Services
7 | {
8 | public static class TeamsService
9 | {
10 | public static List GetTeams(string json)
11 | {
12 | var result = JsonConvert.DeserializeObject(json);
13 | return result.sports[0].leagues[0].teams;
14 | }
15 | }
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/FootballTournament2014/Views/NewsDetailsView.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FootballTournament2014.Common.Models;
3 | using Xamarin.Forms;
4 |
5 | namespace FootballTournament2014
6 | {
7 | public class NewsDetailsView : BaseView
8 | {
9 | public NewsDetailsView(Headline item)
10 | {
11 | BindingContext = item;
12 | var webView = new WebView ();
13 | webView.Source = new UrlWebViewSource {
14 | Url = item.Url
15 | };
16 | Content = webView;
17 | }
18 | }
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/FootballTournament2014/Views/PodcastDetalView.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FootballTournament2014.Common.Models;
3 | using Xamarin.Forms;
4 |
5 | namespace FootballTournament2014
6 | {
7 | public class PodcastDetalView : BaseView
8 | {
9 | public PodcastDetalView(Podcast item)
10 | {
11 | BindingContext = item;
12 | var webView = new WebView ();
13 | webView.Source = new UrlWebViewSource {
14 | Url = item.Url
15 | };
16 | Content = webView;
17 | }
18 | }
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/FootballTournament.Common/Models/Headline.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FootballTournament2014.Common.Models
4 | {
5 | public class Headline : BaseModel
6 | {
7 | public Headline()
8 | {
9 | }
10 | public Links links { get; set; }
11 | public string headline { get; set; }
12 |
13 | public string Description
14 | {
15 | get;
16 | set;
17 | }
18 | public string Url
19 | {
20 | get{ return links.web.href.ToString(); }
21 | }
22 | }
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/FootballTournament.Common/Models/Links.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FootballTournament2014.Common.Models
4 | {
5 | public class Web
6 | {
7 | public string href { get; set; }
8 | public Teams teams {get;set;}
9 | }
10 | public class Teams {
11 | public string href {get;set;}
12 | }
13 | public class Mobile
14 | {
15 | public string href { get; set; }
16 | }
17 |
18 | public class Links
19 | {
20 | public Web web { get; set; }
21 | public Mobile mobile { get; set; }
22 | }
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/FootballTournament.Common/Models/Podcast.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FootballTournament2014.Common.Models
4 | {
5 | public class Podcast : BaseModel
6 | {
7 | public Podcast()
8 | {
9 | }
10 |
11 | public string Url
12 | {
13 | get;
14 | set;
15 | }
16 | public string PublishDate
17 | {
18 | get;
19 | set;
20 | }
21 | public string PodMp3Url
22 | {
23 | get;
24 | set;
25 | }
26 | }
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/FootballTournament2014/Views/TeamDetailView.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FootballTournament2014.Common.Models;
3 | using Xamarin.Forms;
4 |
5 | namespace FootballTournament2014
6 | {
7 | public class TeamDetailView : BaseView
8 | {
9 | public TeamDetailView(Team item )
10 | {
11 | BindingContext = item;
12 | var webView = new WebView ();
13 | webView.Source = new UrlWebViewSource {
14 | Url = item.Links.web.teams.href
15 | };
16 | Content = webView;
17 | }
18 | }
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | FootballTournament2014
2 | ======================
3 |
4 | A Xamarin.Forms sample app
5 |
6 |
7 | 
8 |
9 | Posts:
10 |
11 | - [Introducing Xamarin.Forms](http://trsneed.com/xamarin-forms-inching-closer-to-write-once-run-anywhere-native/)
12 |
13 | - [Adding Windows Phone for Indie Developers](http://trsneed.com/adding-a-windows-phone-app-to-a-existing-xamarin-forms-solution/)
14 |
15 | - [Customize a list view cell](http://trsneed.com/customize-xamarin-forms-listview-with-viewcell/)
16 |
--------------------------------------------------------------------------------
/iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using MonoTouch.Foundation;
6 | using MonoTouch.UIKit;
7 |
8 | namespace FootballTournament2014.iOS
9 | {
10 | public class Application
11 | {
12 | // This is the main entry point of the application.
13 | static void Main(string[] args)
14 | {
15 | // if you want to use a different Application Delegate class from "AppDelegate"
16 | // you can specify it here.
17 | UIApplication.Main(args, null, "AppDelegate");
18 | }
19 | }
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/FootballTournament.Common/Models/MenuItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FootballTournament2014.Common.Models
4 | {
5 | public enum MenuType
6 | {
7 | About,
8 | Blog,
9 | Twitter,
10 | Map,
11 | Groups,
12 | Knockout,
13 | News,
14 | Teams,
15 | Podcast
16 | }
17 | public class MenuItem : BaseModel
18 | {
19 | public MenuItem ()
20 | {
21 | MenuType = MenuType.About;
22 | }
23 | public string Icon {get;set;}
24 | public MenuType MenuType { get; set; }
25 | }
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/FootballTournament.Common/Models/SearchResults.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace FootballTournament2014.Common.Models
5 | {
6 | internal class SearchResults
7 | {
8 | public SearchResults()
9 | {
10 | }
11 |
12 | public string timestamp { get; set; }
13 | public int resultsOffset { get; set; }
14 | public string status { get; set; }
15 | public int resultsLimit { get; set; }
16 | public int resultsCount { get; set; }
17 | public List headlines { get; set; }
18 |
19 |
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/Android/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Android/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 |
--------------------------------------------------------------------------------
/Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Android.App;
4 | using Android.Content;
5 | using Android.Runtime;
6 | using Android.Views;
7 | using Android.Widget;
8 | using Android.OS;
9 |
10 | using Xamarin.Forms.Platform.Android;
11 |
12 |
13 | namespace FootballTournament2014.Android
14 | {
15 | [Activity(Label = "FootballTournament2014.Android.Android", MainLauncher = true)]
16 | public class MainActivity : AndroidActivity
17 | {
18 | protected override void OnCreate(Bundle bundle)
19 | {
20 | base.OnCreate(bundle);
21 |
22 | Xamarin.Forms.Forms.Init(this, bundle);
23 | Xamarin.FormsMaps.Init(this, bundle);
24 |
25 | SetPage (FootballTournament2014.App.RootPage);
26 | }
27 | }
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/FootballTournament.Common/Models/Location.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms.Maps;
3 |
4 | namespace FootballTournament2014.Common.Models
5 | {
6 | public partial class Location : BaseModel
7 | {
8 | public Location()
9 | {
10 | }
11 | public string Url
12 | {
13 | get;
14 | set;
15 | }
16 | public string City { get; set; }
17 | public Position Position
18 | {
19 | get{ return new Position(this.Latitude, this.Longitude); }
20 | }
21 | public double Latitude
22 | {
23 | get;
24 | set;
25 | }
26 | public double Longitude
27 | {
28 | get;
29 | set;
30 | }
31 | }
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/FootballTournament.Common/Models/KnockoutMatch.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FootballTournament2014.Common.Models
4 | {
5 | public class KnockoutMatch : Match
6 | {
7 | public KnockoutMatch(string knockoutMatchName)
8 | {
9 | KnockoutMatchName = knockoutMatchName;
10 | }
11 |
12 | public string KnockoutMatchName
13 | {
14 | get;
15 | private set;
16 | }
17 |
18 | public string KnockoutMatchDate
19 | {
20 | get { return base.MatchDate; }
21 | }
22 |
23 | public string KnockoutMatchTeams
24 | {
25 | get{
26 | return String.Format("{0} vs. {1}", this.HomeTeam, this.AwayTeam);
27 | }
28 | }
29 | }
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Net;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Navigation;
8 | using Microsoft.Phone.Controls;
9 | using Microsoft.Phone.Shell;
10 | using FootballTournament2014.WindowsPhone.Resources;
11 | using Xamarin;
12 | using Xamarin.Forms;
13 |
14 | namespace FootballTournament2014.WindowsPhone
15 | {
16 | public partial class MainPage : PhoneApplicationPage
17 | {
18 | // Constructor
19 | public MainPage()
20 | {
21 | InitializeComponent();
22 |
23 | Forms.Init();
24 | FormsMaps.Init();
25 |
26 | Content = FootballTournament2014.App.RootPage.ConvertPageToUIElement(this);
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/FootballTournament.Common/Models/Team.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace FootballTournament2014.Common.Models
5 | {
6 | public class Team : BaseModel
7 | {
8 | public Team()
9 | {
10 | }
11 |
12 | public string Name
13 | {
14 | get;
15 | set;
16 | }
17 | public Links Links { get; set; }
18 | public string Abbreviation { get; set; }
19 | public string FirstLetter { get { return Name.Substring(0, 1); } }
20 | }
21 |
22 | public class League
23 | {
24 | public List teams { get; set; }
25 | }
26 | public class TeamsResult
27 | {
28 | public List sports { get; set; }
29 | }
30 | public class Sport
31 | {
32 | public List leagues { get; set; }
33 | }
34 | }
35 |
36 |
--------------------------------------------------------------------------------
/FootballTournament2014/Views/MapView.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms;
3 | using Xamarin.Forms.Maps;
4 |
5 | namespace FootballTournament2014
6 | {
7 | public class MapView : BaseView
8 | {
9 | private MapViewModel ViewModel
10 | {
11 | get { return BindingContext as MapViewModel; }
12 | }
13 |
14 | public MapView()
15 | {
16 | BindingContext = new MapViewModel();
17 | var frame = new Frame {
18 | Padding = new Thickness(0, 0, 0, 0)
19 | };
20 |
21 | var map = new Map(MapSpan.FromCenterAndRadius(new Position(-15, -50),
22 | Distance.FromMiles(1100)));
23 | ViewModel.LoadPins().ForEach(m => map.Pins.Add(m));
24 |
25 | frame.Content = map;
26 | Content = frame;
27 | }
28 |
29 |
30 | }
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
15 |
--------------------------------------------------------------------------------
/FootballTournament2014/FootballTournament2014.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {EB24946D-120A-476C-81F4-924880D22A2A}
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/FootballTournament.Common/Services/PodcastService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Threading.Tasks;
4 | using System.Xml.Linq;
5 | using FootballTournament2014.Common.Models;
6 | using System.Collections.Generic;
7 |
8 | namespace FootballTournament.Common.Services
9 | {
10 | public static class PodcastService
11 | {
12 | public static List ParsePodcastRss(string rss)
13 | {
14 |
15 | var xdoc = XDocument.Parse(rss);
16 | var id = 0;
17 | return (from item in xdoc.Descendants("item")
18 | select new Podcast
19 | {
20 | Title = (string)item.Element("title"),
21 | Details = (string)item.Element("description"),
22 | Url = (string)item.Element("link"),
23 | PublishDate = (string)item.Element("pubDate"),
24 | Id = id++
25 | }).ToList();
26 | }
27 |
28 |
29 | }
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/FootballTournament2014.userprefs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/FootballTournament2014.WindowsPhone/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using MonoTouch.Foundation;
6 | using MonoTouch.UIKit;
7 |
8 | using Xamarin.Forms;
9 |
10 | namespace FootballTournament2014.iOS
11 | {
12 | [Register("AppDelegate")]
13 | public partial class AppDelegate : UIApplicationDelegate
14 | {
15 | UIWindow window;
16 | Page page;
17 |
18 | public override bool FinishedLaunching (UIApplication app, NSDictionary options)
19 | {
20 | window = new UIWindow (UIScreen.MainScreen.Bounds);
21 | UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes()
22 | {
23 | TextColor = UIColor.White
24 | });
25 | Forms.Init();
26 | Xamarin.FormsMaps.Init();
27 | page = FootballTournament2014.App.RootPage;
28 | window.RootViewController = page.CreateViewController ();
29 |
30 | window.MakeKeyAndVisible ();
31 |
32 | return true;
33 | }
34 | }
35 | }
36 |
37 |
--------------------------------------------------------------------------------
/FootballTournament2014/ViewModels/MapViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms.Maps;
3 | using System.Collections.Generic;
4 | using System.Threading.Tasks;
5 | using FootballTournament2014.Common.Services;
6 |
7 | namespace FootballTournament2014
8 | {
9 | public class MapViewModel : BaseViewModel
10 | {
11 | public MapViewModel()
12 | {
13 | Title = "Venues";
14 | }
15 |
16 | public List LoadPins()
17 | {
18 | if (IsBusy)
19 | return new List();
20 |
21 | IsBusy = true;
22 |
23 | var results = LocationService.GetLocations();
24 | var pins = new List();
25 | results.ForEach(r => pins.Add(new Pin
26 | {
27 | Type = PinType.Place,
28 | Position = r.Position,
29 | Label = r.Title.ToString(),
30 | Address = r.City.ToString()
31 | }));
32 | IsBusy = false;
33 |
34 | return pins;
35 | }
36 | }
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Tim Sneed
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/FootballTournament.Common/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 |
4 | // Information about this assembly is defined by the following attributes.
5 | // Change them to the values specific to your project.
6 |
7 | [assembly: AssemblyTitle("FootballTournament.Common")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("")]
12 | [assembly: AssemblyCopyright("timsneed")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
19 |
20 | [assembly: AssemblyVersion("1.0.*")]
21 |
22 | // The following attributes are used to specify the signing key for the assembly,
23 | // if desired. See the Mono documentation for more information about signing.
24 |
25 | //[assembly: AssemblyDelaySign(false)]
26 | //[assembly: AssemblyKeyFile("")]
27 |
28 |
--------------------------------------------------------------------------------
/Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using Android.App;
4 |
5 | // Information about this assembly is defined by the following attributes.
6 | // Change them to the values specific to your project.
7 |
8 | [assembly: AssemblyTitle("FootballTournament2014.Android")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("")]
13 | [assembly: AssemblyCopyright("timsneed")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
18 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
19 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
20 |
21 | [assembly: AssemblyVersion("1.0.0")]
22 |
23 | // The following attributes are used to specify the signing key for the assembly,
24 | // if desired. See the Mono documentation for more information about signing.
25 |
26 | //[assembly: AssemblyDelaySign(false)]
27 | //[assembly: AssemblyKeyFile("")]
28 |
29 |
--------------------------------------------------------------------------------
/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDisplayName
6 | FootballTournament2014.iOS
7 | CFBundleIdentifier
8 | com.*
9 | CFBundleShortVersionString
10 | 1.0
11 | CFBundleVersion
12 | 1.0
13 | LSRequiresIPhoneOS
14 |
15 | MinimumOSVersion
16 | 7.0
17 | UIDeviceFamily
18 |
19 | 1
20 | 2
21 |
22 | UIRequiredDeviceCapabilities
23 |
24 | armv7
25 |
26 | UISupportedInterfaceOrientations
27 |
28 | UIInterfaceOrientationPortrait
29 | UIInterfaceOrientationLandscapeLeft
30 | UIInterfaceOrientationLandscapeRight
31 |
32 | UISupportedInterfaceOrientations~ipad
33 |
34 | UIInterfaceOrientationPortrait
35 | UIInterfaceOrientationPortraitUpsideDown
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/FootballTournament.Common/Models/Match.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FootballTournament2014.Common.Models;
3 | using Newtonsoft.Json;
4 | using System.Collections.Generic;
5 |
6 | namespace FootballTournament2014.Common.Models
7 | {
8 | public class Match : BaseModel
9 | {
10 | public Match()
11 | {
12 | }
13 | [JsonProperty(PropertyName="team1_title")]
14 | public string HomeTeam {get;set;}
15 | [JsonProperty(PropertyName="team2_title")]
16 | public string AwayTeam {get;set;}
17 | [JsonProperty(PropertyName="score1")]
18 | public string HomeScore {get;set;}
19 | [JsonProperty(PropertyName="score1ot")]
20 | public string HomeScoreOT {get;set;}
21 | [JsonProperty(PropertyName="score2")]
22 | public string AwayScore { get;set;}
23 | [JsonProperty(PropertyName="score2ot")]
24 | public string AwayScoreOT {get;set;}
25 | [JsonProperty(PropertyName="score1p")]
26 | public string HomeScorePen {get;set;}
27 | [JsonProperty(PropertyName="score2p")]
28 | public string AwayScorePen {get;set;}
29 | [JsonProperty(PropertyName="play_at")]
30 | public string MatchDate { get; set; }
31 |
32 | }
33 |
34 | public class Round : BaseModel
35 | {
36 | public int pos { get; set; }
37 | public string start_at { get; set; }
38 | public string end_at { get; set; }
39 | }
40 |
41 | public class MatchDay
42 | {
43 | public Round Round { get; set; }
44 | [JsonProperty(PropertyName="games")]
45 | public List Matches { get; set; }
46 | }
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/FootballTournament2014/ViewModels/HomeViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.ObjectModel;
3 | using FootballTournament2014.Common.Models;
4 |
5 | namespace FootballTournament2014
6 | {
7 | public class HomeViewModel : BaseViewModel
8 | {
9 | public ObservableCollection