Skip to content
This repository has been archived by the owner on Mar 2, 2018. It is now read-only.

Commit

Permalink
RootPage switching
Browse files Browse the repository at this point in the history
  • Loading branch information
adamped committed Aug 8, 2015
1 parent 2bbbec5 commit 0988851
Show file tree
Hide file tree
Showing 24 changed files with 436 additions and 42 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# Custom Files
ToDo.txt

# User-specific files
*.suo
*.user
Expand Down
10 changes: 9 additions & 1 deletion Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,18 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="AsyncSemaphore.cs" />
<Compile Include="Helper\Settings.cs" />
<Compile Include="Helpers\Settings.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Refractored.Xam.Settings, Version=1.5.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xam.Plugins.Settings.1.5.2\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Refractored.Xam.Settings.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Refractored.Xam.Settings.Abstractions, Version=1.5.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xam.Plugins.Settings.1.5.2\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Refractored.Xam.Settings.Abstractions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Core, Version=1.3.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.1.3.3.6323\lib\portable-win+net45+wp80+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
<Private>True</Private>
Expand Down
41 changes: 41 additions & 0 deletions Common/Helpers/Settings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Refractored.Xam.Settings;
using Refractored.Xam.Settings.Abstractions;

namespace Common.Helpers
{
/// <summary>
/// This is the Settings static class that can be used in your Core solution or in any
/// of your client applications. All settings are laid out the same exact way with getters
/// and setters.
/// </summary>
public static class Settings
{
private static ISettings AppSettings
{
get
{
return CrossSettings.Current;
}
}

#region Setting Constants

private const string SettingsKey = "settings_key";
private static readonly string SettingsDefault = string.Empty;

#endregion

public static string GeneralSettings
{
get
{
return AppSettings.GetValueOrDefault(SettingsKey, SettingsDefault);
}
set
{
AppSettings.AddOrUpdateValue(SettingsKey, value);
}
}

}
}
1 change: 1 addition & 0 deletions Common/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xam.Plugins.Settings" version="1.5.2" targetFramework="portable-net45+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10" />
<package id="Xamarin.Forms" version="1.3.3.6323" targetFramework="portable-net45+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10" />
</packages>
26 changes: 26 additions & 0 deletions Mobile.UITest/AppInitializer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.IO;
using System.Linq;
using Xamarin.UITest;
using Xamarin.UITest.Queries;

namespace Mobile.UITest
{
public class AppInitializer
{
public static IApp StartApp(Platform platform)
{
if (platform == Platform.Android)
{
return ConfigureApp
.Android
.StartApp();
}

return ConfigureApp
.iOS
.StartApp();
}
}
}

65 changes: 65 additions & 0 deletions Mobile.UITest/Mobile.UITest.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{584F4F30-0140-4296-ACD7-03F0DA91682E}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Mobile.UITest</RootNamespace>
<AssemblyName>Mobile.UITest</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.core, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\packages\NUnitTestAdapter.1.2\lib\nunit.core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="nunit.core.interfaces, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\packages\NUnitTestAdapter.1.2\lib\nunit.core.interfaces.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.util, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\packages\NUnitTestAdapter.1.2\lib\nunit.util.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="NUnit.VisualStudio.TestAdapter, Version=1.2.0.0, Culture=neutral, PublicKeyToken=4cb40d35494691ac, processorArchitecture=MSIL">
<HintPath>..\packages\NUnitTestAdapter.1.2\lib\NUnit.VisualStudio.TestAdapter.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="Xamarin.UITest, Version=0.7.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.UITest.0.7.2\lib\Xamarin.UITest.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Tests.cs" />
<Compile Include="AppInitializer.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
35 changes: 35 additions & 0 deletions Mobile.UITest/Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.IO;
using System.Linq;
using NUnit.Framework;
using Xamarin.UITest;
using Xamarin.UITest.Queries;

namespace Mobile.UITest
{
[TestFixture(Platform.Android)]
[TestFixture(Platform.iOS)]
public class Tests
{
IApp app;
Platform platform;

public Tests(Platform platform)
{
this.platform = platform;
}

[SetUp]
public void BeforeEachTest()
{
app = AppInitializer.StartApp(platform);
}

[Test]
public void AppLaunches()
{
app.Screenshot("First screen.");
}
}
}

6 changes: 6 additions & 0 deletions Mobile.UITest/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.4" targetFramework="net45" />
<package id="NUnitTestAdapter" version="1.2" targetFramework="net45" />
<package id="Xamarin.UITest" version="0.7.2" targetFramework="net45" />
</packages>
38 changes: 38 additions & 0 deletions Mobile.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
CHECKLIST.md = CHECKLIST.md
LICENSE = LICENSE
README.md = README.md
ToDo.txt = ToDo.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "4 - Framework", "4 - Framework", "{8499C92C-74A7-4FF8-890A-FA9EC918FF55}"
Expand All @@ -34,6 +35,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiRepository", "ApiReposit
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Interfaces", "Interfaces\Interfaces.csproj", "{75222DEB-9D16-49CE-92F0-01A707270A51}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "5 - Tests", "5 - Tests", "{E161DF30-3040-423B-B8CD-21861B8C049F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mobile.UITest", "Mobile.UITest\Mobile.UITest.csproj", "{584F4F30-0140-4296-ACD7-03F0DA91682E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
Expand Down Expand Up @@ -354,6 +359,38 @@ Global
{75222DEB-9D16-49CE-92F0-01A707270A51}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{75222DEB-9D16-49CE-92F0-01A707270A51}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{75222DEB-9D16-49CE-92F0-01A707270A51}.Release|x86.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Ad-Hoc|Mixed Platforms.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Ad-Hoc|Mixed Platforms.Build.0 = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.AppStore|Any CPU.Build.0 = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.AppStore|ARM.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.AppStore|iPhone.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.AppStore|Mixed Platforms.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.AppStore|Mixed Platforms.Build.0 = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.AppStore|x86.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Debug|ARM.ActiveCfg = Debug|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Debug|x86.ActiveCfg = Debug|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Release|Any CPU.Build.0 = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Release|ARM.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Release|iPhone.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{584F4F30-0140-4296-ACD7-03F0DA91682E}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -367,5 +404,6 @@ Global
{FFDA80E4-B674-4E70-9FB8-7958BC824614} = {8499C92C-74A7-4FF8-890A-FA9EC918FF55}
{67F9D3A8-F71E-4428-913F-C37AE82CDB24} = {8499C92C-74A7-4FF8-890A-FA9EC918FF55}
{75222DEB-9D16-49CE-92F0-01A707270A51} = {8499C92C-74A7-4FF8-890A-FA9EC918FF55}
{584F4F30-0140-4296-ACD7-03F0DA91682E} = {E161DF30-3040-423B-B8CD-21861B8C049F}
EndGlobalSection
EndGlobal
Loading

0 comments on commit 0988851

Please sign in to comment.