Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial project for MonoDroid RxUI.Mobile

  • Loading branch information...
commit 6bf1a57925887572a704065bf7659fa5f81d2c70 1 parent fced114
@paulcbetts paulcbetts authored
View
35 ReactiveUI.Mobile/AutoSuspendActivityHelper.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Reactive;
+using Android.App;
+
+namespace ReactiveUI.Mobile
+{
+ class AndroidSuspensionHost : ISuspensionHost
+ {
+ internal static ISuspensionHost inner { get; set; }
+
+ static AndroidSuspensionHost()
+ {
+ inner = new SuspensionHost();
+ }
+
+ public IObservable<Unit> IsLaunchingNew { get { return inner.IsLaunchingNew; } }
+ public IObservable<Unit> IsResuming { get { return inner.IsResuming; } }
+ public IObservable<Unit> IsUnpausing { get { return inner.IsUnpausing; } }
+ public IObservable<IDisposable> ShouldPersistState { get { return inner.ShouldPersistState; } }
+ public IObservable<Unit> ShouldInvalidateState { get { return inner.ShouldInvalidateState; } }
+
+ public void SetupDefaultSuspendResume(ISuspensionDriver driver = null)
+ {
+ inner.SetupDefaultSuspendResume(driver);
+ }
+ }
+
+ public class AutoSuspendActivityHelper
+ {
+ public AutoSuspendActivityHelper(Activity hostActivity)
+ {
+ }
+ }
+}
+
View
156 ReactiveUI.Mobile/ReactiveUI.Mobile_Monodroid.csproj
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>10.0.0</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{A92E477B-BB94-43C1-984E-E177EF9FEDB1}</ProjectGuid>
+ <ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>ReactiveUI.Mobile</RootNamespace>
+ <AssemblyName>ReactiveUI.Mobile_Monodroid</AssemblyName>
+ <FileAlignment>512</FileAlignment>
+ <SccProjectName>
+ </SccProjectName>
+ <SccLocalPath>
+ </SccLocalPath>
+ <SccAuxPath>
+ </SccAuxPath>
+ <SccProvider>
+ </SccProvider>
+ <CodeContractsAssemblyMode>1</CodeContractsAssemblyMode>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>True</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>False</Optimize>
+ <OutputPath>bin\Debug\Monodroid</OutputPath>
+ <DefineConstants>DEBUG;TRACE; MONO; ANDROID</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CodeContractsEnableRuntimeChecking>False</CodeContractsEnableRuntimeChecking>
+ <CodeContractsRuntimeOnlyPublicSurface>True</CodeContractsRuntimeOnlyPublicSurface>
+ <CodeContractsRuntimeThrowOnFailure>False</CodeContractsRuntimeThrowOnFailure>
+ <CodeContractsRuntimeCallSiteRequires>False</CodeContractsRuntimeCallSiteRequires>
+ <CodeContractsRunCodeAnalysis>False</CodeContractsRunCodeAnalysis>
+ <CodeContractsNonNullObligations>False</CodeContractsNonNullObligations>
+ <CodeContractsBoundsObligations>True</CodeContractsBoundsObligations>
+ <CodeContractsArithmeticObligations>False</CodeContractsArithmeticObligations>
+ <CodeContractsContainerAnalysis>False</CodeContractsContainerAnalysis>
+ <CodeContractsRedundantAssumptions>False</CodeContractsRedundantAssumptions>
+ <CodeContractsRunInBackground>True</CodeContractsRunInBackground>
+ <CodeContractsShowSquigglies>False</CodeContractsShowSquigglies>
+ <CodeContractsUseBaseLine>False</CodeContractsUseBaseLine>
+ <CodeContractsEmitXMLDocs>False</CodeContractsEmitXMLDocs>
+ <CodeContractsCustomRewriterAssembly />
+ <CodeContractsCustomRewriterClass />
+ <CodeContractsLibPaths />
+ <CodeContractsExtraRewriteOptions />
+ <CodeContractsExtraAnalysisOptions />
+ <CodeContractsBaseLineFile />
+ <CodeContractsCacheAnalysisResults>False</CodeContractsCacheAnalysisResults>
+ <CodeContractsRuntimeCheckingLevel>Full</CodeContractsRuntimeCheckingLevel>
+ <CodeContractsReferenceAssembly>%28none%29</CodeContractsReferenceAssembly>
+ <CodeAnalysisRuleSet>ExtendedCorrectnessRules.ruleset</CodeAnalysisRuleSet>
+ <RunCodeAnalysis>false</RunCodeAnalysis>
+ <CodeContractsPointerObligations>False</CodeContractsPointerObligations>
+ <AndroidLinkMode>None</AndroidLinkMode>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>True</Optimize>
+ <OutputPath>bin\Release\Monodroid</OutputPath>
+ <DefineConstants>TRACE; MONO; ANDROID</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CodeContractsEnableRuntimeChecking>False</CodeContractsEnableRuntimeChecking>
+ <CodeContractsRuntimeOnlyPublicSurface>False</CodeContractsRuntimeOnlyPublicSurface>
+ <CodeContractsRuntimeThrowOnFailure>True</CodeContractsRuntimeThrowOnFailure>
+ <CodeContractsRuntimeCallSiteRequires>False</CodeContractsRuntimeCallSiteRequires>
+ <CodeContractsRunCodeAnalysis>True</CodeContractsRunCodeAnalysis>
+ <CodeContractsNonNullObligations>False</CodeContractsNonNullObligations>
+ <CodeContractsBoundsObligations>False</CodeContractsBoundsObligations>
+ <CodeContractsArithmeticObligations>False</CodeContractsArithmeticObligations>
+ <CodeContractsContainerAnalysis>False</CodeContractsContainerAnalysis>
+ <CodeContractsRedundantAssumptions>False</CodeContractsRedundantAssumptions>
+ <CodeContractsRunInBackground>True</CodeContractsRunInBackground>
+ <CodeContractsShowSquigglies>True</CodeContractsShowSquigglies>
+ <CodeContractsUseBaseLine>False</CodeContractsUseBaseLine>
+ <CodeContractsEmitXMLDocs>False</CodeContractsEmitXMLDocs>
+ <CodeContractsCustomRewriterAssembly />
+ <CodeContractsCustomRewriterClass />
+ <CodeContractsLibPaths />
+ <CodeContractsExtraRewriteOptions />
+ <CodeContractsExtraAnalysisOptions />
+ <CodeContractsBaseLineFile />
+ <CodeContractsCacheAnalysisResults>True</CodeContractsCacheAnalysisResults>
+ <CodeContractsRuntimeCheckingLevel>Full</CodeContractsRuntimeCheckingLevel>
+ <CodeContractsReferenceAssembly>%28none%29</CodeContractsReferenceAssembly>
+ <AndroidLinkMode>SdkOnly</AndroidLinkMode>
+ <AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Runtime.Serialization" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Reactive.Core">
+ <HintPath>..\ext\monodroid\System.Reactive.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Reactive.Interfaces">
+ <HintPath>..\ext\monodroid\System.Reactive.Interfaces.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Reactive.Linq">
+ <HintPath>..\ext\monodroid\System.Reactive.Linq.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Reactive.PlatformServices">
+ <HintPath>..\ext\monodroid\System.Reactive.PlatformServices.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Reactive.Providers">
+ <HintPath>..\ext\monodroid\System.Reactive.Providers.dll</HintPath>
+ </Reference>
+ <Reference Include="Xamarin.Mobile">
+ <HintPath>..\ext\monodroid\Xamarin.Mobile.dll</HintPath>
+ </Reference>
+ <Reference Include="Mono.Android" />
+ <Reference Include="Mono.Android.Support.v4" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Interfaces.cs" />
+ <Compile Include="ServiceLocationRegistration.cs" />
+ <Compile Include="SuspensionHost.cs" />
+ <Compile Include="AutoSuspendActivityHelper.cs" />
+ <Compile Include="Geolocation.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
+ <ItemGroup>
+ <ProjectReference Include="..\ReactiveUI\ReactiveUI_Monodroid.csproj">
+ <Project>{F92A477B-BB94-43C1-984E-E177EF9FEDB7}</Project>
+ <Name>ReactiveUI_Monodroid</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\ReactiveUI.Xaml\ReactiveUI.Xaml_Monodroid.csproj">
+ <Project>{E92A477B-BB94-43C1-984E-E177EF9FEDB7}</Project>
+ <Name>ReactiveUI.Xaml_Monodroid</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\ReactiveUI.Routing\ReactiveUI.Routing_Monodroid.csproj">
+ <Project>{E92E477B-BB94-43C1-984E-E177EF9FEDB7}</Project>
+ <Name>ReactiveUI.Routing_Monodroid</Name>
+ </ProjectReference>
+ </ItemGroup>
+</Project>
View
20 ReactiveUI.Mobile/SuspensionHost.cs
@@ -4,19 +4,33 @@
namespace ReactiveUI.Mobile
{
- public class SuspensionHost
+ public class SuspensionHost : ISuspensionHost
{
public IObservable<Unit> IsLaunchingNew { get; set; }
public IObservable<Unit> IsResuming { get; set; }
public IObservable<Unit> IsUnpausing { get; set; }
public IObservable<IDisposable> ShouldPersistState { get; set; }
public IObservable<Unit> ShouldInvalidateState { get; set; }
+ public Action<ISuspensionDriver> SetupDefaultSuspendResumeFunc { get; set; }
public SuspensionHost()
{
+#if UIKIT
+ var message = "Your AppDelegate class needs to derive from AutoSuspendAppDelegate";
+#elif ANDROID
+ var message = "Your Activities need to instantiate AutoSuspendActivityHelper";
+#else
+ var message = "Your App class needs to derive from AutoSuspendApplication";
+#endif
+
IsLaunchingNew = IsResuming = IsUnpausing = ShouldInvalidateState =
- Observable.Throw<Unit>(new Exception("Your App class needs to derive from AutoSuspendApplication"));
- ShouldPersistState = Observable.Throw<IDisposable>(new Exception("Your App class needs to derive from AutoSuspendApplication"));
+ Observable.Throw<Unit>(new Exception(message));
+ ShouldPersistState = Observable.Throw<IDisposable>(new Exception(message));
+ }
+
+ public void SetupDefaultSuspendResume(ISuspensionDriver driver = null)
+ {
+ SetupDefaultSuspendResume(driver);
}
}
}
View
1  ReactiveUI/Properties/AssemblyInfo.cs
@@ -42,3 +42,4 @@
[assembly: InternalsVisibleTo("ReactiveUI.Mobile_WinRT")]
[assembly: InternalsVisibleTo("ReactiveUI.Mobile_WP8")]
[assembly: InternalsVisibleTo("ReactiveUI.Mobile_Monotouch")]
+[assembly: InternalsVisibleTo("ReactiveUI.Mobile_Monodroid")]
View
28 ReactiveUI_Mono.sln
@@ -44,6 +44,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactiveUI.Android", "React
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iOSPlayground", "iOSPlayground\iOSPlayground.csproj", "{420CF325-38B9-4B30-8978-D519EC40B6A8}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactiveUI.Mobile_Monodroid", "ReactiveUI.Mobile\ReactiveUI.Mobile_Monodroid.csproj", "{A92E477B-BB94-43C1-984E-E177EF9FEDB1}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -373,6 +375,32 @@ Global
{9891337A-9E94-4DBD-801E-05E1FDA78FFC}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{9891337A-9E94-4DBD-801E-05E1FDA78FFC}.Release|x86.ActiveCfg = Release|Any CPU
{9891337A-9E94-4DBD-801E-05E1FDA78FFC}.Release|x86.Build.0 = Release|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.AppStore|Any CPU.Build.0 = Release|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.AppStore|iPhone.ActiveCfg = Release|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.AppStore|iPhone.Build.0 = Release|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Debug|x86.Build.0 = Debug|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Release|iPhone.Build.0 = Release|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Release|x86.ActiveCfg = Release|Any CPU
+ {A92E477B-BB94-43C1-984E-E177EF9FEDB1}.Release|x86.Build.0 = Release|Any CPU
{D444AA58-1C6B-4CEE-B5F5-76145E0B86E5}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{D444AA58-1C6B-4CEE-B5F5-76145E0B86E5}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{D444AA58-1C6B-4CEE-B5F5-76145E0B86E5}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
Please sign in to comment.
Something went wrong with that request. Please try again.