Merge branch 'vnext' of github.com:pazof/yavsc into vnext
114
Assets/Icon-set-users.svg
Normal file
|
After Width: | Height: | Size: 20 KiB |
71
BookAStar/BookAStar.Droid/Assets/test.html
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="stylesheet" href="quill.snow.css" />
|
||||||
|
<style>
|
||||||
|
.standalone-container {
|
||||||
|
margin: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
#bubble-container {
|
||||||
|
width:100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
#bubble-container div.ql-editor {
|
||||||
|
margin-top:0;
|
||||||
|
}
|
||||||
|
.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Title</h1>
|
||||||
|
<div class="standalone-container">
|
||||||
|
<div id="bubble-container"><h1><strong>Hello Estimate!</strong></h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="quill.min.js"></script>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="showdown.js"></script>
|
||||||
|
<script type="text/javascript" src="to-markdown.js"></script>
|
||||||
|
<script type="text/javascript" src="md-helpers.js"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var toolbarOptions = [
|
||||||
|
['bold', 'italic', 'underline', 'strike'], // toggled buttons
|
||||||
|
['blockquote', 'code-block'],
|
||||||
|
|
||||||
|
[{ 'header': 1 }, { 'header': 2 }], // custom button values
|
||||||
|
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
|
||||||
|
[{ 'indent': '-1' }, { 'indent': '+1' }], // outdent/indent
|
||||||
|
|
||||||
|
['clean'] // remove formatting button
|
||||||
|
];
|
||||||
|
|
||||||
|
var quill = new Quill('#bubble-container', {
|
||||||
|
modules: {
|
||||||
|
toolbar: toolbarOptions
|
||||||
|
},
|
||||||
|
placeholder: 'Composez votre texte ...',
|
||||||
|
theme: 'snow'
|
||||||
|
});
|
||||||
|
|
||||||
|
function getMD() {
|
||||||
|
return markdownize($('#bubble-container div.ql-editor').html())
|
||||||
|
}
|
||||||
|
quill.on('text-change', function (delta, oldDelta, source)
|
||||||
|
{
|
||||||
|
if (source === "user") {
|
||||||
|
$.get("file:validate?md=" + encodeURIComponent(getMD()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>0</WarningLevel>
|
||||||
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
|
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
|
||||||
<AndroidLinkMode>None</AndroidLinkMode>
|
<AndroidLinkMode>None</AndroidLinkMode>
|
||||||
<EmbedAssembliesIntoApk>False</EmbedAssembliesIntoApk>
|
<EmbedAssembliesIntoApk>False</EmbedAssembliesIntoApk>
|
||||||
|
|
@ -42,6 +42,10 @@
|
||||||
<JavaMaximumHeapSize>1100m</JavaMaximumHeapSize>
|
<JavaMaximumHeapSize>1100m</JavaMaximumHeapSize>
|
||||||
<Debugger>Xamarin</Debugger>
|
<Debugger>Xamarin</Debugger>
|
||||||
<AndroidEnableMultiDex>False</AndroidEnableMultiDex>
|
<AndroidEnableMultiDex>False</AndroidEnableMultiDex>
|
||||||
|
<CodeAnalysisRuleSet />
|
||||||
|
<AotAssemblies>False</AotAssemblies>
|
||||||
|
<EnableLLVM>False</EnableLLVM>
|
||||||
|
<EnableProguard>False</EnableProguard>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
|
|
@ -62,45 +66,103 @@
|
||||||
<AndroidEnableMultiDex>False</AndroidEnableMultiDex>
|
<AndroidEnableMultiDex>False</AndroidEnableMultiDex>
|
||||||
<EnableProguard>False</EnableProguard>
|
<EnableProguard>False</EnableProguard>
|
||||||
<DebugSymbols>False</DebugSymbols>
|
<DebugSymbols>False</DebugSymbols>
|
||||||
|
<CodeAnalysisRuleSet />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="DeviceInfo.Plugin, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="ExifLib, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<HintPath>..\..\packages\ExifLib.PCL.1.0.1\lib\portable-net45+sl50+win+WindowsPhoneApp81+wp80+Xamarin.iOS10+MonoAndroid10+MonoTouch10\ExifLib.dll</HintPath>
|
||||||
<HintPath>..\..\packages\Xam.Plugin.DeviceInfo.1.0.0.2\lib\MonoAndroid10\DeviceInfo.Plugin.dll</HintPath>
|
<Private>True</Private>
|
||||||
</Reference>
|
|
||||||
<Reference Include="DeviceInfo.Plugin.Abstractions, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<SpecificVersion>False</SpecificVersion>
|
|
||||||
<HintPath>..\..\packages\Xam.Plugin.DeviceInfo.1.0.0.2\lib\MonoAndroid10\DeviceInfo.Plugin.Abstractions.dll</HintPath>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FormsViewGroup, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="FormsViewGroup, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.0.107\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="GoogleMediaFramework">
|
||||||
|
<HintPath>..\..\Components\GoogleMediaFramework-1.0\lib\android\GoogleMediaFramework.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="MarkdownDeep, Version=1.5.2.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="MarkdownDeep, Version=1.5.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\MarkdownDeep-av.NET.1.5.2\lib\MonoAndroid10\MarkdownDeep.dll</HintPath>
|
<HintPath>..\..\packages\MarkdownDeep-av.NET.1.5.2\lib\MonoAndroid10\MarkdownDeep.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Media.Plugin, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xam.Plugin.Media.1.0.1\lib\MonoAndroid10\Media.Plugin.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<Private>True</Private>
|
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v7.0\Mono.Android.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Media.Plugin.Abstractions, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Mono.Android.Export, Version=1.0.6110.33687, Culture=neutral, PublicKeyToken=84e04ff9cfb79065, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xam.Plugin.Media.1.0.1\lib\MonoAndroid10\Media.Plugin.Abstractions.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<Private>True</Private>
|
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v7.0\Mono.Android.Export.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Mono.Android" />
|
|
||||||
<Reference Include="Mono.Data.Sqlite" />
|
<Reference Include="Mono.Data.Sqlite" />
|
||||||
<Reference Include="mscorlib" />
|
<Reference Include="mscorlib" />
|
||||||
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Plugin.Settings, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Plugin.Connectivity, Version=2.2.12.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.1.0\lib\MonoAndroid10\Plugin.Settings.dll</HintPath>
|
<HintPath>..\..\packages\Xam.Plugin.Connectivity.2.2.12\lib\MonoAndroid10\Plugin.Connectivity.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Plugin.Settings.Abstractions, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Plugin.Connectivity.Abstractions, Version=2.2.12.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.1.0\lib\MonoAndroid10\Plugin.Settings.Abstractions.dll</HintPath>
|
<HintPath>..\..\packages\Xam.Plugin.Connectivity.2.2.12\lib\MonoAndroid10\Plugin.Connectivity.Abstractions.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Plugin.CurrentActivity, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Plugin.CurrentActivity.1.0.1\lib\MonoAndroid10\Plugin.CurrentActivity.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Plugin.DeviceInfo, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Xam.Plugin.DeviceInfo.2.0.2\lib\MonoAndroid10\Plugin.DeviceInfo.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Plugin.DeviceInfo.Abstractions, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Xam.Plugin.DeviceInfo.2.0.2\lib\MonoAndroid10\Plugin.DeviceInfo.Abstractions.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Plugin.Geolocator, Version=3.0.4.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Xam.Plugin.Geolocator.3.0.4\lib\MonoAndroid10\Plugin.Geolocator.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Plugin.Geolocator.Abstractions, Version=3.0.4.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Xam.Plugin.Geolocator.3.0.4\lib\MonoAndroid10\Plugin.Geolocator.Abstractions.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Plugin.Media, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Xam.Plugin.Media.2.3.0\lib\MonoAndroid10\Plugin.Media.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Plugin.Media.Abstractions, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Xam.Plugin.Media.2.3.0\lib\MonoAndroid10\Plugin.Media.Abstractions.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Plugin.Permissions, Version=1.1.6.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Plugin.Permissions.1.1.7\lib\MonoAndroid10\Plugin.Permissions.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Plugin.Permissions.Abstractions, Version=1.1.6.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Plugin.Permissions.1.1.7\lib\MonoAndroid10\Plugin.Permissions.Abstractions.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Plugin.Settings, Version=2.5.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Xam.Plugins.Settings.2.5.1.0\lib\MonoAndroid10\Plugin.Settings.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Plugin.Settings.Abstractions, Version=2.5.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Xam.Plugins.Settings.2.5.1.0\lib\MonoAndroid10\Plugin.Settings.Abstractions.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SignaturePad, Version=1.4.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Xamarin.Controls.SignaturePad.1.4.0\lib\MonoAndroid\SignaturePad.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SQLite.Net">
|
||||||
|
<HintPath>..\..\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SQLite.Net.Async, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\SQLite.Net.Async-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.Async.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SQLite.Net.Platform.XamarinAndroid, Version=2.5.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\SQLite.Net.Platform.XamarinAndroid.2.5.1\lib\MonoAndroid\SQLite.Net.Platform.XamarinAndroid.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
|
@ -149,46 +211,103 @@
|
||||||
<HintPath>..\..\Components\xamarin.auth-1.2.3.1\lib\android\Xamarin.Auth.Android.dll</HintPath>
|
<HintPath>..\..\Components\xamarin.auth-1.2.3.1\lib\android\Xamarin.Auth.Android.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.0.107\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.Forms.Maps, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.Forms.Maps, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<HintPath>..\..\packages\Xamarin.Forms.Maps.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Maps.dll</HintPath>
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.Maps.2.3.0.107\lib\MonoAndroid10\Xamarin.Forms.Maps.dll</HintPath>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.Forms.Maps.Android">
|
<Reference Include="Xamarin.Forms.Maps.Android, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.Maps.2.3.0.107\lib\MonoAndroid10\Xamarin.Forms.Maps.Android.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Forms.Maps.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Maps.Android.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.0.107\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.0.107\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.0.107\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Xamarin.GooglePlayServices.Ads, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Xamarin.GooglePlayServices.Ads.29.0.0.1\lib\MonoAndroid41\Xamarin.GooglePlayServices.Ads.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Xamarin.GooglePlayServices.Analytics, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Xamarin.GooglePlayServices.Analytics.29.0.0.1\lib\MonoAndroid41\Xamarin.GooglePlayServices.Analytics.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.GooglePlayServices.Base, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.GooglePlayServices.Base, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.GooglePlayServices.Base.29.0.0.2\lib\MonoAndroid41\Xamarin.GooglePlayServices.Base.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.GooglePlayServices.Base.29.0.0.1\lib\MonoAndroid41\Xamarin.GooglePlayServices.Base.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.GooglePlayServices.Basement, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.GooglePlayServices.Basement, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.GooglePlayServices.Basement.29.0.0.2\lib\MonoAndroid41\Xamarin.GooglePlayServices.Basement.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.GooglePlayServices.Basement.29.0.0.1\lib\MonoAndroid41\Xamarin.GooglePlayServices.Basement.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.GooglePlayServices.Gcm, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.GooglePlayServices.Gcm, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.GooglePlayServices.Gcm.29.0.0.2\lib\MonoAndroid41\Xamarin.GooglePlayServices.Gcm.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.GooglePlayServices.Gcm.29.0.0.1\lib\MonoAndroid41\Xamarin.GooglePlayServices.Gcm.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.GooglePlayServices.Maps, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.GooglePlayServices.Maps, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.GooglePlayServices.Maps.29.0.0.2\lib\MonoAndroid41\Xamarin.GooglePlayServices.Maps.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.GooglePlayServices.Maps.29.0.0.1\lib\MonoAndroid41\Xamarin.GooglePlayServices.Maps.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.GooglePlayServices.Measurement, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.GooglePlayServices.Measurement, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.GooglePlayServices.Measurement.29.0.0.2\lib\MonoAndroid41\Xamarin.GooglePlayServices.Measurement.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.GooglePlayServices.Measurement.29.0.0.1\lib\MonoAndroid41\Xamarin.GooglePlayServices.Measurement.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Caching, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Caching.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.Caching.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Caching.Sqlite, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Caching.SQLite.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.Caching.Sqlite.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Core, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Core.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.Core.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Forms, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Forms.2.3.0-pre02\lib\monoandroid\XLabs.Forms.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Forms.Droid, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Forms.2.3.0-pre02\lib\monoandroid\XLabs.Forms.Droid.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.IOC, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.IoC.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.IOC.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Platform, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Platform.2.3.0-pre02\lib\MonoAndroid\XLabs.Platform.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Platform.Droid, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Platform.2.3.0-pre02\lib\MonoAndroid\XLabs.Platform.Droid.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Serialization, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Serialization.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.Serialization.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Serialization.Json.NET, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Serialization.JSON.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.Serialization.Json.NET.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Settings, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Settings.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.Settings.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Settings.XamSettings, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Settings.XamSettings.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.Settings.XamSettings.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
@ -203,6 +322,7 @@
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
<DependentUpon>MarkdownEditor.cshtml</DependentUpon>
|
<DependentUpon>MarkdownEditor.cshtml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="MarkdownViewRenderer.cs" />
|
||||||
<Compile Include="MarkdownWebViewClient.cs" />
|
<Compile Include="MarkdownWebViewClient.cs" />
|
||||||
<Compile Include="OAuth2\YaOAuth2Authenticator.cs" />
|
<Compile Include="OAuth2\YaOAuth2Authenticator.cs" />
|
||||||
<Compile Include="Resources\Resource.Designer.cs" />
|
<Compile Include="Resources\Resource.Designer.cs" />
|
||||||
|
|
@ -211,19 +331,26 @@
|
||||||
<Compile Include="Services\GcmRegistrationIntentService.cs" />
|
<Compile Include="Services\GcmRegistrationIntentService.cs" />
|
||||||
<Compile Include="Services\MyGcmIntentService.cs" />
|
<Compile Include="Services\MyGcmIntentService.cs" />
|
||||||
<Compile Include="Services\MyInstanceIdListener.cs" />
|
<Compile Include="Services\MyInstanceIdListener.cs" />
|
||||||
|
<Compile Include="CompatXFormsApp.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="app.config">
|
<None Include="app.config">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</None>
|
</None>
|
||||||
|
<None Include="google-services.json" />
|
||||||
<None Include="MarkdownEditor.cshtml">
|
<None Include="MarkdownEditor.cshtml">
|
||||||
<Generator>RazorTemplatePreprocessor</Generator>
|
<Generator>RazorTemplatePreprocessor</Generator>
|
||||||
<LastGenOutput>MarkdownEditor.cs</LastGenOutput>
|
<LastGenOutput>MarkdownEditor.cs</LastGenOutput>
|
||||||
<SubType>None</SubType>
|
<SubType>None</SubType>
|
||||||
</None>
|
</None>
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</None>
|
||||||
<None Include="Resources\AboutResources.txt" />
|
<None Include="Resources\AboutResources.txt" />
|
||||||
<AndroidAsset Include="Assets\AboutAssets.txt" />
|
<AndroidAsset Include="Assets\AboutAssets.txt" />
|
||||||
|
<AndroidResource Include="Resources\layout\EditEstimate.axml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</AndroidResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AndroidResource Include="Resources\drawable\icon.png" />
|
<AndroidResource Include="Resources\drawable\icon.png" />
|
||||||
|
|
@ -234,7 +361,9 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AndroidResource Include="Resources\layout\Tabbar.axml" />
|
<AndroidResource Include="Resources\layout\Tabbar.axml" />
|
||||||
<AndroidResource Include="Resources\layout\Toolbar.axml" />
|
<AndroidResource Include="Resources\layout\Toolbar.axml" />
|
||||||
<AndroidResource Include="Resources\values\styles.xml" />
|
<AndroidResource Include="Resources\values\styles.xml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</AndroidResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\Yavsc.Client\Yavsc.Client.csproj">
|
<ProjectReference Include="..\..\Yavsc.Client\Yavsc.Client.csproj">
|
||||||
|
|
@ -247,6 +376,10 @@
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<XamarinComponentReference Include="ConnectivityPlugin">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<Version>1.0.3</Version>
|
||||||
|
</XamarinComponentReference>
|
||||||
<XamarinComponentReference Include="DeviceInfoPlugin">
|
<XamarinComponentReference Include="DeviceInfoPlugin">
|
||||||
<Visible>False</Visible>
|
<Visible>False</Visible>
|
||||||
<Version>1.0.0.2</Version>
|
<Version>1.0.0.2</Version>
|
||||||
|
|
@ -255,6 +388,14 @@
|
||||||
<Visible>False</Visible>
|
<Visible>False</Visible>
|
||||||
<Version>1.0.3</Version>
|
<Version>1.0.3</Version>
|
||||||
</XamarinComponentReference>
|
</XamarinComponentReference>
|
||||||
|
<XamarinComponentReference Include="GoogleMediaFramework">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<Version>1.0</Version>
|
||||||
|
</XamarinComponentReference>
|
||||||
|
<XamarinComponentReference Include="googleplayservices">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<Version>22.0.0.0</Version>
|
||||||
|
</XamarinComponentReference>
|
||||||
<XamarinComponentReference Include="json.net">
|
<XamarinComponentReference Include="json.net">
|
||||||
<Visible>False</Visible>
|
<Visible>False</Visible>
|
||||||
<Version>7.0.1</Version>
|
<Version>7.0.1</Version>
|
||||||
|
|
@ -267,6 +408,18 @@
|
||||||
<Visible>False</Visible>
|
<Visible>False</Visible>
|
||||||
<Version>1.5.2</Version>
|
<Version>1.5.2</Version>
|
||||||
</XamarinComponentReference>
|
</XamarinComponentReference>
|
||||||
|
<XamarinComponentReference Include="signature-pad">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<Version>1.4.0.0</Version>
|
||||||
|
</XamarinComponentReference>
|
||||||
|
<XamarinComponentReference Include="xamandroidsupportv4-18">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<Version>21.0.3.0</Version>
|
||||||
|
</XamarinComponentReference>
|
||||||
|
<XamarinComponentReference Include="xamandroidsupportv7appcompat">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<Version>23.1.1.1</Version>
|
||||||
|
</XamarinComponentReference>
|
||||||
<XamarinComponentReference Include="xamarin.auth">
|
<XamarinComponentReference Include="xamarin.auth">
|
||||||
<Visible>False</Visible>
|
<Visible>False</Visible>
|
||||||
<Version>1.2.3.1</Version>
|
<Version>1.2.3.1</Version>
|
||||||
|
|
@ -288,9 +441,9 @@
|
||||||
<AndroidAsset Include="Assets\quill.min.js" />
|
<AndroidAsset Include="Assets\quill.min.js" />
|
||||||
<AndroidAsset Include="Assets\quill.core.css" />
|
<AndroidAsset Include="Assets\quill.core.css" />
|
||||||
<AndroidAsset Include="Assets\quill.bubble.css" />
|
<AndroidAsset Include="Assets\quill.bubble.css" />
|
||||||
<Content Include="PluginsHelp\ConnectivityReadme.txt" />
|
<AndroidResource Include="Resources\values\colors.xml">
|
||||||
<Content Include="PluginsHelp\GeolocatorReadme.txt" />
|
<SubType>Designer</SubType>
|
||||||
<AndroidResource Include="Resources\values\colors.xml" />
|
</AndroidResource>
|
||||||
<AndroidResource Include="Resources\values\dimens.xml" />
|
<AndroidResource Include="Resources\values\dimens.xml" />
|
||||||
<AndroidResource Include="Resources\values\strings.xml" />
|
<AndroidResource Include="Resources\values\strings.xml" />
|
||||||
<AndroidResource Include="Resources\drawable\glyphish_07_map_marker.png" />
|
<AndroidResource Include="Resources\drawable\glyphish_07_map_marker.png" />
|
||||||
|
|
@ -301,6 +454,7 @@
|
||||||
<AndroidResource Include="Resources\drawable\nfqrcode.png" />
|
<AndroidResource Include="Resources\drawable\nfqrcode.png" />
|
||||||
<AndroidResource Include="Resources\drawable\visuel_sexion.jpg" />
|
<AndroidResource Include="Resources\drawable\visuel_sexion.jpg" />
|
||||||
<AndroidResource Include="Resources\values\values-21\styles.xml" />
|
<AndroidResource Include="Resources\values\values-21\styles.xml" />
|
||||||
|
<AndroidResource Include="Resources\drawable\icon_anon.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Resources\drawable-hdpi\" />
|
<Folder Include="Resources\drawable-hdpi\" />
|
||||||
|
|
@ -312,13 +466,11 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}.</ErrorText>
|
<ErrorText>Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\..\packages\Xamarin.GooglePlayServices.Basement.29.0.0.2\build\Xamarin.GooglePlayServices.Basement.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.GooglePlayServices.Basement.29.0.0.2\build\Xamarin.GooglePlayServices.Basement.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets'))" />
|
<Error Condition="!Exists('..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets'))" />
|
||||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.2.3.0.107\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.2.3.0.107\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
|
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
<Import Project="..\..\packages\Xamarin.GooglePlayServices.Basement.29.0.0.2\build\Xamarin.GooglePlayServices.Basement.targets" Condition="Exists('..\..\packages\Xamarin.GooglePlayServices.Basement.29.0.0.2\build\Xamarin.GooglePlayServices.Basement.targets')" />
|
|
||||||
<Import Project="..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" />
|
<Import Project="..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" />
|
||||||
<Import Project="..\..\packages\Xamarin.Forms.2.3.0.107\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.0.107\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
|
<Import Project="..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- 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.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
<Target Name="BeforeBuild">
|
<Target Name="BeforeBuild">
|
||||||
|
|
|
||||||
356
BookAStar/BookAStar.Droid/CompatXFormsApp.cs
Normal file
|
|
@ -0,0 +1,356 @@
|
||||||
|
// ***********************************************************************
|
||||||
|
// Assembly : XLabs.Forms.Droid
|
||||||
|
// Author : XLabs Team
|
||||||
|
// Created : 12-27-2015
|
||||||
|
//
|
||||||
|
// Last Modified By : XLabs Team
|
||||||
|
// Last Modified On : 01-04-2016
|
||||||
|
// ***********************************************************************
|
||||||
|
// <copyright file="XFormsApp.cs" company="XLabs Team">
|
||||||
|
// Copyright (c) XLabs Team. All rights reserved.
|
||||||
|
// </copyright>
|
||||||
|
// <summary>
|
||||||
|
// This project is licensed under the Apache 2.0 license
|
||||||
|
// https://github.com/XLabs/Xamarin-Forms-Labs/blob/master/LICENSE
|
||||||
|
//
|
||||||
|
// XLabs is a open source project that aims to provide a powerfull and cross
|
||||||
|
// platform set of controls tailored to work with Xamarin Forms.
|
||||||
|
// </summary>
|
||||||
|
// ***********************************************************************
|
||||||
|
//
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
using Xamarin.Forms.Platform.Android;
|
||||||
|
using XLabs.Platform.Device;
|
||||||
|
using XLabs.Platform.Mvvm;
|
||||||
|
using XLabs.Platform.Services;
|
||||||
|
using XLabs.Platform.Services.Email;
|
||||||
|
using XLabs.Platform.Services.Geolocation;
|
||||||
|
using XLabs.Platform.Services.IO;
|
||||||
|
using XLabs.Platform.Services.Media;
|
||||||
|
using Environment = Android.OS.Environment;
|
||||||
|
|
||||||
|
namespace XLabs.Forms
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Class XFormsApplicationDroid.
|
||||||
|
/// </summary>
|
||||||
|
public class XFormsCompatApplicationDroid :
|
||||||
|
global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the destroy.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The destroy.</value>
|
||||||
|
public EventHandler<EventArgs> Destroy { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the pause.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The pause.</value>
|
||||||
|
public EventHandler<EventArgs> Pause { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the restart.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The restart.</value>
|
||||||
|
public EventHandler<EventArgs> Restart { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the resume.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The resume.</value>
|
||||||
|
public EventHandler<EventArgs> Resume { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the start.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The start.</value>
|
||||||
|
public EventHandler<EventArgs> Start { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the stop.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The stop event handler.</value>
|
||||||
|
public EventHandler<EventArgs> Stop { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when [destroy].
|
||||||
|
/// </summary>
|
||||||
|
protected override void OnDestroy()
|
||||||
|
{
|
||||||
|
var handler = this.Destroy;
|
||||||
|
if (handler != null)
|
||||||
|
{
|
||||||
|
handler(this, new EventArgs());
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called as part of the activity lifecycle when an activity is going into
|
||||||
|
/// the background, but has not (yet) been killed.
|
||||||
|
/// </summary>
|
||||||
|
/// <since version="Added in API level 1" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnResume" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnSaveInstanceState(Android.OS.Bundle)" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnStop" />
|
||||||
|
/// <remarks><para tool="javadoc-to-mdoc">Called as part of the activity lifecycle when an activity is going into
|
||||||
|
/// the background, but has not (yet) been killed. The counterpart to
|
||||||
|
/// <c><see cref="M:Android.App.Activity.OnResume" /></c>.
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">When activity B is launched in front of activity A, this callback will
|
||||||
|
/// be invoked on A. B will not be created until A's <c><see cref="M:Android.App.Activity.OnPause" /></c> returns,
|
||||||
|
/// so be sure to not do anything lengthy here.
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">This callback is mostly used for saving any persistent state the
|
||||||
|
/// activity is editing, to present a "edit in place" model to the user and
|
||||||
|
/// making sure nothing is lost if there are not enough resources to start
|
||||||
|
/// the new activity without first killing this one. This is also a good
|
||||||
|
/// place to do things like stop animations and other things that consume a
|
||||||
|
/// noticeable amount of CPU in order to make the switch to the next activity
|
||||||
|
/// as fast as possible, or to close resources that are exclusive access
|
||||||
|
/// such as the camera.
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">In situations where the system needs more memory it may kill paused
|
||||||
|
/// processes to reclaim resources. Because of this, you should be sure
|
||||||
|
/// that all of your state is saved by the time you return from
|
||||||
|
/// this function. In general <c><see cref="M:Android.App.Activity.OnSaveInstanceState(Android.OS.Bundle)" /></c> is used to save
|
||||||
|
/// per-instance state in the activity and this method is used to store
|
||||||
|
/// global persistent data (in content providers, files, etc.)
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">After receiving this call you will usually receive a following call
|
||||||
|
/// to <c><see cref="M:Android.App.Activity.OnStop" /></c> (after the next activity has been resumed and
|
||||||
|
/// displayed), however in some cases there will be a direct call back to
|
||||||
|
/// <c><see cref="M:Android.App.Activity.OnResume" /></c> without going through the stopped state.
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">
|
||||||
|
/// <i>Derived classes must call through to the super class's
|
||||||
|
/// implementation of this method. If they do not, an exception will be
|
||||||
|
/// thrown.</i>
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">
|
||||||
|
/// <format type="text/html">
|
||||||
|
/// <a href="http://developer.android.com/reference/android/app/Activity.html#onPause()" target="_blank">[Android Documentation]</a>
|
||||||
|
/// </format>
|
||||||
|
/// </para></remarks>
|
||||||
|
protected override void OnPause()
|
||||||
|
{
|
||||||
|
var handler = this.Pause;
|
||||||
|
if (handler != null)
|
||||||
|
{
|
||||||
|
handler(this, new EventArgs());
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnPause();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called after <c><see cref="M:Android.App.Activity.OnStop" /></c> when the current activity is being
|
||||||
|
/// re-displayed to the user (the user has navigated back to it).
|
||||||
|
/// </summary>
|
||||||
|
/// <since version="Added in API level 1" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnStop" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnStart" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnResume" />
|
||||||
|
/// <remarks><para tool="javadoc-to-mdoc">Called after <c><see cref="M:Android.App.Activity.OnStop" /></c> when the current activity is being
|
||||||
|
/// re-displayed to the user (the user has navigated back to it). It will
|
||||||
|
/// be followed by <c><see cref="M:Android.App.Activity.OnStart" /></c> and then <c><see cref="M:Android.App.Activity.OnResume" /></c>.
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">For activities that are using raw <c><see cref="T:Android.Database.ICursor" /></c> objects (instead of
|
||||||
|
/// creating them through
|
||||||
|
/// <c><see cref="M:Android.App.Activity.ManagedQuery(Android.Net.Uri, System.String[], System.String[], System.String[], System.String[])" /></c>,
|
||||||
|
/// this is usually the place
|
||||||
|
/// where the cursor should be required (because you had deactivated it in
|
||||||
|
/// <c><see cref="M:Android.App.Activity.OnStop" /></c>.
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">
|
||||||
|
/// <i>Derived classes must call through to the super class's
|
||||||
|
/// implementation of this method. If they do not, an exception will be
|
||||||
|
/// thrown.</i>
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">
|
||||||
|
/// <format type="text/html">
|
||||||
|
/// <a href="http://developer.android.com/reference/android/app/Activity.html#onRestart()" target="_blank">[Android Documentation]</a>
|
||||||
|
/// </format>
|
||||||
|
/// </para></remarks>
|
||||||
|
protected override void OnRestart()
|
||||||
|
{
|
||||||
|
var handler = this.Restart;
|
||||||
|
if (handler != null)
|
||||||
|
{
|
||||||
|
handler(this, new EventArgs());
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnRestart();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called after <c><see cref="M:Android.App.Activity.OnRestoreInstanceState(Android.OS.Bundle)" /></c>, <c><see cref="M:Android.App.Activity.OnRestart" /></c>, or
|
||||||
|
/// <c><see cref="M:Android.App.Activity.OnPause" /></c>, for your activity to start interacting with the user.
|
||||||
|
/// </summary>
|
||||||
|
/// <since version="Added in API level 1" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnRestoreInstanceState(Android.OS.Bundle)" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnRestart" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnPostResume" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnPause" />
|
||||||
|
/// <remarks><para tool="javadoc-to-mdoc">Called after <c><see cref="M:Android.App.Activity.OnRestoreInstanceState(Android.OS.Bundle)" /></c>, <c><see cref="M:Android.App.Activity.OnRestart" /></c>, or
|
||||||
|
/// <c><see cref="M:Android.App.Activity.OnPause" /></c>, for your activity to start interacting with the user.
|
||||||
|
/// This is a good place to begin animations, open exclusive-access devices
|
||||||
|
/// (such as the camera), etc.
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">Keep in mind that onResume is not the best indicator that your activity
|
||||||
|
/// is visible to the user; a system window such as the key guard may be in
|
||||||
|
/// front. Use <c><see cref="M:Android.App.Activity.OnWindowFocusChanged(System.Boolean)" /></c> to know for certain that your
|
||||||
|
/// activity is visible to the user (for example, to resume a game).
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">
|
||||||
|
/// <i>Derived classes must call through to the super class's
|
||||||
|
/// implementation of this method. If they do not, an exception will be
|
||||||
|
/// thrown.</i>
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">
|
||||||
|
/// <format type="text/html">
|
||||||
|
/// <a href="http://developer.android.com/reference/android/app/Activity.html#onResume()" target="_blank">[Android Documentation]</a>
|
||||||
|
/// </format>
|
||||||
|
/// </para></remarks>
|
||||||
|
protected override void OnResume()
|
||||||
|
{
|
||||||
|
var handler = this.Resume;
|
||||||
|
if (handler != null)
|
||||||
|
{
|
||||||
|
handler(this, new EventArgs());
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnResume();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called after <c><see cref="M:Android.App.Activity.OnCreate(Android.OS.Bundle)" /></c> or after <c><see cref="M:Android.App.Activity.OnRestart" /></c> when
|
||||||
|
/// the activity had been stopped, but is now again being displayed to the
|
||||||
|
/// user.
|
||||||
|
/// </summary>
|
||||||
|
/// <since version="Added in API level 1" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnCreate(Android.OS.Bundle)" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnStop" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnResume" />
|
||||||
|
/// <remarks><para tool="javadoc-to-mdoc">Called after <c><see cref="M:Android.App.Activity.OnCreate(Android.OS.Bundle)" /></c> or after <c><see cref="M:Android.App.Activity.OnRestart" /></c> when
|
||||||
|
/// the activity had been stopped, but is now again being displayed to the
|
||||||
|
/// user. It will be followed by <c><see cref="M:Android.App.Activity.OnResume" /></c>.
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">
|
||||||
|
/// <i>Derived classes must call through to the super class's
|
||||||
|
/// implementation of this method. If they do not, an exception will be
|
||||||
|
/// thrown.</i>
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">
|
||||||
|
/// <format type="text/html">
|
||||||
|
/// <a href="http://developer.android.com/reference/android/app/Activity.html#onStart()" target="_blank">[Android Documentation]</a>
|
||||||
|
/// </format>
|
||||||
|
/// </para></remarks>
|
||||||
|
protected override void OnStart()
|
||||||
|
{
|
||||||
|
var handler = this.Start;
|
||||||
|
if (handler != null)
|
||||||
|
{
|
||||||
|
handler(this, new EventArgs());
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnStart();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when you are no longer visible to the user.
|
||||||
|
/// </summary>
|
||||||
|
/// <since version="Added in API level 1" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnRestart" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnResume" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnSaveInstanceState(Android.OS.Bundle)" />
|
||||||
|
/// <altmember cref="M:Android.App.Activity.OnDestroy" />
|
||||||
|
/// <remarks><para tool="javadoc-to-mdoc">Called when you are no longer visible to the user. You will next
|
||||||
|
/// receive either <c><see cref="M:Android.App.Activity.OnRestart" /></c>, <c><see cref="M:Android.App.Activity.OnDestroy" /></c>, or nothing,
|
||||||
|
/// depending on later user activity.
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">Note that this method may never be called, in low memory situations
|
||||||
|
/// where the system does not have enough memory to keep your activity's
|
||||||
|
/// process running after its <c><see cref="M:Android.App.Activity.OnPause" /></c> method is called.
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">
|
||||||
|
/// <i>Derived classes must call through to the super class's
|
||||||
|
/// implementation of this method. If they do not, an exception will be
|
||||||
|
/// thrown.</i>
|
||||||
|
/// </para>
|
||||||
|
/// <para tool="javadoc-to-mdoc">
|
||||||
|
/// <format type="text/html">
|
||||||
|
/// <a href="http://developer.android.com/reference/android/app/Activity.html#onStop()" target="_blank">[Android Documentation]</a>
|
||||||
|
/// </format>
|
||||||
|
/// </para></remarks>
|
||||||
|
protected override void OnStop()
|
||||||
|
{
|
||||||
|
var handler = this.Stop;
|
||||||
|
if (handler != null)
|
||||||
|
{
|
||||||
|
handler(this, new EventArgs());
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnStop();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Class XFormsAppDroid.
|
||||||
|
/// </summary>
|
||||||
|
public class XFormsCompatAppDroid : XFormsApp<XFormsCompatApplicationDroid>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="XFormsAppDroid"/> class.
|
||||||
|
/// </summary>
|
||||||
|
public XFormsCompatAppDroid() { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="XFormsAppDroid"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="app">The application.</param>
|
||||||
|
public XFormsCompatAppDroid(XFormsCompatApplicationDroid app) : base(app) { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raises the back press.
|
||||||
|
/// </summary>
|
||||||
|
public void RaiseBackPress()
|
||||||
|
{
|
||||||
|
this.OnBackPress();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when [initialize].
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="app">The application.</param>
|
||||||
|
/// <param name="initServices">Should initialize services.</param>
|
||||||
|
protected override void OnInit(XFormsCompatApplicationDroid app, bool initServices = true)
|
||||||
|
{
|
||||||
|
this.AppContext.Start += (o, e) => this.OnStartup();
|
||||||
|
this.AppContext.Stop += (o, e) => this.OnClosing();
|
||||||
|
this.AppContext.Pause += (o, e) => this.OnSuspended();
|
||||||
|
this.AppContext.Resume += (o, e) => this.OnResumed();
|
||||||
|
|
||||||
|
this.AppDataDirectory = Environment.ExternalStorageDirectory.AbsolutePath;
|
||||||
|
this.Orientation = AppContext.RequestedOrientation == Android.Content.PM.ScreenOrientation.Portrait ?
|
||||||
|
Enums.Orientation.Portrait : Enums.Orientation.None;
|
||||||
|
if (initServices)
|
||||||
|
{
|
||||||
|
DependencyService.Register<TextToSpeechService>();
|
||||||
|
DependencyService.Register<Geolocator>();
|
||||||
|
DependencyService.Register<MediaPicker>();
|
||||||
|
DependencyService.Register<SoundService>();
|
||||||
|
DependencyService.Register<EmailService>();
|
||||||
|
DependencyService.Register<FileManager>();
|
||||||
|
DependencyService.Register<AndroidDevice>();
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnInit(app);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
|
||||||
// Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using a PCL then comment this file back in to use it.
|
// Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using a PCL then comment this file back in to use it.
|
||||||
using Plugin.Settings;
|
using Plugin.Settings;
|
||||||
using Plugin.Settings.Abstractions;
|
using Plugin.Settings.Abstractions;
|
||||||
|
|
@ -41,4 +41,4 @@ namespace BookAStar.Droid.Helpers
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
@ -24,6 +24,7 @@ using System.Json;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace Yavsc.Helpers
|
namespace Yavsc.Helpers
|
||||||
{
|
{
|
||||||
|
|
@ -40,8 +41,7 @@ namespace Yavsc.Helpers
|
||||||
/// <param name="pathToMethod">Path to method.</param>
|
/// <param name="pathToMethod">Path to method.</param>
|
||||||
public SimpleJsonPostMethod (string pathToMethod, string authorizationHeader = null)
|
public SimpleJsonPostMethod (string pathToMethod, string authorizationHeader = null)
|
||||||
{
|
{
|
||||||
request = (HttpWebRequest) WebRequest.Create (
|
request = (HttpWebRequest) WebRequest.Create (BasePath + pathToMethod);
|
||||||
BasePath + pathToMethod);
|
|
||||||
request.Method = "POST";
|
request.Method = "POST";
|
||||||
request.Accept = "application/json";
|
request.Accept = "application/json";
|
||||||
request.ContentType = "application/json";
|
request.ContentType = "application/json";
|
||||||
|
|
@ -84,20 +84,29 @@ namespace Yavsc.Helpers
|
||||||
public async Task<JsonValue> InvokeJson(object query)
|
public async Task<JsonValue> InvokeJson(object query)
|
||||||
{
|
{
|
||||||
|
|
||||||
JsonValue jsonDoc=null;
|
JsonValue jsonDoc=null;
|
||||||
using (Stream streamQuery = request.GetRequestStream()) {
|
using (Stream streamQuery = request.GetRequestStream()) {
|
||||||
using (StreamWriter writer = new StreamWriter(streamQuery)) {
|
using (StreamWriter writer = new StreamWriter(streamQuery)) {
|
||||||
writer.Write (JsonConvert.SerializeObject(query));
|
writer.Write (JsonConvert.SerializeObject(query));
|
||||||
}}
|
}}
|
||||||
using (WebResponse response = request.GetResponse ()) {
|
try
|
||||||
using (Stream stream = response.GetResponseStream ()) {
|
{
|
||||||
if (stream.Length>0)
|
using (WebResponse response = request.GetResponse())
|
||||||
jsonDoc = await Task.Run (() => JsonObject.Load (stream));
|
{
|
||||||
}
|
using (Stream stream = response.GetResponseStream())
|
||||||
response.Close();
|
{
|
||||||
}
|
if (stream.Length > 0)
|
||||||
|
jsonDoc = await Task.Run(() => JsonObject.Load(stream));
|
||||||
|
}
|
||||||
|
response.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (WebException ex)
|
||||||
|
{
|
||||||
|
// TODO err logging
|
||||||
|
Debug.Print($"Web request failed: {request.ToString()}\n" + ex.ToString());
|
||||||
|
}
|
||||||
return jsonDoc;
|
return jsonDoc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,44 +1,104 @@
|
||||||
using System;
|
using Android.App;
|
||||||
|
|
||||||
using Android.App;
|
|
||||||
using Android.Content.PM;
|
|
||||||
using Android.Widget;
|
|
||||||
using Android.OS;
|
|
||||||
using Android.Content;
|
using Android.Content;
|
||||||
|
using Android.Content.PM;
|
||||||
using Android.Gms.Common;
|
using Android.Gms.Common;
|
||||||
|
using Android.OS;
|
||||||
|
using Android.Speech.Tts;
|
||||||
using Android.Util;
|
using Android.Util;
|
||||||
|
using Android.Widget;
|
||||||
using Xamarin.Auth;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using System.Net;
|
|
||||||
using System.IO;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Text;
|
|
||||||
using BookAStar.Model.Auth.Account;
|
|
||||||
using BookAStar.Droid.OAuth;
|
using BookAStar.Droid.OAuth;
|
||||||
|
using BookAStar.Helpers;
|
||||||
|
using BookAStar.Interfaces;
|
||||||
|
using BookAStar.Model.Auth.Account;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using Plugin.DeviceInfo;
|
||||||
|
using SQLite.Net;
|
||||||
|
using SQLite.Net.Platform.XamarinAndroid;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Xamarin.Auth;
|
||||||
|
using XLabs;
|
||||||
|
using XLabs.Caching;
|
||||||
|
using XLabs.Caching.SQLite;
|
||||||
|
using XLabs.Enums;
|
||||||
|
using XLabs.Forms;
|
||||||
|
using XLabs.Forms.Services;
|
||||||
|
using XLabs.Ioc;
|
||||||
|
using XLabs.Platform.Device;
|
||||||
|
using XLabs.Platform.Mvvm;
|
||||||
|
using XLabs.Platform.Services;
|
||||||
|
using XLabs.Platform.Services.Email;
|
||||||
|
using XLabs.Platform.Services.Media;
|
||||||
|
using XLabs.Serialization;
|
||||||
|
using XLabs.Serialization.JsonNET;
|
||||||
using Yavsc.Helpers;
|
using Yavsc.Helpers;
|
||||||
using Yavsc.Models.Identity;
|
using Yavsc.Models.Identity;
|
||||||
using static Android.Content.Res.Resources;
|
|
||||||
using Android.Webkit;
|
|
||||||
using Xamarin.Forms;
|
|
||||||
using Xamarin.Forms.Platform.Android;
|
|
||||||
using Android.Views;
|
|
||||||
|
|
||||||
|
|
||||||
namespace BookAStar.Droid
|
namespace BookAStar.Droid
|
||||||
{
|
{
|
||||||
[Activity(Name="fr.pschneider.bas.MainActivity", Label = "BookAStar", Icon = "@drawable/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
|
[Activity(Name="fr.pschneider.bas.MainActivity", Label = "BookAStar", Theme = "@style/MainTheme", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
|
||||||
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity,
|
public class MainActivity :
|
||||||
IPlatform
|
|
||||||
|
// global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity,
|
||||||
|
XFormsCompatApplicationDroid,
|
||||||
|
IPlatform, IComponentContext
|
||||||
{
|
{
|
||||||
protected override void OnCreate(Bundle bundle)
|
protected override void OnCreate(Bundle bundle)
|
||||||
{
|
{
|
||||||
|
|
||||||
TabLayoutResource = Resource.Layout.Tabbar;
|
TabLayoutResource = Resource.Layout.Tabbar;
|
||||||
ToolbarResource = Resource.Layout.Toolbar;
|
ToolbarResource = Resource.Layout.Toolbar;
|
||||||
|
|
||||||
|
base.OnCreate(bundle);
|
||||||
|
SetPersistent(true);
|
||||||
|
// global::Xamarin.Forms.Forms.SetTitleBarVisibility(Xamarin.Forms.AndroidTitleBarVisibility.Never);
|
||||||
|
|
||||||
|
//var tb = FindViewById<Android.Support.V7.Widget.Toolbar>(ToolbarResource);
|
||||||
|
// FIXME tb is null
|
||||||
|
var stb = new Android.Support.V7.Widget.Toolbar(this);
|
||||||
|
SetSupportActionBar(stb);
|
||||||
|
var tb = new Toolbar(this);
|
||||||
|
SetActionBar(tb);
|
||||||
|
|
||||||
|
if (Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat)
|
||||||
|
{
|
||||||
|
Android.Webkit.WebView.SetWebContentsDebuggingEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
IXFormsApp<XFormsCompatApplicationDroid> app =null;
|
||||||
|
if (!Resolver.IsSet)
|
||||||
|
{
|
||||||
|
var xfapp = new XFormsCompatAppDroid();
|
||||||
|
this.SetIoc(xfapp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
app = Resolver.Resolve<IXFormsApp>() as IXFormsApp<XFormsCompatApplicationDroid>;
|
||||||
|
if (app != null)
|
||||||
|
app.AppContext = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
global::Xamarin.Forms.Forms.Init(this, bundle);
|
||||||
|
global::Xamarin.FormsMaps.Init(this, bundle);
|
||||||
|
|
||||||
|
Xamarin.Forms.Forms.ViewInitialized += (sender, e) =>
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrWhiteSpace(e.View.StyleId))
|
||||||
|
{
|
||||||
|
e.NativeView.ContentDescription = e.View.StyleId;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var fapp = new BookAStar.App(this);
|
||||||
|
LoadApplication(fapp);
|
||||||
|
// TabLayoutResource = Resource.Layout.Tabbar;
|
||||||
|
// ToolbarResource = Resource.Layout.Toolbar;
|
||||||
|
/*
|
||||||
base.OnCreate(bundle);
|
base.OnCreate(bundle);
|
||||||
global::Xamarin.Forms.Forms.Init(this, bundle);
|
global::Xamarin.Forms.Forms.Init(this, bundle);
|
||||||
global::Xamarin.FormsMaps.Init(this, bundle);
|
global::Xamarin.FormsMaps.Init(this, bundle);
|
||||||
|
|
@ -46,8 +106,35 @@ namespace BookAStar.Droid
|
||||||
/* var x = typeof(Themes.DarkThemeResources);
|
/* var x = typeof(Themes.DarkThemeResources);
|
||||||
x = typeof(Themes.LightThemeResources);
|
x = typeof(Themes.LightThemeResources);
|
||||||
x = typeof(Themes.Android.UnderlineEffect); */
|
x = typeof(Themes.Android.UnderlineEffect); */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private SimpleContainer SetIoc(XFormsCompatAppDroid app)
|
||||||
|
{
|
||||||
|
var resolverContainer = new SimpleContainer();
|
||||||
|
|
||||||
|
|
||||||
|
app.Init(this);
|
||||||
|
|
||||||
|
var documents = app.AppDataDirectory;
|
||||||
|
var pathToDatabase = Path.Combine(documents, "xforms.db");
|
||||||
|
|
||||||
|
resolverContainer.Register<IDevice>(t => AndroidDevice.CurrentDevice)
|
||||||
|
.Register<IDisplay>(t => t.Resolve<IDevice>().Display)
|
||||||
|
.Register<IFontManager>(t => new FontManager(t.Resolve<IDisplay>()))
|
||||||
|
.Register<IEmailService, EmailService>()
|
||||||
|
.Register<IMediaPicker, MediaPicker>()
|
||||||
|
.Register<ITextToSpeechService, XLabs.Platform.Services.TextToSpeechService>()
|
||||||
|
.Register<IDependencyContainer>(resolverContainer)
|
||||||
|
.Register<IXFormsApp>(app)
|
||||||
|
.Register<ISecureStorage>(t => new KeyVaultStorage(t.Resolve<IDevice>().Id.ToCharArray()))
|
||||||
|
.Register<IJsonSerializer, JsonSerializer>()
|
||||||
|
.Register<ICacheProvider>(
|
||||||
|
t => new SQLiteSimpleCache(new SQLitePlatformAndroid(),
|
||||||
|
new SQLiteConnectionString(pathToDatabase, true), t.Resolve<IJsonSerializer>()));
|
||||||
|
Resolver.SetResolver(resolverContainer.GetResolver());
|
||||||
|
return resolverContainer;
|
||||||
|
}
|
||||||
|
|
||||||
public bool EnablePushNotifications(bool enable)
|
public bool EnablePushNotifications(bool enable)
|
||||||
{
|
{
|
||||||
|
|
@ -66,6 +153,11 @@ namespace BookAStar.Droid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public App AppContext
|
||||||
|
{
|
||||||
|
get;set;
|
||||||
|
}
|
||||||
|
|
||||||
bool StartNotifications()
|
bool StartNotifications()
|
||||||
{
|
{
|
||||||
if (IsPlayServicesAvailable(out gCMStatusMessage))
|
if (IsPlayServicesAvailable(out gCMStatusMessage))
|
||||||
|
|
@ -87,11 +179,11 @@ namespace BookAStar.Droid
|
||||||
{
|
{
|
||||||
|
|
||||||
var accStore = AccountStore.Create(this);
|
var accStore = AccountStore.Create(this);
|
||||||
var accounts = accStore.FindAccountsForService(MainSettings.ApplicationName);
|
var accounts = accStore.FindAccountsForService(Constants.ApplicationName);
|
||||||
|
|
||||||
accStore.Delete(
|
accStore.Delete(
|
||||||
accounts.Where(a => a.Username == userName).FirstOrDefault()
|
accounts.Where(a => a.Username == userName).FirstOrDefault()
|
||||||
, MainSettings.ApplicationName);
|
, Constants.ApplicationName);
|
||||||
Toast.MakeText(this,
|
Toast.MakeText(this,
|
||||||
Resource.String.yavscIdentRemoved
|
Resource.String.yavscIdentRemoved
|
||||||
, ToastLength.Short);
|
, ToastLength.Short);
|
||||||
|
|
@ -116,7 +208,7 @@ namespace BookAStar.Droid
|
||||||
{
|
{
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
App.CurrentApp.ShowBookQuery(
|
App.ShowBookQuery(
|
||||||
await DataManager.Current.BookQueries.Get(queryId));
|
await DataManager.Current.BookQueries.Get(queryId));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -160,7 +252,7 @@ namespace BookAStar.Droid
|
||||||
using (var reader = new StreamReader(response.GetResponseStream()))
|
using (var reader = new StreamReader(response.GetResponseStream()))
|
||||||
{
|
{
|
||||||
responseText = reader.ReadToEnd();
|
responseText = reader.ReadToEnd();
|
||||||
Log.Debug(MainSettings.ApplicationName, responseText);
|
Log.Debug(Constants.ApplicationName, responseText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -180,7 +272,7 @@ namespace BookAStar.Droid
|
||||||
{
|
{
|
||||||
return await Task.Run(() => {
|
return await Task.Run(() => {
|
||||||
var manager = AccountStore.Create(this);
|
var manager = AccountStore.Create(this);
|
||||||
return manager.FindAccountsForService(MainSettings.ApplicationName);
|
return manager.FindAccountsForService(Constants.ApplicationName);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
YaOAuth2Authenticator auth = new YaOAuth2Authenticator(
|
YaOAuth2Authenticator auth = new YaOAuth2Authenticator(
|
||||||
|
|
@ -215,7 +307,7 @@ namespace BookAStar.Droid
|
||||||
|
|
||||||
// get me
|
// get me
|
||||||
// var request = new OAuth2Request("GET", new Uri(Constants.UserInfoUrl), null, eventArgs.Account);
|
// var request = new OAuth2Request("GET", new Uri(Constants.UserInfoUrl), null, eventArgs.Account);
|
||||||
var request = new HttpRequestMessage(HttpMethod.Get, MainSettings.UserInfoUrl);
|
var request = new HttpRequestMessage(HttpMethod.Get, Constants.UserInfoUrl);
|
||||||
|
|
||||||
request.Headers.Authorization =
|
request.Headers.Authorization =
|
||||||
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", tokens.AccessToken);
|
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", tokens.AccessToken);
|
||||||
|
|
@ -244,7 +336,7 @@ namespace BookAStar.Droid
|
||||||
};
|
};
|
||||||
|
|
||||||
MainSettings.SaveUser(newuser);
|
MainSettings.SaveUser(newuser);
|
||||||
accStore.Save(acc, MainSettings.ApplicationName);
|
accStore.Save(acc, Constants.ApplicationName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -296,7 +388,7 @@ namespace BookAStar.Droid
|
||||||
|
|
||||||
public IGCMDeclaration GetDeviceInfo()
|
public IGCMDeclaration GetDeviceInfo()
|
||||||
{
|
{
|
||||||
var devinfo = DeviceInfo.Plugin.CrossDeviceInfo.Current;
|
var devinfo = CrossDeviceInfo.Current;
|
||||||
return new GCMDeclaration
|
return new GCMDeclaration
|
||||||
{
|
{
|
||||||
DeviceId = devinfo.Id,
|
DeviceId = devinfo.Id,
|
||||||
|
|
@ -332,34 +424,28 @@ namespace BookAStar.Droid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Xamarin.Forms.View CreateMarkdownView(string markdown, Action<string> update)
|
public T Resolve<T>()
|
||||||
{
|
{
|
||||||
var view = new Android.Webkit.WebView(Forms.Context);
|
return (T) Resolver.Resolve(typeof(T));
|
||||||
var viewclient = new MarkdownWebViewClient(update);
|
}
|
||||||
view.SetWebViewClient(viewclient);
|
|
||||||
var mde = new MarkdownEditor();
|
public object Resolve(Type t)
|
||||||
if (markdown!=null)
|
{
|
||||||
{
|
return Resolver.Resolve(t);
|
||||||
var md = new MarkdownDeep.Markdown();
|
}
|
||||||
mde.Model = md.Transform(markdown);
|
|
||||||
}
|
protected override void OnSaveInstanceState(Bundle outState)
|
||||||
var html = mde.GenerateString();
|
{
|
||||||
view.Settings.BuiltInZoomControls = true;
|
base.OnSaveInstanceState(outState);
|
||||||
view.Settings.JavaScriptEnabled = true;
|
}
|
||||||
view.Settings.LoadsImagesAutomatically = true;
|
public override void OnStateNotSaved()
|
||||||
view.Settings.SetAppCacheEnabled(true);
|
{
|
||||||
view.Settings.AllowContentAccess = true;
|
base.OnStateNotSaved();
|
||||||
view.Settings.AllowFileAccess = true;
|
}
|
||||||
view.Settings.AllowFileAccessFromFileURLs = true;
|
public override void OnRestoreInstanceState(Bundle savedInstanceState, PersistableBundle persistentState)
|
||||||
view.Settings.AllowUniversalAccessFromFileURLs = true;
|
{
|
||||||
view.Settings.BlockNetworkImage = false;
|
base.OnRestoreInstanceState(savedInstanceState, persistentState);
|
||||||
view.Settings.BlockNetworkLoads = false;
|
|
||||||
view.LoadDataWithBaseURL("file:///android_asset/",
|
|
||||||
html, "text/html", "utf-8",null);
|
|
||||||
|
|
||||||
return view.ToView();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
63
BookAStar/BookAStar.Droid/MainApplication.cs
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
using Android.App;
|
||||||
|
using Android.OS;
|
||||||
|
using Android.Runtime;
|
||||||
|
using Plugin.CurrentActivity;
|
||||||
|
|
||||||
|
namespace BookAStar.Droid
|
||||||
|
{
|
||||||
|
//You can specify additional application information in this attribute
|
||||||
|
[Application]
|
||||||
|
public class MainApplication : Application, Application.IActivityLifecycleCallbacks
|
||||||
|
{
|
||||||
|
public MainApplication(IntPtr handle, JniHandleOwnership transer)
|
||||||
|
:base(handle, transer)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnCreate()
|
||||||
|
{
|
||||||
|
base.OnCreate();
|
||||||
|
RegisterActivityLifecycleCallbacks(this);
|
||||||
|
//A great place to initialize Xamarin.Insights and Dependency Services!
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnTerminate()
|
||||||
|
{
|
||||||
|
base.OnTerminate();
|
||||||
|
UnregisterActivityLifecycleCallbacks(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnActivityCreated(Activity activity, Bundle savedInstanceState)
|
||||||
|
{
|
||||||
|
CrossCurrentActivity.Current.Activity = activity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnActivityDestroyed(Activity activity)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnActivityPaused(Activity activity)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnActivityResumed(Activity activity)
|
||||||
|
{
|
||||||
|
CrossCurrentActivity.Current.Activity = activity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnActivitySaveInstanceState(Activity activity, Bundle outState)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnActivityStarted(Activity activity)
|
||||||
|
{
|
||||||
|
CrossCurrentActivity.Current.Activity = activity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnActivityStopped(Activity activity)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -17,7 +17,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
|
|
||||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorTemplatePreprocessor", "4.1.2.18")]
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorTemplatePreprocessor", "4.2.0.680")]
|
||||||
public partial class MarkdownEditor : MarkdownEditorBase
|
public partial class MarkdownEditor : MarkdownEditorBase
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -32,32 +32,30 @@ public string Model { get; set; }
|
||||||
|
|
||||||
public override void Execute()
|
public override void Execute()
|
||||||
{
|
{
|
||||||
WriteLiteral("<!DOCTYPE html>\r\n<html>\r\n<head>\r\n \r\n <meta");
|
WriteLiteral("<!DOCTYPE html>\r\n<html>\r\n<head>\r\n <meta");
|
||||||
|
|
||||||
WriteLiteral(" charset=\"utf-8\"");
|
WriteLiteral(" charset=\"utf-8\"");
|
||||||
|
|
||||||
WriteLiteral(">\r\n\r\n <link");
|
WriteLiteral(">\r\n <link");
|
||||||
|
|
||||||
WriteLiteral(" rel=\"stylesheet\"");
|
WriteLiteral(" rel=\"stylesheet\"");
|
||||||
|
|
||||||
WriteLiteral(" href=\"quill.snow.css\"");
|
WriteLiteral(" href=\"quill.snow.css\"");
|
||||||
|
|
||||||
WriteLiteral(@" />
|
WriteLiteral(@" />
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.standalone-container {
|
.standalone-container {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#bubble-container {
|
#bubble-container {
|
||||||
|
width:100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#bubble-container div.ql-editor {
|
#bubble-container div.ql-editor {
|
||||||
margin-top:3em;
|
margin-top:3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
@ -65,7 +63,6 @@ WriteLiteral(@" />
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div");
|
<div");
|
||||||
|
|
||||||
WriteLiteral(" class=\"standalone-container\"");
|
WriteLiteral(" class=\"standalone-container\"");
|
||||||
|
|
@ -77,31 +74,13 @@ WriteLiteral(" id=\"bubble-container\"");
|
||||||
WriteLiteral(">");
|
WriteLiteral(">");
|
||||||
|
|
||||||
|
|
||||||
#line 33 "MarkdownEditor.cshtml"
|
#line 28 "MarkdownEditor.cshtml"
|
||||||
Write(Html.Write(Model));
|
Write(Html.Write(Model));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral("</div>\r\n </div>\r\n <form><input");
|
WriteLiteral("</div>\r\n </div>\r\n \r\n <script");
|
||||||
|
|
||||||
WriteLiteral(" type=\"hidden\"");
|
|
||||||
|
|
||||||
WriteLiteral(" name=\"md\"");
|
|
||||||
|
|
||||||
WriteLiteral(" id=\"md\"");
|
|
||||||
|
|
||||||
WriteLiteral(" />\r\n <input");
|
|
||||||
|
|
||||||
WriteLiteral(" id=\"btnSubmit\"");
|
|
||||||
|
|
||||||
WriteLiteral(" type=\"button\"");
|
|
||||||
|
|
||||||
WriteLiteral(" value=\"Valider\"");
|
|
||||||
|
|
||||||
WriteLiteral(" class=\"hidden\"");
|
|
||||||
|
|
||||||
WriteLiteral(" /></form>\r\n <script");
|
|
||||||
|
|
||||||
WriteLiteral(" type=\"text/javascript\"");
|
WriteLiteral(" type=\"text/javascript\"");
|
||||||
|
|
||||||
|
|
@ -143,7 +122,7 @@ WriteLiteral(@">
|
||||||
[{ 'header': 1 }, { 'header': 2 }], // custom button values
|
[{ 'header': 1 }, { 'header': 2 }], // custom button values
|
||||||
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
|
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
|
||||||
[{ 'indent': '-1' }, { 'indent': '+1' }], // outdent/indent
|
[{ 'indent': '-1' }, { 'indent': '+1' }], // outdent/indent
|
||||||
|
['link', 'image', 'video'],
|
||||||
['clean'] // remove formatting button
|
['clean'] // remove formatting button
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -151,26 +130,19 @@ WriteLiteral(@">
|
||||||
modules: {
|
modules: {
|
||||||
toolbar: toolbarOptions
|
toolbar: toolbarOptions
|
||||||
},
|
},
|
||||||
placeholder: 'Composez votre texte ...',
|
placeholder: 'Composez votre texte ...',
|
||||||
theme: 'snow'
|
theme: 'snow'
|
||||||
});
|
});
|
||||||
|
|
||||||
function getMD() {
|
function getMD() {
|
||||||
return markdownize($('#bubble-container div.ql-editor').html())
|
return markdownize($('#bubble-container div.ql-editor').html())
|
||||||
}
|
|
||||||
quill.on('text-change', function (delta, oldDelta, source)
|
|
||||||
{
|
|
||||||
if (source === ""user"") {
|
|
||||||
$('#md').val(getMD());
|
|
||||||
$('#btnSubmit').removeClass('hidden');
|
|
||||||
}
|
}
|
||||||
});
|
quill.on('text-change', function (delta, oldDelta, source)
|
||||||
$(document).ready(function () {
|
{
|
||||||
$('#btnSubmit').on('click', function () {
|
if (source === ""user"") {
|
||||||
$.get(""file:validate?md="" + encodeURIComponent(getMD()),
|
invokeCSharpAction(getMD());
|
||||||
function (data, stat, jqXHR) { $('#result').html(""Okay"") })
|
}
|
||||||
})
|
});
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
|
|
@ -2,25 +2,21 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
|
||||||
<link rel="stylesheet" href="quill.snow.css" />
|
<link rel="stylesheet" href="quill.snow.css" />
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.standalone-container {
|
.standalone-container {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#bubble-container {
|
#bubble-container {
|
||||||
|
width:100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#bubble-container div.ql-editor {
|
#bubble-container div.ql-editor {
|
||||||
margin-top:3em;
|
margin-top:3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
@ -28,12 +24,10 @@
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="standalone-container">
|
<div class="standalone-container">
|
||||||
<div id="bubble-container">@Html.Write(Model)</div>
|
<div id="bubble-container">@Html.Write(Model)</div>
|
||||||
</div>
|
</div>
|
||||||
<form><input type="hidden" name="md" id="md" />
|
|
||||||
<input id="btnSubmit" type="button" value="Valider" class="hidden" /></form>
|
|
||||||
<script type="text/javascript" src="quill.min.js"></script>
|
<script type="text/javascript" src="quill.min.js"></script>
|
||||||
<script type="text/javascript" src="jquery.js"></script>
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
<script type="text/javascript" src="showdown.js"></script>
|
<script type="text/javascript" src="showdown.js"></script>
|
||||||
|
|
@ -48,7 +42,7 @@
|
||||||
[{ 'header': 1 }, { 'header': 2 }], // custom button values
|
[{ 'header': 1 }, { 'header': 2 }], // custom button values
|
||||||
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
|
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
|
||||||
[{ 'indent': '-1' }, { 'indent': '+1' }], // outdent/indent
|
[{ 'indent': '-1' }, { 'indent': '+1' }], // outdent/indent
|
||||||
|
['link', 'image', 'video'],
|
||||||
['clean'] // remove formatting button
|
['clean'] // remove formatting button
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -56,26 +50,19 @@
|
||||||
modules: {
|
modules: {
|
||||||
toolbar: toolbarOptions
|
toolbar: toolbarOptions
|
||||||
},
|
},
|
||||||
placeholder: 'Composez votre texte ...',
|
placeholder: 'Composez votre texte ...',
|
||||||
theme: 'snow'
|
theme: 'snow'
|
||||||
});
|
});
|
||||||
|
|
||||||
function getMD() {
|
function getMD() {
|
||||||
return markdownize($('#bubble-container div.ql-editor').html())
|
return markdownize($('#bubble-container div.ql-editor').html())
|
||||||
}
|
|
||||||
quill.on('text-change', function (delta, oldDelta, source)
|
|
||||||
{
|
|
||||||
if (source === "user") {
|
|
||||||
$('#md').val(getMD());
|
|
||||||
$('#btnSubmit').removeClass('hidden');
|
|
||||||
}
|
}
|
||||||
});
|
quill.on('text-change', function (delta, oldDelta, source)
|
||||||
$(document).ready(function () {
|
{
|
||||||
$('#btnSubmit').on('click', function () {
|
if (source === "user") {
|
||||||
$.get("file:validate?md=" + encodeURIComponent(getMD()),
|
invokeCSharpAction(getMD());
|
||||||
function (data, stat, jqXHR) { $('#result').html("Okay") })
|
}
|
||||||
})
|
});
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
143
BookAStar/BookAStar.Droid/MarkdownViewRenderer.cs
Normal file
|
|
@ -0,0 +1,143 @@
|
||||||
|
|
||||||
|
using BookAStar.Views;
|
||||||
|
using Android.Webkit;
|
||||||
|
using Xamarin.Forms.Platform.Android;
|
||||||
|
using BookAStar.Droid;
|
||||||
|
using System;
|
||||||
|
using Java.Interop;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using Android.Views;
|
||||||
|
|
||||||
|
[assembly: Xamarin.Forms.ExportRenderer(typeof(MarkdownView), typeof(MarkdownViewRenderer))]
|
||||||
|
namespace BookAStar.Droid
|
||||||
|
{
|
||||||
|
public class JSBridge : Java.Lang.Object
|
||||||
|
{
|
||||||
|
readonly WeakReference<MarkdownViewRenderer> hybridWebViewRenderer;
|
||||||
|
|
||||||
|
public JSBridge(MarkdownViewRenderer hybridRenderer)
|
||||||
|
{
|
||||||
|
hybridWebViewRenderer = new WeakReference<MarkdownViewRenderer>(hybridRenderer);
|
||||||
|
}
|
||||||
|
|
||||||
|
[JavascriptInterface]
|
||||||
|
[Export("invokeAction")]
|
||||||
|
public void InvokeAction(string data)
|
||||||
|
{
|
||||||
|
MarkdownViewRenderer hybridRenderer;
|
||||||
|
|
||||||
|
if (hybridWebViewRenderer != null && hybridWebViewRenderer.TryGetTarget(out hybridRenderer))
|
||||||
|
{
|
||||||
|
hybridRenderer.Element.Markdown = data;
|
||||||
|
MarkdownViewRenderer.OnPageFinished(hybridRenderer.Element,
|
||||||
|
hybridRenderer.EditorView);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MarkdownViewRenderer : ViewRenderer<MarkdownView, WebView>
|
||||||
|
{
|
||||||
|
private WebView editorView;
|
||||||
|
private MarkdownEditor editorTemplate = new MarkdownEditor();
|
||||||
|
private MarkdownDeep.Markdown markdown = new MarkdownDeep.Markdown();
|
||||||
|
const string JavaScriptFunction = "function invokeCSharpAction(data){jsBridge.invokeAction(data);}";
|
||||||
|
|
||||||
|
public WebView EditorView
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return editorView;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async void OnPageFinished(MarkdownView xview, WebView view)
|
||||||
|
{
|
||||||
|
int i = 10;
|
||||||
|
while (view.ContentHeight == 0 && i-- > 0) // wait here till content is rendered
|
||||||
|
await System.Threading.Tasks.Task.Delay(100);
|
||||||
|
xview.BatchBegin();
|
||||||
|
xview.HeightRequest = view.ContentHeight;
|
||||||
|
xview.BatchCommit();
|
||||||
|
}
|
||||||
|
private void SetMDEditorText(string text)
|
||||||
|
{
|
||||||
|
editorTemplate.Model = (text == null) ? null : markdown.Transform(text);
|
||||||
|
var html = editorTemplate.GenerateString();
|
||||||
|
EditorView.LoadDataWithBaseURL("file:///android_asset/",
|
||||||
|
html, "text/html", "utf-8", null);
|
||||||
|
OnPageFinished(Element, editorView);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnElementChanged(ElementChangedEventArgs<MarkdownView> e)
|
||||||
|
{
|
||||||
|
base.OnElementChanged(e);
|
||||||
|
if (Control == null)
|
||||||
|
{
|
||||||
|
SetNativeControl(CreateNativeControl());
|
||||||
|
}
|
||||||
|
if (e.OldElement != null)
|
||||||
|
{
|
||||||
|
// Unsubscribe
|
||||||
|
}
|
||||||
|
if (e.NewElement != null)
|
||||||
|
{
|
||||||
|
// Subscribe
|
||||||
|
var viewclient = new MarkdownWebViewClient(
|
||||||
|
md => { e.NewElement.Markdown = md; });
|
||||||
|
EditorView.SetWebViewClient(viewclient);
|
||||||
|
Control.AddJavascriptInterface(new JSBridge(this), "jsBridge");
|
||||||
|
SetMDEditorText(e.NewElement.Markdown);
|
||||||
|
InjectJS(JavaScriptFunction);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void InjectJS(string script)
|
||||||
|
{
|
||||||
|
if (Control != null)
|
||||||
|
{
|
||||||
|
Control.LoadUrl(string.Format("javascript: {0}", script));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private WebView CreateNativeControl()
|
||||||
|
{
|
||||||
|
editorView = new WebView(Context);
|
||||||
|
EditorView.Settings.BuiltInZoomControls = false;
|
||||||
|
EditorView.Settings.JavaScriptEnabled = true;
|
||||||
|
EditorView.Settings.LoadsImagesAutomatically = true;
|
||||||
|
EditorView.Settings.SetAppCacheEnabled(true);
|
||||||
|
EditorView.Settings.AllowContentAccess = true;
|
||||||
|
EditorView.Settings.AllowFileAccess = true;
|
||||||
|
EditorView.Settings.AllowFileAccessFromFileURLs = true;
|
||||||
|
EditorView.Settings.AllowUniversalAccessFromFileURLs = true;
|
||||||
|
EditorView.Settings.BlockNetworkImage = false;
|
||||||
|
EditorView.Settings.BlockNetworkLoads = false;
|
||||||
|
EditorView.Settings.DomStorageEnabled = true;
|
||||||
|
|
||||||
|
// editorView.SetMinimumHeight(300);
|
||||||
|
return EditorView;
|
||||||
|
}
|
||||||
|
// FIXME no impact...
|
||||||
|
protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
|
||||||
|
{
|
||||||
|
MeasureSpecMode widthMode = MeasureSpec.GetMode(widthMeasureSpec);
|
||||||
|
MeasureSpecMode heightMode = MeasureSpec.GetMode(heightMeasureSpec);
|
||||||
|
int widthSize = MeasureSpec.GetSize(widthMeasureSpec);
|
||||||
|
int heightSize = MeasureSpec.GetSize(heightMeasureSpec);
|
||||||
|
int pxHeight = (int)ContextExtensions.ToPixels(Context, Element.HeightRequest);
|
||||||
|
int pxWidth = (int)ContextExtensions.ToPixels(Context, Element.WidthRequest);
|
||||||
|
var measuredWidth = widthMode != MeasureSpecMode.Exactly ? (widthMode != MeasureSpecMode.AtMost ? pxHeight : Math.Min(pxHeight, widthSize)) : widthSize;
|
||||||
|
var measuredHeight = heightMode != MeasureSpecMode.Exactly ? (heightMode != MeasureSpecMode.AtMost ? pxWidth : Math.Min(pxWidth, heightSize)) : heightSize;
|
||||||
|
SetMeasuredDimension(measuredWidth, measuredHeight< Element.HeightRequest ? (int) Element.HeightRequest : measuredHeight);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
protected override void OnLayout(bool changed, int left, int top, int right, int bottom)
|
||||||
|
{
|
||||||
|
Element.Layout(new Xamarin.Forms.Rectangle(0, 0, ContextExtensions.FromPixels(Context, right - left), ContextExtensions.FromPixels(Context, bottom - top)));
|
||||||
|
base.OnLayout(changed, left, top, right, bottom);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,21 +1,10 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
using Android.App;
|
using Android.App;
|
||||||
using Android.Content;
|
|
||||||
using Android.OS;
|
|
||||||
using Android.Runtime;
|
|
||||||
using Android.Views;
|
|
||||||
using Android.Widget;
|
|
||||||
using Android.Webkit;
|
using Android.Webkit;
|
||||||
using Java.Lang;
|
|
||||||
using Java.IO;
|
|
||||||
using Android.Content.Res;
|
|
||||||
|
|
||||||
namespace BookAStar.Droid
|
namespace BookAStar.Droid
|
||||||
{
|
{
|
||||||
|
|
||||||
class MarkdownWebViewClient : WebViewClient
|
class MarkdownWebViewClient : WebViewClient
|
||||||
{
|
{
|
||||||
Action<string> update;
|
Action<string> update;
|
||||||
|
|
@ -25,7 +14,7 @@ namespace BookAStar.Droid
|
||||||
}
|
}
|
||||||
private static Activity getActivity ()
|
private static Activity getActivity ()
|
||||||
{
|
{
|
||||||
return (Activity)App.PlateformSpecificInstance;
|
return (Activity)App.PlatformSpecificInstance;
|
||||||
}
|
}
|
||||||
public string Markdown { get; private set; }
|
public string Markdown { get; private set; }
|
||||||
public override WebResourceResponse ShouldInterceptRequest(WebView view, IWebResourceRequest request)
|
public override WebResourceResponse ShouldInterceptRequest(WebView view, IWebResourceRequest request)
|
||||||
|
|
@ -34,6 +23,8 @@ namespace BookAStar.Droid
|
||||||
{
|
{
|
||||||
if (request.Url.Path=="/android_asset/validate")
|
if (request.Url.Path=="/android_asset/validate")
|
||||||
{
|
{
|
||||||
|
// TODO Better,
|
||||||
|
// by inspecting the form entries from the view
|
||||||
Markdown = request.Url.GetQueryParameter("md");
|
Markdown = request.Url.GetQueryParameter("md");
|
||||||
update(Markdown);
|
update(Markdown);
|
||||||
return new WebResourceResponse("application/json", "utf-8" ,200, "Ok", null, null);
|
return new WebResourceResponse("application/json", "utf-8" ,200, "Ok", null, null);
|
||||||
|
|
@ -41,5 +32,6 @@ namespace BookAStar.Droid
|
||||||
}
|
}
|
||||||
return base.ShouldInterceptRequest(view, request);
|
return base.ShouldInterceptRequest(view, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
Connectivity Readme
|
|
||||||
Find the most up to date information at: https://github.com/jamesmontemagno/Xamarin.Plugins
|
|
||||||
|
|
||||||
**IMPORTANT**
|
|
||||||
Android:
|
|
||||||
You must request ACCESS_NETWORK_STATE permission to get the network state
|
|
||||||
You must request ACCESS_WIFI_STATE to get speeds
|
|
||||||
|
|
||||||
iOS:
|
|
||||||
Bandwidths is not supported and will always return an empty list.
|
|
||||||
|
|
||||||
Windows 8.1 & Windows Phone 8.1 RT:
|
|
||||||
RT apps can not perform loopback, so you can not use IsReachable to query the states of a local IP.
|
|
||||||
|
|
||||||
Permissions to think about:
|
|
||||||
The Private Networks (Client & Server) capability is represented by the Capability name = "privateNetworkClientServer" tag in the app manifest.
|
|
||||||
The Internet (Client & Server) capability is represented by the Capability name = "internetClientServer" tag in the app manifest.
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
Connectivity Readme
|
|
||||||
Find the most up to date information at: https://github.com/jamesmontemagno/Xamarin.Plugins
|
|
||||||
|
|
||||||
**IMPORTANT**
|
|
||||||
Android:
|
|
||||||
You must request ACCESS_COARSE_LOCATION & ACCESS_FINE_LOCATION permission
|
|
||||||
|
|
||||||
iOS:
|
|
||||||
In iOS 8 you now have to call either RequestWhenInUseAuthorization or RequestAlwaysAuthorization on the location manager. Additionally you need to add either the concisely named NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription to your Info.plist.
|
|
||||||
See: http://motzcod.es/post/97662738237/scanning-for-ibeacons-in-ios-8
|
|
||||||
|
|
||||||
Windows Phone:
|
|
||||||
You must set the ID_CAP_LOCATION permission.
|
|
||||||
|
|
||||||
Getting Started:
|
|
||||||
|
|
||||||
var locator = CrossGeolocator.Current;
|
|
||||||
locator.DesiredAccuracy = 50;
|
|
||||||
|
|
||||||
var position = await locator.GetPositionAsync (timeout: 10000);
|
|
||||||
|
|
||||||
Console.WriteLine ("Position Status: {0}", position.Timestamp);
|
|
||||||
Console.WriteLine ("Position Latitude: {0}", position.Latitude);
|
|
||||||
Console.WriteLine ("Position Longitude: {0}", position.Longitude);
|
|
||||||
|
|
@ -13,7 +13,7 @@ using Android.App;
|
||||||
[assembly: AssemblyProduct("BookAStar.Droid")]
|
[assembly: AssemblyProduct("BookAStar.Droid")]
|
||||||
[assembly: AssemblyCopyright("Copyright © Paul Albert Schneider 2016")]
|
[assembly: AssemblyCopyright("Copyright © Paul Albert Schneider 2016")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("fr")]
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
|
|
|
||||||
7789
BookAStar/BookAStar.Droid/Resources/Resource.Designer.cs
generated
BIN
BookAStar/BookAStar.Droid/Resources/drawable/Icon-anon-48px.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
BookAStar/BookAStar.Droid/Resources/drawable/Icon-anon-64px.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
BookAStar/BookAStar.Droid/Resources/drawable/Icon-anon-73px.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
BookAStar/BookAStar.Droid/Resources/drawable/Icon-anon-org.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
BookAStar/BookAStar.Droid/Resources/drawable/icon_anon.png
Normal file
|
After Width: | Height: | Size: 1 KiB |
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
@ -1,8 +1,13 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/colorPrimary"
|
android:background="?attr/colorPrimary"
|
||||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||||
android:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
|
android:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||||
|
tools:context=".MainActivity"
|
||||||
|
app:layout_scrollFlags="scroll|enterAlways"
|
||||||
|
/>
|
||||||
|
|
@ -13,4 +13,5 @@
|
||||||
<string name="url">url</string>
|
<string name="url">url</string>
|
||||||
<string name="url_hint">url_hint</string>
|
<string name="url_hint">url_hint</string>
|
||||||
<string name="picture">picture</string>
|
<string name="picture">picture</string>
|
||||||
|
<string name="google_app_id">325408689282</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,14 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="MainTheme" parent="MainTheme.Base">
|
<style name="MainTheme" parent="MainTheme.Base">
|
||||||
|
<item name="android:windowBackground">@color/windowBackground</item>
|
||||||
|
<item name="android:windowNoTitle">true</item>
|
||||||
|
<item name="android:statusBarColor">@color/primaryDark</item>
|
||||||
|
<item name="android:colorPrimaryDark">@color/primaryDark</item>
|
||||||
|
<item name="android:windowFullscreen">true</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- Base theme applied no matter what API -->
|
<!-- Base theme applied no matter what API -->
|
||||||
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
|
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||||
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
|
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
|
||||||
|
|
@ -21,13 +27,18 @@
|
||||||
colorControlHighlight and colorSwitchThumbNormal. -->
|
colorControlHighlight and colorSwitchThumbNormal. -->
|
||||||
<item name="windowActionModeOverlay">true</item>
|
<item name="windowActionModeOverlay">true</item>
|
||||||
|
|
||||||
|
|
||||||
<item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
|
<item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
|
||||||
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
|
<!--We will be using the toolbar so no need to show ActionBar-->
|
||||||
|
<!-- <item name="android:actionBarStyle">@style/MyActionBar</item> -->
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
|
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
|
||||||
<item name="colorAccent">#FF4081</item>
|
<item name="colorAccent">#FF4081</item>
|
||||||
</style>
|
</style>
|
||||||
|
<!--
|
||||||
|
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
|
||||||
|
<item name="android:background">#A97946</item>
|
||||||
|
</style> -->
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ namespace BookAStar.Droid.Services
|
||||||
var topic = data.GetString("Topic");
|
var topic = data.GetString("Topic");
|
||||||
if (topic == "BookQuery")
|
if (topic == "BookQuery")
|
||||||
{
|
{
|
||||||
DateTime eventdate,enddate;
|
DateTime eventdate;
|
||||||
|
|
||||||
var sdatestr = data.GetString("EventDate");
|
var sdatestr = data.GetString("EventDate");
|
||||||
DateTime.TryParse(sdatestr, out eventdate);
|
DateTime.TryParse(sdatestr, out eventdate);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<runtime>
|
<runtime>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Runtime" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Drawing" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
<assemblyIdentity name="System.Drawing" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
|
||||||
|
|
@ -30,6 +34,10 @@
|
||||||
<assemblyIdentity name="System.Drawing" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
<assemblyIdentity name="System.Drawing" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="XLabs.Serialization" publicKeyToken="d65109b36e5040e4" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-2.0.5782.15703" newVersion="2.0.5782.15703" />
|
||||||
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
||||||
78
BookAStar/BookAStar.Droid/google-services.json
Normal file
|
|
@ -0,0 +1,78 @@
|
||||||
|
{
|
||||||
|
"project_info": {
|
||||||
|
"project_number": "325408689282",
|
||||||
|
"project_id": "yavsc-001"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "fr.pschneider.android.wearable.speedtracker"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "325408689282-6bekh7p3guj4k0f3301a6frf025cnrk1.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyBCAE_pc6lrxLf8_Vyho0KSxLsqjxecPFk"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"analytics_service": {
|
||||||
|
"status": 1
|
||||||
|
},
|
||||||
|
"appinvite_service": {
|
||||||
|
"status": 1,
|
||||||
|
"other_platform_oauth_client": []
|
||||||
|
},
|
||||||
|
"ads_service": {
|
||||||
|
"status": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:325408689282:android:50a2328516f10af3",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "fr.pschneider.bas"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "325408689282-emdeucmt5pr9jg7170t0q9gnndacsqqf.apps.googleusercontent.com",
|
||||||
|
"client_type": 1,
|
||||||
|
"android_info": {
|
||||||
|
"package_name": "fr.pschneider.bas",
|
||||||
|
"certificate_hash": "E97A345457861B8E2E7BA79BB814BB1ACC0471A6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"client_id": "325408689282-6bekh7p3guj4k0f3301a6frf025cnrk1.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyBCAE_pc6lrxLf8_Vyho0KSxLsqjxecPFk"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"analytics_service": {
|
||||||
|
"status": 1
|
||||||
|
},
|
||||||
|
"appinvite_service": {
|
||||||
|
"status": 1,
|
||||||
|
"other_platform_oauth_client": []
|
||||||
|
},
|
||||||
|
"ads_service": {
|
||||||
|
"status": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|
||||||
|
|
@ -1,12 +1,19 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
|
<package id="ExifLib.PCL" version="1.0.1" targetFramework="monoandroid70" />
|
||||||
<package id="MarkdownDeep-av.NET" version="1.5.2" targetFramework="monoandroid60" />
|
<package id="MarkdownDeep-av.NET" version="1.5.2" targetFramework="monoandroid60" />
|
||||||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="monoandroid60" />
|
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="monoandroid60" />
|
||||||
<package id="Xam.Plugin.Connectivity" version="1.0.1" targetFramework="monoandroid60" />
|
<package id="Plugin.CurrentActivity" version="1.0.1" targetFramework="monoandroid70" />
|
||||||
<package id="Xam.Plugin.DeviceInfo" version="1.0.0.2" targetFramework="monoandroid60" />
|
<package id="Plugin.Permissions" version="1.1.7" targetFramework="monoandroid70" />
|
||||||
<package id="Xam.Plugin.Geolocator" version="1.0.0" targetFramework="monoandroid60" />
|
<package id="SQLite.Net.Async-PCL" version="3.1.1" targetFramework="monoandroid70" />
|
||||||
<package id="Xam.Plugin.Media" version="1.0.1" targetFramework="monoandroid60" />
|
<package id="SQLite.Net.Core-PCL" version="3.1.1" targetFramework="monoandroid70" />
|
||||||
<package id="Xam.Plugins.Settings" version="2.1.0" targetFramework="monoandroid60" />
|
<package id="SQLite.Net.Platform.XamarinAndroid" version="2.5.1" targetFramework="monoandroid70" />
|
||||||
|
<package id="SQLite.Net-PCL" version="3.1.1" targetFramework="monoandroid70" />
|
||||||
|
<package id="Xam.Plugin.Connectivity" version="2.2.12" targetFramework="monoandroid70" />
|
||||||
|
<package id="Xam.Plugin.DeviceInfo" version="2.0.2" targetFramework="monoandroid70" />
|
||||||
|
<package id="Xam.Plugin.Geolocator" version="3.0.4" targetFramework="monoandroid70" />
|
||||||
|
<package id="Xam.Plugin.Media" version="2.3.0" targetFramework="monoandroid70" />
|
||||||
|
<package id="Xam.Plugins.Settings" version="2.5.1.0" targetFramework="monoandroid70" />
|
||||||
<package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="23.3.0" targetFramework="monoandroid60" />
|
<package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="23.3.0" targetFramework="monoandroid60" />
|
||||||
<package id="Xamarin.Android.Support.Design" version="23.3.0" targetFramework="monoandroid60" />
|
<package id="Xamarin.Android.Support.Design" version="23.3.0" targetFramework="monoandroid60" />
|
||||||
<package id="Xamarin.Android.Support.v4" version="23.3.0" targetFramework="monoandroid60" />
|
<package id="Xamarin.Android.Support.v4" version="23.3.0" targetFramework="monoandroid60" />
|
||||||
|
|
@ -15,11 +22,24 @@
|
||||||
<package id="Xamarin.Android.Support.v7.MediaRouter" version="23.3.0" targetFramework="monoandroid60" />
|
<package id="Xamarin.Android.Support.v7.MediaRouter" version="23.3.0" targetFramework="monoandroid60" />
|
||||||
<package id="Xamarin.Android.Support.v7.RecyclerView" version="23.3.0" targetFramework="monoandroid60" />
|
<package id="Xamarin.Android.Support.v7.RecyclerView" version="23.3.0" targetFramework="monoandroid60" />
|
||||||
<package id="Xamarin.Android.Support.Vector.Drawable" version="23.3.0" targetFramework="monoandroid60" />
|
<package id="Xamarin.Android.Support.Vector.Drawable" version="23.3.0" targetFramework="monoandroid60" />
|
||||||
<package id="Xamarin.Forms" version="2.3.0.107" targetFramework="monoandroid60" />
|
<package id="Xamarin.Controls.SignaturePad" version="1.4.0" targetFramework="monoandroid70" />
|
||||||
<package id="Xamarin.GooglePlayServices" version="22.0.0.0" targetFramework="monoandroid60" />
|
<package id="Xamarin.Forms" version="2.3.2.127" targetFramework="monoandroid70" />
|
||||||
<package id="Xamarin.GooglePlayServices.Base" version="29.0.0.2" targetFramework="monoandroid60" />
|
<package id="Xamarin.Forms.Maps" version="2.3.2.127" targetFramework="monoandroid70" />
|
||||||
<package id="Xamarin.GooglePlayServices.Basement" version="29.0.0.2" targetFramework="monoandroid60" />
|
<package id="Xamarin.GooglePlayServices.Ads" version="29.0.0.1" targetFramework="monoandroid70" />
|
||||||
<package id="Xamarin.GooglePlayServices.Gcm" version="29.0.0.2" targetFramework="monoandroid60" />
|
<package id="Xamarin.GooglePlayServices.Analytics" version="29.0.0.1" targetFramework="monoandroid70" />
|
||||||
<package id="Xamarin.GooglePlayServices.Maps" version="29.0.0.2" targetFramework="monoandroid60" />
|
<package id="Xamarin.GooglePlayServices.Base" version="29.0.0.1" targetFramework="monoandroid70" />
|
||||||
<package id="Xamarin.GooglePlayServices.Measurement" version="29.0.0.2" targetFramework="monoandroid60" />
|
<package id="Xamarin.GooglePlayServices.Basement" version="29.0.0.1" targetFramework="monoandroid70" />
|
||||||
|
<package id="Xamarin.GooglePlayServices.Gcm" version="29.0.0.1" targetFramework="monoandroid70" />
|
||||||
|
<package id="Xamarin.GooglePlayServices.Maps" version="29.0.0.1" targetFramework="monoandroid70" />
|
||||||
|
<package id="Xamarin.GooglePlayServices.Measurement" version="29.0.0.1" targetFramework="monoandroid70" />
|
||||||
|
<package id="XLabs.Caching" version="2.3.0-pre02" targetFramework="monoandroid70" />
|
||||||
|
<package id="XLabs.Caching.SQLite" version="2.3.0-pre02" targetFramework="monoandroid70" />
|
||||||
|
<package id="XLabs.Core" version="2.3.0-pre02" targetFramework="monoandroid70" />
|
||||||
|
<package id="XLabs.Forms" version="2.3.0-pre02" targetFramework="monoandroid70" />
|
||||||
|
<package id="XLabs.IoC" version="2.3.0-pre02" targetFramework="monoandroid70" />
|
||||||
|
<package id="XLabs.Platform" version="2.3.0-pre02" targetFramework="monoandroid70" />
|
||||||
|
<package id="XLabs.Serialization" version="2.3.0-pre02" targetFramework="monoandroid70" />
|
||||||
|
<package id="XLabs.Serialization.JSON" version="2.3.0-pre02" targetFramework="monoandroid70" />
|
||||||
|
<package id="XLabs.Settings" version="2.3.0-pre02" targetFramework="monoandroid70" />
|
||||||
|
<package id="XLabs.Settings.XamSettings" version="2.3.0-pre02" targetFramework="monoandroid70" />
|
||||||
</packages>
|
</packages>
|
||||||
|
|
@ -4,6 +4,9 @@ using System.Linq;
|
||||||
|
|
||||||
using Foundation;
|
using Foundation;
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
using BookAStar;
|
||||||
|
using BookAStar.Interfaces;
|
||||||
|
using Yavsc.Models.Identity;
|
||||||
|
|
||||||
namespace App2.iOS
|
namespace App2.iOS
|
||||||
{
|
{
|
||||||
|
|
@ -11,8 +14,27 @@ namespace App2.iOS
|
||||||
// User Interface of the application, as well as listening (and optionally responding) to
|
// User Interface of the application, as well as listening (and optionally responding) to
|
||||||
// application events from iOS.
|
// application events from iOS.
|
||||||
[Register("AppDelegate")]
|
[Register("AppDelegate")]
|
||||||
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
|
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate,
|
||||||
|
IPlatform
|
||||||
{
|
{
|
||||||
|
public string GCMStatusMessage
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddAccount()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool EnablePushNotifications(bool enable)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// This method is invoked when the application has loaded and is ready to run. In this
|
// This method is invoked when the application has loaded and is ready to run. In this
|
||||||
// method you should instantiate the window, load the UI into it and then make the window
|
// method you should instantiate the window, load the UI into it and then make the window
|
||||||
|
|
@ -23,9 +45,34 @@ namespace App2.iOS
|
||||||
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
|
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
|
||||||
{
|
{
|
||||||
global::Xamarin.Forms.Forms.Init();
|
global::Xamarin.Forms.Forms.Init();
|
||||||
LoadApplication(new App());
|
LoadApplication(new App(this));
|
||||||
|
|
||||||
return base.FinishedLaunching(app, options);
|
return base.FinishedLaunching(app, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IGCMDeclaration GetDeviceInfo()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public object InvokeApi(string method, object arg)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TAnswer InvokeApi<TAnswer>(string method, object arg)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OpenWeb(string Uri)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RevokeAccount(string userName)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
<MtouchArch>i386, x86_64</MtouchArch>
|
<MtouchArch>i386, x86_64</MtouchArch>
|
||||||
<MtouchLink>None</MtouchLink>
|
<MtouchLink>None</MtouchLink>
|
||||||
<MtouchDebug>true</MtouchDebug>
|
<MtouchDebug>true</MtouchDebug>
|
||||||
|
<CodeAnalysisRuleSet />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||||
<DebugType>none</DebugType>
|
<DebugType>none</DebugType>
|
||||||
|
|
@ -36,6 +37,7 @@
|
||||||
<MtouchLink>None</MtouchLink>
|
<MtouchLink>None</MtouchLink>
|
||||||
<MtouchArch>i386, x86_64</MtouchArch>
|
<MtouchArch>i386, x86_64</MtouchArch>
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
|
<CodeAnalysisRuleSet />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
|
@ -50,6 +52,7 @@
|
||||||
<CodesignKey>iPhone Developer</CodesignKey>
|
<CodesignKey>iPhone Developer</CodesignKey>
|
||||||
<MtouchDebug>true</MtouchDebug>
|
<MtouchDebug>true</MtouchDebug>
|
||||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||||
|
<CodeAnalysisRuleSet />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||||
<DebugType>none</DebugType>
|
<DebugType>none</DebugType>
|
||||||
|
|
@ -61,6 +64,7 @@
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
<CodesignKey>iPhone Developer</CodesignKey>
|
<CodesignKey>iPhone Developer</CodesignKey>
|
||||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||||
|
<CodeAnalysisRuleSet />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
|
||||||
<DebugType>none</DebugType>
|
<DebugType>none</DebugType>
|
||||||
|
|
@ -74,6 +78,7 @@
|
||||||
<CodesignProvision>Automatic:AdHoc</CodesignProvision>
|
<CodesignProvision>Automatic:AdHoc</CodesignProvision>
|
||||||
<CodesignKey>iPhone Distribution</CodesignKey>
|
<CodesignKey>iPhone Distribution</CodesignKey>
|
||||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||||
|
<CodeAnalysisRuleSet />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' ">
|
||||||
<DebugType>none</DebugType>
|
<DebugType>none</DebugType>
|
||||||
|
|
@ -86,6 +91,13 @@
|
||||||
<CodesignProvision>Automatic:AppStore</CodesignProvision>
|
<CodesignProvision>Automatic:AppStore</CodesignProvision>
|
||||||
<CodesignKey>iPhone Distribution</CodesignKey>
|
<CodesignKey>iPhone Distribution</CodesignKey>
|
||||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||||
|
<CodeAnalysisRuleSet />
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhoneSimulator'">
|
||||||
|
<CodeAnalysisRuleSet />
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'AppStore|iPhoneSimulator'">
|
||||||
|
<CodeAnalysisRuleSet />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Main.cs" />
|
<Compile Include="Main.cs" />
|
||||||
|
|
@ -121,35 +133,59 @@
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.2.0.0.6482\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Xamarin.Forms.Maps, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Xamarin.Forms.Maps.2.3.2.127\lib\Xamarin.iOS10\Xamarin.Forms.Maps.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Xamarin.Forms.Maps.iOS, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Xamarin.Forms.Maps.2.3.2.127\lib\Xamarin.iOS10\Xamarin.Forms.Maps.iOS.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.2.0.0.6482\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.Forms.Platform.iOS, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.Forms.Platform.iOS, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.2.0.0.6482\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.2.0.0.6482\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.iOS" />
|
<Reference Include="Xamarin.iOS" />
|
||||||
|
<Reference Include="XLabs.Caching, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Caching.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.Caching.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Serialization, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Serialization.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.Serialization.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Settings, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Settings.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.Settings.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\Yavsc.Client\Yavsc.Client.csproj">
|
||||||
|
<Project>{67F9D3A8-F71E-4428-913F-C37AE82CDB24}</Project>
|
||||||
|
<Name>Yavsc.Client</Name>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\BookAStar\BookAStar.csproj">
|
<ProjectReference Include="..\BookAStar\BookAStar.csproj">
|
||||||
<Project>{A0815650-0A0A-47B0-8826-771F0E1AD137}</Project>
|
<Project>{A0815650-0A0A-47B0-8826-771F0E1AD137}</Project>
|
||||||
<Name>BookAStar</Name>
|
<Name>BookAStar</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||||
<Import Project="..\..\packages\Xamarin.Forms.2.0.0.6482\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.0.0.6482\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
|
<Import Project="..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}.</ErrorText>
|
<ErrorText>Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.2.0.0.6482\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.2.0.0.6482\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
|
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -6,6 +6,10 @@
|
||||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="XLabs.Serialization" publicKeyToken="d65109b36e5040e4" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-2.0.5782.15703" newVersion="2.0.5782.15703" />
|
||||||
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Xamarin.Forms" version="2.0.0.6482" targetFramework="xamarinios10" />
|
<package id="Xamarin.Forms" version="2.3.2.127" targetFramework="xamarinios10" />
|
||||||
|
<package id="Xamarin.Forms.Maps" version="2.3.2.127" targetFramework="xamarinios10" />
|
||||||
|
<package id="XLabs.Caching" version="2.3.0-pre02" targetFramework="xamarinios10" />
|
||||||
|
<package id="XLabs.Serialization" version="2.3.0-pre02" targetFramework="xamarinios10" />
|
||||||
|
<package id="XLabs.Settings" version="2.3.0-pre02" targetFramework="xamarinios10" />
|
||||||
</packages>
|
</packages>
|
||||||
|
|
@ -1,31 +1,73 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<Application xmlns="http://xamarin.com/schemas/2014/forms"
|
<Application xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
x:Class="BookAStar.App" >
|
x:Class="BookAStar.App"
|
||||||
|
xmlns:sys="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
|
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<OnPlatform x:TypeArguments="Font" Android="Large" iOS="Large" WinPhone="Large" x:Key="HeaderFont" />
|
|
||||||
<OnPlatform x:TypeArguments="Color" Android="White" iOS="White" WinPhone="White" x:Key="PrimaryTextColor" />
|
|
||||||
<OnPlatform x:TypeArguments="Font" Android="40" iOS="60" WinPhone="60" x:Key="LargeFontSize" />
|
|
||||||
<OnPlatform x:TypeArguments="Font" Android="30" iOS="60" WinPhone="60" x:Key="MediumFontSize" />
|
|
||||||
|
|
||||||
<Color x:key="backgroundColor">#30FAFAFA</Color>
|
<Color x:Key="PageBackgroundColor">#30FAFAFA</Color>
|
||||||
<Color x:key="textColor">#FF103010</Color>
|
<Color x:Key="ContentBackgroundColor">#ffffff</Color>
|
||||||
<Color x:key="labelColor">#FF303010</Color>
|
<Color x:Key="PageForegroundColor">#000000</Color>
|
||||||
<Style x:Key="labelStyle" TargetType="Label">
|
<Color x:Key="HeadingTextColor">Black</Color>
|
||||||
<Setter Property="TextColor" Value="{DynamicResource labelColor}" />
|
<Color x:Key="NormalTextColor">Blue</Color>
|
||||||
|
<Color x:Key="GroupingTextColor">#5050ff</Color>
|
||||||
|
|
||||||
|
<OnPlatform x:TypeArguments="Font" Android="Large" iOS="Large" WinPhone="Large" x:Key="HeaderFont" />
|
||||||
|
<OnPlatform x:TypeArguments="Color" Android="Red" iOS="Red" WinPhone="Red" x:Key="EmphasisTextColor" />
|
||||||
|
<OnPlatform x:TypeArguments="Font" Android="60" iOS="60" WinPhone="60" x:Key="LargeFontSize" />
|
||||||
|
<OnPlatform x:TypeArguments="Font" Android="50" iOS="50" WinPhone="50" x:Key="MediumFontSize" />
|
||||||
|
<OnPlatform x:TypeArguments="Font" Android="40" iOS="40" WinPhone="40" x:Key="SmallFontSize" />
|
||||||
|
<OnPlatform x:TypeArguments="x:Double" Android="130" iOS="130" WinPhone="130" x:Key="BigUserAvatarSize" />
|
||||||
|
|
||||||
|
|
||||||
|
<Color x:Key="BackgroundColor">#30AAAAFA</Color>
|
||||||
|
<Color x:Key="OddColor">#207AFAFA</Color>
|
||||||
|
<Color x:Key="TextColor">#FF103010</Color>
|
||||||
|
<Color x:Key="LabelColor">#FF303010</Color>
|
||||||
|
|
||||||
|
<Style x:Key="LabelPageHeadingStyle" TargetType="Label">
|
||||||
<Setter Property="FontAttributes" Value="Bold" />
|
<Setter Property="FontAttributes" Value="Bold" />
|
||||||
<Setter Property="FontSize" Value="Large" />
|
<Setter Property="HorizontalOptions" Value="Center" />
|
||||||
<Setter Property="VerticalOptions" Value="Start" />
|
<Setter Property="TextColor" Value="{StaticResource HeadingTextColor}" />
|
||||||
<Setter Property="XAlign" Value="Center" />
|
<Setter Property="FontSize" Value="{StaticResource LargeFontSize}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style x:Key="entryStyle" TargetType="Entry">
|
|
||||||
|
<Style x:Key="InputLabelStyle" TargetType="Label">
|
||||||
|
<Setter Property="FontSize" Value="{StaticResource SmallFontSize}" />
|
||||||
|
<Setter Property="FontAttributes" Value="Italic" />
|
||||||
|
<Setter Property="HorizontalOptions" Value="Center" />
|
||||||
|
<Setter Property="TextColor" Value="{StaticResource GroupingTextColor}" />
|
||||||
|
<Setter Property="VerticalOptions" Value="Start" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="LabelStyle" TargetType="Label">
|
||||||
|
<Setter Property="TextColor" Value="{StaticResource TextColor}" />
|
||||||
|
<Setter Property="LineBreakMode" Value="WordWrap" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="BigLabel" BasedOn="{StaticResource LabelStyle}" TargetType="Label">
|
||||||
|
<Setter Property="FontSize" Value="Large" />
|
||||||
|
</Style>
|
||||||
|
<Style x:Key="ContentLabelStyle" BasedOn="{StaticResource LabelStyle}" TargetType="Label">
|
||||||
|
<Setter Property="FontSize" Value="{StaticResource MediumFontSize}" />
|
||||||
|
<Setter Property="HorizontalOptions" Value="CenterAndExpand" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="EntryStyle" TargetType="Entry">
|
||||||
|
<Setter Property="HorizontalOptions" Value="CenterAndExpand"/>
|
||||||
|
</Style>
|
||||||
|
<Style x:Key="PickerStyle" TargetType="Picker">
|
||||||
<Setter Property="HorizontalOptions" Value="FillAndExpand"/>
|
<Setter Property="HorizontalOptions" Value="FillAndExpand"/>
|
||||||
</Style>
|
</Style>
|
||||||
<Style x:key="backbroundStyle" TargetType="VisualElement">
|
<Style x:Key="BigEntry" TargetType="Entry" BasedOn="{StaticResource EntryStyle}">
|
||||||
<Setter Property="BackgoundColor" Value="{DynamicResource backgroundColor}" />
|
<Setter Property="FontSize" Value="{StaticResource LargeFontSize}" />
|
||||||
|
<Setter Property="FontAttributes" Value="Bold" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style x:Key="buttonStyle" TargetType="Button">
|
|
||||||
|
<Style x:Key="ButtonStyle" TargetType="Button">
|
||||||
<Setter Property="HorizontalOptions" Value="Center" />
|
<Setter Property="HorizontalOptions" Value="Center" />
|
||||||
<Setter Property="VerticalOptions" Value="CenterAndExpand" />
|
<Setter Property="VerticalOptions" Value="CenterAndExpand" />
|
||||||
<Setter Property="BorderColor" Value="Lime" />
|
<Setter Property="BorderColor" Value="Lime" />
|
||||||
|
|
@ -34,7 +76,11 @@
|
||||||
<Setter Property="WidthRequest" Value="200" />
|
<Setter Property="WidthRequest" Value="200" />
|
||||||
<Setter Property="TextColor" Value="Teal" />
|
<Setter Property="TextColor" Value="Teal" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="PageStyle" TargetType="ContentPage">
|
||||||
|
<Setter Property="Padding" Value="5,5,5,5" />
|
||||||
|
<Setter Property="BackgroundColor" Value="{StaticResource PageBackgroundColor}" />
|
||||||
|
</Style>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
|
|
||||||
</Application>
|
</Application>
|
||||||
|
|
@ -1,15 +1,19 @@
|
||||||
using BookAStar.Model;
|
using BookAStar.Interfaces;
|
||||||
using BookAStar.Model.Auth.Account;
|
using BookAStar.Model;
|
||||||
using BookAStar.Pages;
|
using BookAStar.Pages;
|
||||||
|
using BookAStar.ViewModels;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Net;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Net.Http.Headers;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using Xamarin.Forms.Xaml;
|
using XLabs.Forms.Mvvm;
|
||||||
|
using XLabs.Forms.Pages;
|
||||||
|
using XLabs.Forms.Services;
|
||||||
|
using XLabs.Ioc;
|
||||||
|
using XLabs.Platform.Mvvm;
|
||||||
|
using XLabs.Platform.Services;
|
||||||
|
using XLabs.Settings;
|
||||||
|
using XLabs;
|
||||||
|
using XLabs.Enums;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Glyphish icons from
|
Glyphish icons from
|
||||||
http://www.glyphish.com/
|
http://www.glyphish.com/
|
||||||
|
|
@ -22,118 +26,218 @@ namespace BookAStar
|
||||||
{
|
{
|
||||||
public partial class App : Application // superclass new in 1.3
|
public partial class App : Application // superclass new in 1.3
|
||||||
{
|
{
|
||||||
SearchPage searchPage;
|
public static IPlatform PlatformSpecificInstance { get; set; }
|
||||||
NavigationPage mp;
|
|
||||||
SettingsPage settingsPage;
|
|
||||||
PinPage pinPage;
|
|
||||||
ContentPage deviceInfoPage;
|
|
||||||
BookQueryPage bookQueryPage;
|
|
||||||
BookQueriesPage bookQueriesPage;
|
|
||||||
public static IPlatform PlateformSpecificInstance { get; set; }
|
|
||||||
public static string AppName { get; set; }
|
public static string AppName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
// Exists in order to dispose of a static instance strongly typed
|
||||||
|
// TODO : replace all references to this field
|
||||||
|
// by Views resolution, and then, drop it
|
||||||
public static App CurrentApp { get { return Current as App; } }
|
public static App CurrentApp { get { return Current as App; } }
|
||||||
|
|
||||||
public DataManager DataManager { get; set; }
|
public static bool MasterPresented
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{ return CurrentApp.masterDetail.IsPresented; }
|
||||||
|
internal set
|
||||||
|
{ CurrentApp.masterDetail.IsPresented = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Init()
|
||||||
|
{
|
||||||
|
var app = Resolver.Resolve<IXFormsApp>();
|
||||||
|
|
||||||
|
if (app == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Configure(app);
|
||||||
|
app.Closing += OnClosing;
|
||||||
|
app.Error += OnError;
|
||||||
|
app.Initialize += OnInitialize;
|
||||||
|
app.Resumed += OnAppResumed;
|
||||||
|
app.Rotation += OnRotation;
|
||||||
|
app.Startup += OnStartup;
|
||||||
|
app.Suspended += OnSuspended;
|
||||||
|
}
|
||||||
|
|
||||||
|
// omg
|
||||||
|
private void OnError(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called on rotation after OnSuspended
|
||||||
|
private void OnClosing(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// FIXME Not called
|
||||||
|
private void OnInitialize(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// called on app startup, not on rotation
|
||||||
|
private void OnStartup(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// TODO special starup pages as
|
||||||
|
// notification details or wizard setup page
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called on rotation
|
||||||
|
private void OnSuspended(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// TODO the navigation stack persistence (save)
|
||||||
|
}
|
||||||
|
|
||||||
|
// called on app startup, after OnStartup, not on rotation
|
||||||
|
private void OnAppResumed(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// TODO the navigation stack persistence (restore)
|
||||||
|
base.OnResume();
|
||||||
|
}
|
||||||
|
|
||||||
|
// FIXME Not called ... see OnSuspended
|
||||||
|
private void OnRotation(object sender, EventArgs<Orientation> e)
|
||||||
|
{
|
||||||
|
// TODO the navigation stack persistence (restore?)
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GenericConfigSettingsMgr ConfigManager { protected set; get; }
|
||||||
|
|
||||||
|
private void Configure(IXFormsApp app)
|
||||||
|
{
|
||||||
|
ViewFactory.EnableCache = true;
|
||||||
|
ViewFactory.Register<DashboardPage, DashboardViewModel>(
|
||||||
|
resolver => new DashboardViewModel());
|
||||||
|
ViewFactory.Register<BookQueryPage, BookQueryViewModel>();
|
||||||
|
ViewFactory.Register<BookQueriesPage, BookQueriesViewModel>();
|
||||||
|
ViewFactory.Register<EditBillingLinePage, BillingLineViewModel>();
|
||||||
|
ViewFactory.Register<EditEstimatePage, EstimateViewModel>();
|
||||||
|
ConfigManager = new XLabs.Settings.GenericConfigSettingsMgr(s =>
|
||||||
|
MainSettings.AppSettings.GetValueOrDefault<string>(s, MainSettings.SettingsDefault), null);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ExtendedMasterDetailPage masterDetail;
|
||||||
|
|
||||||
public App(IPlatform instance)
|
public App(IPlatform instance)
|
||||||
{
|
{
|
||||||
DataManager = new DataManager();
|
// This declaration became obsolete by introduction
|
||||||
deviceInfoPage = new DeviceInfoPage(instance.GetDeviceInfo());
|
// of the XLabs App that
|
||||||
bookQueriesPage = new BookQueriesPage();
|
// refers this instance with
|
||||||
|
// its application context property
|
||||||
|
// and is obtained using the `Resolver`
|
||||||
|
PlatformSpecificInstance = instance;
|
||||||
|
// Xaml
|
||||||
|
InitializeComponent();
|
||||||
|
// Static properties construction
|
||||||
|
Init();
|
||||||
|
// Builds the Main page
|
||||||
|
BuildMainPage();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
PlateformSpecificInstance = instance;
|
BookQueriesPage bQueriesPage;
|
||||||
searchPage = new SearchPage
|
AccountChooserPage accChooserPage;
|
||||||
|
HomePage home;
|
||||||
|
|
||||||
|
private void BuildMainPage()
|
||||||
|
{
|
||||||
|
accChooserPage = new AccountChooserPage();
|
||||||
|
|
||||||
|
bQueriesPage = new BookQueriesPage
|
||||||
{
|
{
|
||||||
Title = "Trouvez votre artiste",
|
Title = "Demandes",
|
||||||
Icon = "glyphish_07_map_marker.png"
|
Icon = "icon.png",
|
||||||
};
|
BindingContext = new BookQueriesViewModel()
|
||||||
mp = new NavigationPage(searchPage);
|
|
||||||
settingsPage = new SettingsPage
|
|
||||||
{
|
|
||||||
Title = "Settings",
|
|
||||||
Icon = "ic_corp_icon.png"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var r = this.Resources;
|
home = new HomePage() { Title = "Accueil", Icon = "icon.png" };
|
||||||
//var hasLabelStyle = r.ContainsKey("labelStyle");
|
|
||||||
|
|
||||||
// var stid = this.StyleId;
|
// var mainPage = new NavigationPage(bQueriesPage);
|
||||||
// null var appsstyle = settingsPage.Style;
|
|
||||||
// appsstyle.CanCascade = true;
|
masterDetail = new ExtendedMasterDetailPage()
|
||||||
MainPage = mp;
|
{
|
||||||
|
Title = "MainPage"
|
||||||
|
};
|
||||||
|
|
||||||
|
masterDetail.Master = new DashboardPage
|
||||||
|
{
|
||||||
|
Title = "Bookingstar",
|
||||||
|
BindingContext = new DashboardViewModel()
|
||||||
|
};
|
||||||
|
|
||||||
|
// masterDetail.Detail = home;
|
||||||
|
|
||||||
|
masterDetail.Detail = new NavigationPage(home);
|
||||||
ToolbarItem tiSetts = new ToolbarItem()
|
ToolbarItem tiSetts = new ToolbarItem()
|
||||||
{
|
{
|
||||||
Text = "Settings",
|
Text = "Paramètres",
|
||||||
Icon = "ic_corp_icon.png"
|
Icon = "ic_corp_icon.png"
|
||||||
};
|
};
|
||||||
mp.ToolbarItems.Add(tiSetts);
|
|
||||||
tiSetts.Clicked += (object sender, EventArgs e) =>
|
ToolbarItem tiHome = new ToolbarItem()
|
||||||
{
|
{
|
||||||
if (settingsPage.Parent == null)
|
Text = "Accueil",
|
||||||
mp.Navigation.PushAsync(settingsPage);
|
Icon = "icon.png"
|
||||||
else
|
|
||||||
{
|
|
||||||
settingsPage.Focus();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
ToolbarItem tiQueries = new ToolbarItem
|
|
||||||
{
|
|
||||||
Text = "Demandes"
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
tiQueries.Clicked += (object sender, EventArgs e) =>
|
|
||||||
{
|
|
||||||
if (bookQueriesPage.Parent == null)
|
|
||||||
mp.Navigation.PushAsync(bookQueriesPage);
|
|
||||||
else bookQueriesPage.Focus();
|
|
||||||
};
|
|
||||||
mp.ToolbarItems.Add(tiQueries);
|
|
||||||
ToolbarItem tiMap = new ToolbarItem
|
|
||||||
{
|
|
||||||
Text = "Carte",
|
|
||||||
Icon = "glyphish_07_map_marker.png"
|
|
||||||
};
|
|
||||||
mp.ToolbarItems.Add(tiMap);
|
|
||||||
pinPage = new PinPage
|
|
||||||
{
|
|
||||||
Title = "Carte",
|
|
||||||
Icon = "glyphish_07_map_marker.png"
|
|
||||||
};
|
|
||||||
tiMap.Clicked += (object sender, EventArgs e) =>
|
|
||||||
{
|
|
||||||
if (pinPage.Parent == null)
|
|
||||||
mp.Navigation.PushAsync(pinPage);
|
|
||||||
else pinPage.Focus();
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
var navPage = new NavigationPage(masterDetail) {
|
||||||
|
Title = "Navigation",
|
||||||
|
Icon = "icon.png"
|
||||||
|
} ;
|
||||||
|
//var navPage = new NavigationPage(mainTab);
|
||||||
|
|
||||||
|
navPage.ToolbarItems.Add(tiHome);
|
||||||
|
navPage.ToolbarItems.Add(tiSetts);
|
||||||
|
*/
|
||||||
|
this.MainPage = masterDetail;
|
||||||
|
masterDetail.ToolbarItems.Add(tiHome);
|
||||||
|
masterDetail.ToolbarItems.Add(tiSetts);
|
||||||
|
NavigationService = new NavigationService(masterDetail.Detail.Navigation);
|
||||||
}
|
}
|
||||||
|
public INavigationService NavigationService { protected set; get; }
|
||||||
public void ShowDeviceInfo()
|
|
||||||
{
|
|
||||||
if (deviceInfoPage.Parent == null)
|
|
||||||
mp.Navigation.PushAsync(deviceInfoPage);
|
|
||||||
else deviceInfoPage.Focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void PostDeviceInfo()
|
public void PostDeviceInfo()
|
||||||
{
|
{
|
||||||
var res = PlateformSpecificInstance.InvokeApi(
|
var res = PlatformSpecificInstance.InvokeApi(
|
||||||
"gcm/register",
|
"gcm/register",
|
||||||
PlateformSpecificInstance.GetDeviceInfo());
|
PlatformSpecificInstance.GetDeviceInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowBookQuery(BookQueryData data)
|
public static void ShowBookQuery (BookQueryData query)
|
||||||
{
|
{
|
||||||
bookQueriesPage.BindingContext = data;
|
var page = ViewFactory.CreatePage<BookQueryViewModel
|
||||||
mp.Navigation.PushAsync(bookQueriesPage);
|
, BookQueryPage>((b, p) => p.BindingContext = new BookQueryViewModel(query));
|
||||||
|
App.Current.MainPage.Navigation.PushAsync(page as Page);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CloseWindow()
|
// TODO système de persistance de l'état de l'appli
|
||||||
|
/*
|
||||||
|
/// <summary>
|
||||||
|
/// Shows a page asynchronously by locating the default constructor, creating the page,
|
||||||
|
/// the pushing it onto the navigation stack.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parentPage">Parent Page</param>
|
||||||
|
/// <param name="pageType">Type of page to show</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task ShowPage(VisualElement parentPage, Type pageType)
|
||||||
{
|
{
|
||||||
mp.Navigation.PopAsync();
|
// Get all the constructors of the page type.
|
||||||
}
|
var constructors = pageType.GetTypeInfo().DeclaredConstructors;
|
||||||
|
|
||||||
|
foreach (var page in
|
||||||
|
from constructor in constructors
|
||||||
|
where constructor.GetParameters().Length == 0
|
||||||
|
select (Page)constructor.Invoke(null))
|
||||||
|
{
|
||||||
|
await parentPage.Navigation.PushAsync(page);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<CodeAnalysisRuleSet />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
|
|
@ -33,13 +34,33 @@
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<CodeAnalysisRuleSet />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="App.xaml.cs">
|
<Compile Include="App.xaml.cs">
|
||||||
<DependentUpon>App.xaml</DependentUpon>
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="DataManager.cs" />
|
<Compile Include="Constants.cs" />
|
||||||
|
<Compile Include="Factories\ViewFactory.cs" />
|
||||||
|
<Compile Include="Helpers\DataManager.cs" />
|
||||||
|
<Compile Include="Helpers\ObservableString.cs" />
|
||||||
|
<Compile Include="Interfaces\ILocalEntity.cs" />
|
||||||
|
<Compile Include="Helpers\LocaLEntity.cs" />
|
||||||
|
<Compile Include="Helpers\NotIdentifiedException.cs" />
|
||||||
|
<Compile Include="Helpers\PageHelpers.cs" />
|
||||||
|
<Compile Include="Helpers\PropertySupport.cs" />
|
||||||
<Compile Include="Helpers\RemoteEntityRO.cs" />
|
<Compile Include="Helpers\RemoteEntityRO.cs" />
|
||||||
|
<Compile Include="Helpers\ServiceNotAvailable1.cs" />
|
||||||
|
<Compile Include="Helpers\Settings.cs" />
|
||||||
|
<Compile Include="Helpers\UserHelpers.cs" />
|
||||||
|
<Compile Include="Interfaces\IComponentContext.cs" />
|
||||||
|
<Compile Include="Interfaces\IMDEditor.cs" />
|
||||||
|
<Compile Include="Interfaces\IModelViewModel.cs" />
|
||||||
|
<Compile Include="Interfaces\IViewFactory.cs" />
|
||||||
|
<Compile Include="Model\ClientProviderInfo.cs" />
|
||||||
|
<Compile Include="Interfaces\IBookQueryData.cs" />
|
||||||
|
<Compile Include="Interfaces\IBillingLine.cs" />
|
||||||
|
<Compile Include="Interfaces\IEstimate.cs" />
|
||||||
<Compile Include="Pages\BlogPage.cs" />
|
<Compile Include="Pages\BlogPage.cs" />
|
||||||
<Compile Include="Pages\BookQueriesPage.xaml.cs">
|
<Compile Include="Pages\BookQueriesPage.xaml.cs">
|
||||||
<DependentUpon>BookQueriesPage.xaml</DependentUpon>
|
<DependentUpon>BookQueriesPage.xaml</DependentUpon>
|
||||||
|
|
@ -47,21 +68,23 @@
|
||||||
<Compile Include="Pages\BookQueryPage.xaml.cs">
|
<Compile Include="Pages\BookQueryPage.xaml.cs">
|
||||||
<DependentUpon>BookQueryPage.xaml</DependentUpon>
|
<DependentUpon>BookQueryPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\DeviceInfoPage.cs" />
|
<Compile Include="Pages\EditBillingLinePage.xaml.cs">
|
||||||
|
<DependentUpon>EditBillingLinePage.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Pages\DashboardPage.xaml.cs">
|
||||||
|
<DependentUpon>DashboardPage.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Pages\EventDetail.xaml.cs">
|
<Compile Include="Pages\EventDetail.xaml.cs">
|
||||||
<DependentUpon>EventDetail.xaml</DependentUpon>
|
<DependentUpon>EventDetail.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Helpers\MainSettings.cs" />
|
<Compile Include="Helpers\MainSettings.cs" />
|
||||||
<Compile Include="Helpers\RemoteEntity.cs" />
|
<Compile Include="Helpers\RemoteEntity.cs" />
|
||||||
<Compile Include="IPlatform.cs" />
|
<Compile Include="Interfaces\IPlatform.cs" />
|
||||||
<Compile Include="Pages\MainPage.xaml.cs">
|
|
||||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Model\Blog\Blog.cs" />
|
<Compile Include="Model\Blog\Blog.cs" />
|
||||||
<Compile Include="Model\Blog\BlogTag.cs" />
|
<Compile Include="Model\Blog\BlogTag.cs" />
|
||||||
<Compile Include="Model\BookQueryData.cs" />
|
<Compile Include="Model\BookQueryData.cs" />
|
||||||
<Compile Include="Model\Market\BaseProduct.cs" />
|
<Compile Include="Model\Market\BaseProduct.cs" />
|
||||||
<Compile Include="Model\Workflow\CommandLine.cs" />
|
<Compile Include="Model\Workflow\BillingLine.cs" />
|
||||||
<Compile Include="Model\Manager.cs" />
|
<Compile Include="Model\Manager.cs" />
|
||||||
<Compile Include="Model\Auth\MobileAppDeclaration.cs" />
|
<Compile Include="Model\Auth\MobileAppDeclaration.cs" />
|
||||||
<Compile Include="Model\Auth\passwrecovery.cs" />
|
<Compile Include="Model\Auth\passwrecovery.cs" />
|
||||||
|
|
@ -96,31 +119,34 @@
|
||||||
<Compile Include="Model\Auth\Tokens.cs" />
|
<Compile Include="Model\Auth\Tokens.cs" />
|
||||||
<Compile Include="Model\Auth\User.cs" />
|
<Compile Include="Model\Auth\User.cs" />
|
||||||
<Compile Include="Model\Workflow\Estimate.cs" />
|
<Compile Include="Model\Workflow\Estimate.cs" />
|
||||||
<Compile Include="Pages\MakeAnEstimatePage.xaml.cs">
|
<Compile Include="Pages\EditEstimatePage.xaml.cs">
|
||||||
<DependentUpon>MakeAnEstimatePage.xaml</DependentUpon>
|
<DependentUpon>EditEstimatePage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\MarkdownEditorPage.xaml.cs">
|
<Compile Include="Pages\HomePage.xaml.cs">
|
||||||
<DependentUpon>MarkdownEditorPage.xaml</DependentUpon>
|
<DependentUpon>HomePage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\PinPage.cs" />
|
<Compile Include="Pages\PinPage.cs" />
|
||||||
|
<Compile Include="ViewModels\BookQueriesViewModel.cs" />
|
||||||
|
<Compile Include="ViewModels\BookQueryViewModel.cs" />
|
||||||
|
<Compile Include="ViewModels\BillingLineViewModel.cs" />
|
||||||
|
<Compile Include="ViewModels\DashboardViewModel.cs" />
|
||||||
|
<Compile Include="ViewModels\EstimateViewModel.cs" />
|
||||||
|
<Compile Include="ViewModels\UserLoginViewModel.cs" />
|
||||||
|
<Compile Include="ViewModels\ViewModelBase.cs" />
|
||||||
|
<Compile Include="Views\CommandLineEditor.xaml.cs">
|
||||||
|
<DependentUpon>CommandLineEditor.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Views\MarkdownView.cs" />
|
<Compile Include="Views\MarkdownView.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Pages\QueriesPage.xaml.cs">
|
|
||||||
<DependentUpon>QueriesPage.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Pages\SearchPage.xaml.cs">
|
<Compile Include="Pages\SearchPage.xaml.cs">
|
||||||
<DependentUpon>SearchPage.xaml</DependentUpon>
|
<DependentUpon>SearchPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\SettingsPage.xaml.cs">
|
<Compile Include="Pages\AccountChooserPage.xaml.cs">
|
||||||
<DependentUpon>SettingsPage.xaml</DependentUpon>
|
<DependentUpon>AccountChooserPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Model\Tag.cs" />
|
<Compile Include="Model\Tag.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Pages\MainPage.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<EmbeddedResource Include="App.xaml">
|
<EmbeddedResource Include="App.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
|
|
@ -129,7 +155,9 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="app.config" />
|
<None Include="app.config" />
|
||||||
<None Include="GettingStarted.Xamarin" />
|
<None Include="GettingStarted.Xamarin" />
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Pages\EventDetail.xaml">
|
<EmbeddedResource Include="Pages\EventDetail.xaml">
|
||||||
|
|
@ -140,7 +168,7 @@
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Pages\SettingsPage.xaml">
|
<EmbeddedResource Include="Pages\AccountChooserPage.xaml">
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|
@ -149,6 +177,10 @@
|
||||||
<Folder Include="Model\Billing\" />
|
<Folder Include="Model\Billing\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="ExifLib, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\ExifLib.PCL.1.0.1\lib\portable-net45+sl50+win+WindowsPhoneApp81+wp80+Xamarin.iOS10+MonoAndroid10+MonoTouch10\ExifLib.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Json.NET.Web">
|
<Reference Include="Json.NET.Web">
|
||||||
<HintPath>..\..\packages\Json.NET.Web.1.0.49\lib\portable45-net45+win8+wpa81\Json.NET.Web.dll</HintPath>
|
<HintPath>..\..\packages\Json.NET.Web.1.0.49\lib\portable45-net45+win8+wpa81\Json.NET.Web.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|
@ -161,28 +193,64 @@
|
||||||
<Reference Include="Newtonsoft.Json">
|
<Reference Include="Newtonsoft.Json">
|
||||||
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Plugin.Settings, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Plugin.Settings, Version=2.5.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.1.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\Plugin.Settings.dll</HintPath>
|
<HintPath>..\..\packages\Xam.Plugins.Settings.2.5.1.0\lib\portable-net45+wp80+win8+wpa81\Plugin.Settings.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Plugin.Settings.Abstractions, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Plugin.Settings.Abstractions, Version=2.5.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.1.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\Plugin.Settings.Abstractions.dll</HintPath>
|
<HintPath>..\..\packages\Xam.Plugins.Settings.2.5.1.0\lib\portable-net45+wp80+win8+wpa81\Plugin.Settings.Abstractions.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SQLite.Net, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\SQLite.Net-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.0.107\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.Forms.Maps, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.Forms.Maps, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.Maps.2.3.0.107\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Maps.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Forms.Maps.2.3.2.127\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Maps.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.0.107\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.0.107\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Caching, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Caching.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.Caching.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Core, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Core.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.Core.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Forms, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Forms.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+monoandroid+MonoTouch+Xamarin.iOS10\XLabs.Forms.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.IOC, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.IoC.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.IOC.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Platform, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Platform.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+monoandroid+MonoTouch+Xamarin.iOS10\XLabs.Platform.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Serialization, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Serialization.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.Serialization.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Serialization.Json.NET, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Serialization.JSON.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.Serialization.Json.NET.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="XLabs.Settings, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\XLabs.Settings.2.3.0-pre02\lib\portable-net45+netcore45+wpa81+wp8+monoandroid+monotouch+xamarinios10+xamarinmac\XLabs.Settings.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
@ -199,19 +267,7 @@
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Pages\QueriesPage.xaml">
|
<EmbeddedResource Include="Pages\EditEstimatePage.xaml">
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</EmbeddedResource>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Pages\MarkdownEditorPage.xaml">
|
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</EmbeddedResource>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Pages\MakeAnEstimatePage.xaml">
|
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|
@ -222,13 +278,45 @@
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Views\CommandLineEditor.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Pages\EditBillingLinePage.xaml">
|
||||||
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Pages\DashboardPage.xaml">
|
||||||
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Images\icon_add_user.png" />
|
||||||
|
<EmbeddedResource Include="Images\icon_anon_user.png" />
|
||||||
|
<EmbeddedResource Include="Images\icon_block_user.png" />
|
||||||
|
<EmbeddedResource Include="Images\icon_remove_user.png" />
|
||||||
|
<EmbeddedResource Include="Images\icon_user.png" />
|
||||||
|
<EmbeddedResource Include="Images\icon_user_settings.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Pages\HomePage.xaml">
|
||||||
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
||||||
<Import Project="..\..\packages\Xamarin.Forms.2.3.0.107\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.0.107\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
|
<Import Project="..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}.</ErrorText>
|
<ErrorText>Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.2.3.0.107\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.2.3.0.107\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
|
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- 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.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,24 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
namespace BookAStar
|
namespace BookAStar
|
||||||
{
|
{
|
||||||
public static class Constants
|
public static class Constants
|
||||||
{
|
{
|
||||||
public const string ApplicationName = "Booking Star";
|
public const string ApplicationName = "Booking Star";
|
||||||
public const string UserInfoUrl = "http://dev.pschneider.fr/api/me";
|
|
||||||
|
#region Uri
|
||||||
|
|
||||||
|
public const string YavscHomeUrl = "http://dev.pschneider.fr";
|
||||||
|
public static readonly string YavscApiUrl = YavscHomeUrl + "/api";
|
||||||
|
public static readonly string MobileRegistrationUrl = YavscApiUrl + "/gcm/register";
|
||||||
|
public static readonly string UserInfoUrl = YavscApiUrl + "/me";
|
||||||
|
public static readonly string BlogUrl = YavscApiUrl + "/blogs";
|
||||||
|
public static readonly string FsUrl = YavscApiUrl + "/fs";
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
58
BookAStar/BookAStar/Factories/ViewFactory.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
using BookAStar.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace BookAStar.Factories
|
||||||
|
{
|
||||||
|
public class ViewFactory : IViewFactory
|
||||||
|
{
|
||||||
|
private readonly IDictionary<Type, Type> _map = new Dictionary<Type, Type>();
|
||||||
|
private readonly IComponentContext _componentContext;
|
||||||
|
|
||||||
|
public ViewFactory(IComponentContext componentContext)
|
||||||
|
{
|
||||||
|
_componentContext = componentContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Register<TViewModel, TView>()
|
||||||
|
where TViewModel : class, IModelViewModel
|
||||||
|
where TView : Page
|
||||||
|
{
|
||||||
|
_map[typeof(TViewModel)] = typeof(TView);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Page Resolve<TViewModel>(Action<TViewModel> setStateAction = null) where TViewModel : class, IModelViewModel
|
||||||
|
{
|
||||||
|
TViewModel viewModel;
|
||||||
|
return Resolve<TViewModel>(out viewModel, setStateAction) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Page Resolve<TViewModel>(out TViewModel viewModel, Action<TViewModel> setStateAction = null)
|
||||||
|
where TViewModel : class, IModelViewModel
|
||||||
|
{
|
||||||
|
viewModel = _componentContext.Resolve<TViewModel>();
|
||||||
|
|
||||||
|
var viewType = _map[typeof(TViewModel)];
|
||||||
|
var view = _componentContext.Resolve(viewType) as Page;
|
||||||
|
|
||||||
|
if (setStateAction != null)
|
||||||
|
viewModel.SetState(setStateAction);
|
||||||
|
|
||||||
|
view.BindingContext = viewModel;
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Page Resolve<TViewModel>(TViewModel viewModel)
|
||||||
|
where TViewModel : class, IModelViewModel
|
||||||
|
{
|
||||||
|
var viewType = _map[typeof(TViewModel)];
|
||||||
|
var view = _componentContext.Resolve(viewType) as Page;
|
||||||
|
view.BindingContext = viewModel;
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace BookAStar
|
namespace BookAStar.Helpers
|
||||||
{
|
{
|
||||||
using Model;
|
using Model;
|
||||||
using Model.Blog;
|
using Model.Blog;
|
||||||
|
|
@ -13,25 +13,34 @@ namespace BookAStar
|
||||||
public class DataManager
|
public class DataManager
|
||||||
{
|
{
|
||||||
// TODO userinfo estimatetemplate rating service product tag
|
// TODO userinfo estimatetemplate rating service product tag
|
||||||
public RemoteEntity<BookQueryData, long> BookQueries { get; set; }
|
public RemoteEntityRO<BookQueryData, long> BookQueries { get; set; }
|
||||||
public RemoteEntity<Estimate, long> Estimates { get; set; }
|
public RemoteEntity<Estimate, long> Estimates { get; set; }
|
||||||
public RemoteEntity<Blog, long> Blogspot { get; set; }
|
public RemoteEntity<Blog, long> Blogspot { get; set; }
|
||||||
public static DataManager Current
|
public LocalEntity<ClientProviderInfo,string> Contacts { get; set; }
|
||||||
|
protected static DataManager current = new DataManager();
|
||||||
|
public static DataManager Current
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return App.CurrentApp.DataManager;
|
return current;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataManager()
|
public DataManager()
|
||||||
{
|
{
|
||||||
BookQueries = new RemoteEntity<BookQueryData, long>("bookquery",
|
BookQueries = new RemoteEntityRO<BookQueryData, long>("bookquery",
|
||||||
q => q.Id);
|
q => q.Id);
|
||||||
Estimates = new RemoteEntity<Estimate, long>("estimate",
|
Estimates = new RemoteEntity<Estimate, long>("estimate",
|
||||||
x => x.Id);
|
x => x.Id);
|
||||||
Blogspot = new RemoteEntity<Blog, long>("blog",
|
Blogspot = new RemoteEntity<Blog, long>("blog",
|
||||||
x=>x.Id);
|
x=>x.Id);
|
||||||
|
Contacts = new LocalEntity<ClientProviderInfo, string>(c => c.UserId);
|
||||||
|
BookQueries.Load();
|
||||||
|
Estimates.Load();
|
||||||
|
Blogspot.Load();
|
||||||
|
Contacts.Load();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<BookQueryData> GetBookQuery(long bookQueryId)
|
public async Task<BookQueryData> GetBookQuery(long bookQueryId)
|
||||||
{
|
{
|
||||||
return await BookQueries.Get(bookQueryId);
|
return await BookQueries.Get(bookQueryId);
|
||||||
43
BookAStar/BookAStar/Helpers/LocaLEntity.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
|
||||||
|
using BookAStar.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace BookAStar
|
||||||
|
{
|
||||||
|
public class LocalEntity<V, K> : ObservableCollection<V>, ILocalEntity<V, K> where K : IEquatable<K>
|
||||||
|
{
|
||||||
|
public V CurrentItem { get; protected set; }
|
||||||
|
public Func<V, K> GetKey { get; set; }
|
||||||
|
public LocalEntity(Func<V, K> getKey) : base()
|
||||||
|
{
|
||||||
|
if (getKey == null) throw new InvalidOperationException();
|
||||||
|
GetKey = getKey;
|
||||||
|
IList<V> l = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void Merge(V item)
|
||||||
|
{
|
||||||
|
var key = GetKey(item);
|
||||||
|
if (this.Any(x => GetKey(x).Equals(key)))
|
||||||
|
{
|
||||||
|
Remove(LocalGet(key));
|
||||||
|
}
|
||||||
|
Add(item);
|
||||||
|
CurrentItem = item;
|
||||||
|
}
|
||||||
|
public V LocalGet(K key)
|
||||||
|
{
|
||||||
|
CurrentItem = this.Single(x => GetKey(x).Equals(key));
|
||||||
|
return CurrentItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Load()
|
||||||
|
{
|
||||||
|
this.Populate<V>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ using BookAStar.Model.Auth.Account;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Plugin.Settings;
|
using Plugin.Settings;
|
||||||
using Plugin.Settings.Abstractions;
|
using Plugin.Settings.Abstractions;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
@ -12,62 +13,68 @@ using Xamarin.Forms;
|
||||||
|
|
||||||
namespace BookAStar
|
namespace BookAStar
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <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 MainSettings
|
|
||||||
{
|
|
||||||
|
|
||||||
private static ISettings AppSettings {
|
|
||||||
get {
|
|
||||||
return CrossSettings.Current;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Setting Constants
|
/// <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 MainSettings
|
||||||
|
{
|
||||||
|
|
||||||
private const string userNameKey = "user_id";
|
public static ISettings AppSettings
|
||||||
private const string PushNotificationsKey = "pushNotifs";
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return CrossSettings.Current;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Setting Constants
|
||||||
|
public static readonly string SettingsDefault = string.Empty;
|
||||||
|
public static readonly string EntityDataSettingsPrefix = "Ed";
|
||||||
|
public static readonly string EntityCursorSettingsPrefix = "Ec";
|
||||||
|
private const string userNameKey = "user_id";
|
||||||
|
private const string PushNotificationsKey = "pushNotifs";
|
||||||
|
private const string AllowGPSUsageKey = "allowGPSUsage";
|
||||||
private const string UserListsKey = "userList";
|
private const string UserListsKey = "userList";
|
||||||
private const string GoogleRegIdKey = "googleRedId";
|
private const string GoogleRegIdKey = "googleRedId";
|
||||||
|
private const string AllowProBookingOnlyKey = "allowProBookingOnly";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static readonly string UserIdDefault =
|
private static readonly string UserIdDefault =
|
||||||
string.Empty;
|
string.Empty;
|
||||||
private static readonly bool PushNotificationsDefault = false;
|
private static readonly bool PushNotificationsDefault = false;
|
||||||
|
|
||||||
public static readonly string GoogleSenderId = "325408689282";
|
public static readonly string GoogleSenderId = "325408689282";
|
||||||
|
|
||||||
private const string MusicalKey = "musical_prefs";
|
private const string MusicalKey = "musical_prefs";
|
||||||
private const string EnvironKey = "environ_prefs";
|
private const string EnvironKey = "environ_prefs";
|
||||||
private static readonly Dictionary<string,double> MusicalDefault =
|
private static readonly Dictionary<string, double> MusicalDefault =
|
||||||
new Dictionary<string, double> {
|
new Dictionary<string, double> {
|
||||||
{ "Pop", 0.5 }, { "Hip Hop" , 0.5 }, { "Rock" , 0.5 }, { "Funk", 0.5 },
|
{ "Pop", 0.5 }, { "Hip Hop" , 0.5 }, { "Rock" , 0.5 }, { "Funk", 0.5 },
|
||||||
{ "R&B", 0.5 }, { "Jazz", 0.5 }
|
{ "R&B", 0.5 }, { "Jazz", 0.5 }
|
||||||
};
|
};
|
||||||
private static readonly Dictionary<string, double> musical = new Dictionary<string, double>();
|
private static readonly Dictionary<string, double> musical = new Dictionary<string, double>();
|
||||||
private static readonly Dictionary<string,double> EnvironDefault =
|
private static readonly Dictionary<string, double> EnvironDefault =
|
||||||
new Dictionary<string, double> {
|
new Dictionary<string, double> {
|
||||||
{ "Discothèque", 0.5 }, { "Salles de concert", 0.5 },
|
{ "Discothèque", 0.5 }, { "Salles de concert", 0.5 },
|
||||||
{ "Piano bar", 0.5 }, { "Bar", 0.5 }, { "Cinema", 0.5 },
|
{ "Piano bar", 0.5 }, { "Bar", 0.5 }, { "Cinema", 0.5 },
|
||||||
{ "Théatre", 0.5 }, { "Salles des fêtes", 0.5 },
|
{ "Théatre", 0.5 }, { "Salles des fêtes", 0.5 },
|
||||||
{ "Espace publique", 0.5 }
|
{ "Espace publique", 0.5 }
|
||||||
};
|
};
|
||||||
private static readonly Dictionary<string, double> environ = new Dictionary<string, double>();
|
private static readonly Dictionary<string, double> environ = new Dictionary<string, double>();
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public static string UserName
|
public static string UserName
|
||||||
{
|
{
|
||||||
get {
|
get
|
||||||
return AppSettings.GetValueOrDefault<string>(userNameKey, null);
|
{
|
||||||
}
|
return AppSettings.GetValueOrDefault<string>(userNameKey, null);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public const string bookQueryNotificationsKey = "BookQueryNotifications";
|
public const string bookQueryNotificationsKey = "BookQueryNotifications";
|
||||||
public static BookQueryData[] GetBookQueryNotifications()
|
public static BookQueryData[] GetBookQueryNotifications()
|
||||||
{
|
{
|
||||||
|
|
@ -75,7 +82,7 @@ namespace BookAStar
|
||||||
var json = AppSettings.GetValueOrDefault<string>(bookQueryNotificationsKey);
|
var json = AppSettings.GetValueOrDefault<string>(bookQueryNotificationsKey);
|
||||||
if (!string.IsNullOrWhiteSpace(json))
|
if (!string.IsNullOrWhiteSpace(json))
|
||||||
return JsonConvert.DeserializeObject<BookQueryData[]>(json);
|
return JsonConvert.DeserializeObject<BookQueryData[]>(json);
|
||||||
return new BookQueryData[] {};
|
return new BookQueryData[] { };
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BookQueryData[] AddBookQueryNotification(BookQueryData query)
|
public static BookQueryData[] AddBookQueryNotification(BookQueryData query)
|
||||||
|
|
@ -88,9 +95,10 @@ namespace BookAStar
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GoogleRegId
|
public static string GoogleRegId
|
||||||
{
|
{
|
||||||
set {
|
set
|
||||||
|
{
|
||||||
var oldregid = GoogleRegId;
|
var oldregid = GoogleRegId;
|
||||||
AppSettings.AddOrUpdateValue<string>(GoogleRegIdKey, value);
|
AppSettings.AddOrUpdateValue<string>(GoogleRegIdKey, value);
|
||||||
// TODO If it changed, and there's an identified user,
|
// TODO If it changed, and there's an identified user,
|
||||||
|
|
@ -100,10 +108,10 @@ namespace BookAStar
|
||||||
App.CurrentApp.PostDeviceInfo();
|
App.CurrentApp.PostDeviceInfo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
get { return AppSettings.GetValueOrDefault<string>(GoogleRegIdKey); }
|
get { return AppSettings.GetValueOrDefault<string>(GoogleRegIdKey); }
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ObservableCollection<User> accountList=null;
|
private static ObservableCollection<User> accountList = null;
|
||||||
public static ObservableCollection<User> AccountList
|
public static ObservableCollection<User> AccountList
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -117,17 +125,19 @@ namespace BookAStar
|
||||||
{
|
{
|
||||||
var users = JsonConvert.DeserializeObject<User[]>(json);
|
var users = JsonConvert.DeserializeObject<User[]>(json);
|
||||||
if (users != null)
|
if (users != null)
|
||||||
foreach (User user in users)
|
foreach (User user in users)
|
||||||
{
|
{
|
||||||
accountList.Add(user);
|
accountList.Add(user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return accountList;
|
return accountList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static User CurrentUser { get
|
public static User CurrentUser
|
||||||
|
{
|
||||||
|
get
|
||||||
{
|
{
|
||||||
var uname = UserName;
|
var uname = UserName;
|
||||||
if (uname == null) return null;
|
if (uname == null) return null;
|
||||||
|
|
@ -147,12 +157,19 @@ namespace BookAStar
|
||||||
if (olduserid != value.Id)
|
if (olduserid != value.Id)
|
||||||
{
|
{
|
||||||
App.CurrentApp.PostDeviceInfo();
|
App.CurrentApp.PostDeviceInfo();
|
||||||
|
UserChanged.Invoke(App.CurrentApp, new EventArgs());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO else Unregister the device
|
else if (olduserid != null)
|
||||||
|
{
|
||||||
|
UserChanged.Invoke(App.CurrentApp, new EventArgs());
|
||||||
|
// TODO else Unregister this device
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static event EventHandler<EventArgs> UserChanged;
|
||||||
|
|
||||||
public static void SaveUser(User user)
|
public static void SaveUser(User user)
|
||||||
{
|
{
|
||||||
var existent = AccountList.FirstOrDefault(u => u.UserName == user.UserName);
|
var existent = AccountList.FirstOrDefault(u => u.UserName == user.UserName);
|
||||||
|
|
@ -165,50 +182,112 @@ namespace BookAStar
|
||||||
|
|
||||||
public static User GetUser(string username)
|
public static User GetUser(string username)
|
||||||
{
|
{
|
||||||
return AccountList.FirstOrDefault(a=>a.UserName == username);
|
return AccountList.FirstOrDefault(a => a.UserName == username);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool PushNotifications {
|
public static bool PushNotifications
|
||||||
get {
|
{
|
||||||
return AppSettings.GetValueOrDefault<bool>(
|
get
|
||||||
PushNotificationsKey,
|
{
|
||||||
PushNotificationsDefault);
|
return AppSettings.GetValueOrDefault<bool>(
|
||||||
}
|
PushNotificationsKey,
|
||||||
set {
|
PushNotificationsDefault);
|
||||||
AppSettings.AddOrUpdateValue<bool> (
|
|
||||||
PushNotificationsKey,
|
|
||||||
value);
|
|
||||||
}
|
}
|
||||||
}
|
set
|
||||||
|
{
|
||||||
|
// TODO Stop Broadcast receiver
|
||||||
|
AppSettings.AddOrUpdateValue<bool>(
|
||||||
|
PushNotificationsKey,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void SetMusical (string key, double value)
|
public static bool AllowGPSUsage
|
||||||
{
|
{
|
||||||
AppSettings.AddOrUpdateValue <double> (MusicalKey + key, value);
|
get
|
||||||
}
|
{
|
||||||
|
return AppSettings.GetValueOrDefault<bool>(
|
||||||
|
AllowGPSUsageKey,
|
||||||
|
PushNotificationsDefault);
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
AppSettings.AddOrUpdateValue<bool>(
|
||||||
|
AllowGPSUsageKey,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// TODO make it a server side user's parameter
|
||||||
|
public static bool AllowProBookingOnly
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return AppSettings.GetValueOrDefault<bool>(
|
||||||
|
AllowProBookingOnlyKey,
|
||||||
|
PushNotificationsDefault);
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
AppSettings.AddOrUpdateValue<bool>(
|
||||||
|
AllowProBookingOnlyKey,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static void SetMusical(string key, double value)
|
||||||
|
{
|
||||||
|
AppSettings.AddOrUpdateValue<double>(MusicalKey + key, value);
|
||||||
|
}
|
||||||
|
|
||||||
public static double GetMusical (string key)
|
public static double GetMusical(string key)
|
||||||
{
|
{
|
||||||
return AppSettings.GetValueOrDefault <double> (MusicalKey + key, MusicalDefault [key]);
|
return AppSettings.GetValueOrDefault<double>(MusicalKey + key, MusicalDefault[key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dictionary<string,double> Musical {
|
public static Dictionary<string, double> Musical
|
||||||
get {
|
{
|
||||||
return musical;
|
get
|
||||||
}
|
{
|
||||||
}
|
return musical;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static Dictionary<string, double> Environ
|
public static Dictionary<string, double> Environ
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return environ;
|
return environ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public const string YavscHomeUrl = "http://dev.pschneider.fr";
|
/// <summary>
|
||||||
public static readonly string YavscApiUrl = "http://dev.pschneider.fr/api";
|
/// Use a sub-key to make persist different tables with the same definition.
|
||||||
public static readonly string MobileRegistrationUrl = YavscApiUrl + "/gcm/register";
|
/// </summary>
|
||||||
public static readonly string UserInfoUrl = YavscApiUrl + "/me";
|
/// <typeparam name="V"></typeparam>
|
||||||
public static readonly string BlogUrl = YavscApiUrl + "/blogs";
|
/// <param name="collection"></param>
|
||||||
public const string ApplicationName = "BookAStar";
|
/// <param name="subKey"></param>
|
||||||
|
public static void Populate<V>(this IList<V> collection, string subKey = null)
|
||||||
|
{
|
||||||
|
var key = $"{EntityDataSettingsPrefix}/{subKey}/{typeof(V).FullName}";
|
||||||
|
var data = AppSettings.GetValueOrDefault<string>(key, null);
|
||||||
|
if (data != null)
|
||||||
|
{
|
||||||
|
var items = JsonConvert.DeserializeObject<IList<V>>(data);
|
||||||
|
if (items != null)
|
||||||
|
foreach (var item in items)
|
||||||
|
collection.Add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Saves a list
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="V"></typeparam>
|
||||||
|
/// <param name="collection"></param>
|
||||||
|
/// <param name="subKey"></param>
|
||||||
|
public static void SaveCollection<V>(this IList<V> collection, string subKey=null)
|
||||||
|
{
|
||||||
|
if (collection == null) return;
|
||||||
|
var key = $"{EntityDataSettingsPrefix}/{subKey}/{typeof(V).FullName}";
|
||||||
|
AppSettings.AddOrUpdateValue(key, JsonConvert.SerializeObject(collection));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
10
BookAStar/BookAStar/Helpers/NotIdentifiedException.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BookAStar
|
||||||
|
{
|
||||||
|
public class NotIdentifiedException : Exception
|
||||||
|
{
|
||||||
|
public NotIdentifiedException(string message) : base(message) { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
59
BookAStar/BookAStar/Helpers/ObservableString.cs
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace BookAStar
|
||||||
|
{
|
||||||
|
public class ObservableString : IObservable<string>, IDisposable
|
||||||
|
{
|
||||||
|
public ObservableString(string data)
|
||||||
|
{
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
private string data = null;
|
||||||
|
private List<IObserver<string>> observers = new List<IObserver<string>>();
|
||||||
|
|
||||||
|
public string Data
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (data != value)
|
||||||
|
{
|
||||||
|
data = value;
|
||||||
|
foreach (var obs in observers)
|
||||||
|
obs.OnCompleted();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static explicit operator ObservableString (string data)
|
||||||
|
{
|
||||||
|
return new ObservableString(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static explicit operator string (ObservableString observable)
|
||||||
|
{
|
||||||
|
return observable.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
observers = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IDisposable Subscribe(IObserver<string> observer)
|
||||||
|
{
|
||||||
|
observers.Add(observer);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
20
BookAStar/BookAStar/Helpers/PageHelpers.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace BookAStar.Helpers
|
||||||
|
{
|
||||||
|
public static class PageHelpers
|
||||||
|
{
|
||||||
|
public static async Task<bool> Confirm(this Page page, string title, string procedure)
|
||||||
|
{
|
||||||
|
string yes = "Oui", no = "Non";
|
||||||
|
var answer = await page.DisplayAlert(title,
|
||||||
|
procedure, yes, no);
|
||||||
|
return answer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
27
BookAStar/BookAStar/Helpers/PropertySupport.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BookAStar.Helpers
|
||||||
|
{
|
||||||
|
public static class PropertySupport
|
||||||
|
{
|
||||||
|
public static string ExtractPropertyName<T>(Expression<Func<T>> propertyExpression)
|
||||||
|
{
|
||||||
|
if (propertyExpression == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException("propertyExpression");
|
||||||
|
}
|
||||||
|
|
||||||
|
var memberExpression = propertyExpression.Body as MemberExpression;
|
||||||
|
if (memberExpression == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalide Expression", "propertyExpression");
|
||||||
|
}
|
||||||
|
return memberExpression.Member.Name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,35 +1,32 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
namespace BookAStar
|
namespace BookAStar.Helpers
|
||||||
{
|
{
|
||||||
public class RemoteEntity<V,K> : ObservableCollection<V>, ICommand where K : IEquatable<K>
|
|
||||||
|
public class RemoteEntity<V,K> : LocalEntity<V, K>, ICommand where K : IEquatable<K>
|
||||||
{
|
{
|
||||||
private string _controller;
|
private string _controller;
|
||||||
public event EventHandler CanExecuteChanged;
|
public event EventHandler CanExecuteChanged;
|
||||||
public bool IsExecuting { get; private set; }
|
public bool IsExecuting { get; private set; }
|
||||||
private HttpClient client;
|
|
||||||
private Uri controllerUri;
|
private Uri controllerUri;
|
||||||
protected Func<V, K> GetKey { get; set; }
|
|
||||||
public bool CanExecute(object parameter)
|
public bool CanExecute(object parameter)
|
||||||
{
|
{
|
||||||
return !IsExecuting;
|
return !IsExecuting && (MainSettings.CurrentUser != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RemoteEntity(string controllerName, Func<V,K> getKey):base()
|
public RemoteEntity(string controllerName, Func<V,K> getKey):base(getKey)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(controllerName) || getKey == null)
|
if (string.IsNullOrWhiteSpace(controllerName))
|
||||||
throw new InvalidOperationException();
|
throw new InvalidOperationException();
|
||||||
_controller = controllerName;
|
_controller = controllerName;
|
||||||
GetKey = getKey;
|
controllerUri = new Uri(Constants.YavscApiUrl + "/" + _controller);
|
||||||
client = new HttpClient();
|
|
||||||
controllerUri = new Uri(MainSettings.YavscApiUrl + "/" + _controller);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BeforeExecute()
|
private void BeforeExecute()
|
||||||
|
|
@ -37,8 +34,7 @@ namespace BookAStar
|
||||||
if (IsExecuting)
|
if (IsExecuting)
|
||||||
throw new InvalidOperationException("Already executing");
|
throw new InvalidOperationException("Already executing");
|
||||||
IsExecuting = true;
|
IsExecuting = true;
|
||||||
if (CanExecuteChanged != null)
|
CanExecuteChanged.Invoke(this, new EventArgs());
|
||||||
CanExecuteChanged.Invoke(this, new EventArgs());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -48,64 +44,70 @@ namespace BookAStar
|
||||||
public async void Execute(object parameter)
|
public async void Execute(object parameter)
|
||||||
{
|
{
|
||||||
BeforeExecute();
|
BeforeExecute();
|
||||||
// Update credentials
|
using (HttpClient client = UserHelpers.CreateClient())
|
||||||
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(
|
|
||||||
"Bearer", MainSettings.CurrentUser.YavscTokens.AccessToken);
|
|
||||||
// Get the whole data
|
|
||||||
|
|
||||||
var response = await client.GetAsync(controllerUri);
|
|
||||||
if (response.IsSuccessStatusCode)
|
|
||||||
{
|
{
|
||||||
var content = await response.Content.ReadAsStringAsync();
|
// Get the whole data
|
||||||
List<V> col = JsonConvert.DeserializeObject<List<V>>(content);
|
try
|
||||||
// LocalData.Clear();
|
|
||||||
foreach (var item in col)
|
|
||||||
{
|
{
|
||||||
UpdateOrAdd(item);
|
using (var response = await client.GetAsync(controllerUri))
|
||||||
|
{
|
||||||
|
if (response.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
var content = await response.Content.ReadAsStringAsync();
|
||||||
|
List<V> col = JsonConvert.DeserializeObject<List<V>>(content);
|
||||||
|
// LocalData.Clear();
|
||||||
|
foreach (var item in col)
|
||||||
|
{
|
||||||
|
Merge(item);
|
||||||
|
}
|
||||||
|
this.SaveCollection();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (WebException webex) {
|
||||||
|
throw new ServiceNotAvailable("No remote entity", webex);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
AfterExecuting();
|
AfterExecuting();
|
||||||
}
|
}
|
||||||
protected virtual void UpdateOrAdd (V item)
|
|
||||||
{
|
|
||||||
var key = GetKey(item);
|
|
||||||
if (this.Any(x => GetKey(x).Equals(key)))
|
|
||||||
{
|
|
||||||
Remove(LocalGet(key));
|
|
||||||
}
|
|
||||||
Add(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
public V LocalGet(K key)
|
|
||||||
{
|
|
||||||
return this.Single(x => GetKey(x).Equals(key));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AfterExecuting()
|
private void AfterExecuting()
|
||||||
{
|
{
|
||||||
IsExecuting = false;
|
IsExecuting = false;
|
||||||
if (CanExecuteChanged != null)
|
CanExecuteChanged.Invoke(this, new EventArgs());
|
||||||
CanExecuteChanged.Invoke(this, new EventArgs());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<V> Get(K key)
|
public async Task<V> Get(K key)
|
||||||
|
{
|
||||||
|
var item = LocalGet(key);
|
||||||
|
if (item==null) item = await RemoteGet(key);
|
||||||
|
CurrentItem = item;
|
||||||
|
return CurrentItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<V> RemoteGet(K key)
|
||||||
{
|
{
|
||||||
V item = default(V);
|
V item = default(V);
|
||||||
BeforeExecute();
|
BeforeExecute();
|
||||||
// Get the whole data
|
// Get the whole data
|
||||||
var uri = new Uri(controllerUri.AbsolutePath+"/"+key.ToString());
|
var uri = new Uri(controllerUri.AbsolutePath+"/"+key.ToString());
|
||||||
|
|
||||||
var response = await client.GetAsync(uri);
|
using (HttpClient client = new HttpClient())
|
||||||
if (response.IsSuccessStatusCode)
|
|
||||||
{
|
{
|
||||||
var content = await response.Content.ReadAsStringAsync();
|
using (var response = await client.GetAsync(uri))
|
||||||
item = JsonConvert.DeserializeObject<V>(content);
|
{
|
||||||
// LocalData.Clear();
|
if (response.IsSuccessStatusCode)
|
||||||
UpdateOrAdd(item);
|
{
|
||||||
|
var content = await response.Content.ReadAsStringAsync();
|
||||||
|
item = JsonConvert.DeserializeObject<V>(content);
|
||||||
|
Merge(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AfterExecuting();
|
AfterExecuting();
|
||||||
|
CurrentItem = item;
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace BookAStar.Helpers
|
namespace BookAStar.Helpers
|
||||||
{
|
{
|
||||||
class RemoteEntityRO<V,K>: RemoteEntity<V,K> where K: IEquatable<K>
|
public class RemoteEntityRO<V,K>: RemoteEntity<V,K> where K: IEquatable<K>
|
||||||
{
|
{
|
||||||
public RemoteEntityRO (string controllerName,
|
public RemoteEntityRO (string controllerName,
|
||||||
Func<V,K> getKey) : base(controllerName,getKey)
|
Func<V,K> getKey) : base(controllerName,getKey)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateOrAdd(V item)
|
public override void Merge(V item)
|
||||||
{
|
{
|
||||||
var key = GetKey(item);
|
var key = GetKey(item);
|
||||||
if (this.Any(x => GetKey(x).Equals(key))) { return; }
|
if (this.Any(x => GetKey(x).Equals(key))) { return; }
|
||||||
|
|
|
||||||
10
BookAStar/BookAStar/Helpers/ServiceNotAvailable1.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BookAStar
|
||||||
|
{
|
||||||
|
public class ServiceNotAvailable : Exception
|
||||||
|
{
|
||||||
|
public ServiceNotAvailable(string message, Exception innerException) : base(message, innerException) { }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
43
BookAStar/BookAStar/Helpers/Settings.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
// Helpers/Settings.cs
|
||||||
|
#if USELESS_but_makes_the_component_removable // this file must exist ^^
|
||||||
|
|
||||||
|
namespace BookAStar.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
|
||||||
|
{
|
||||||
|
public static ISettings AppSettings
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return CrossSettings.Current;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Setting Constants
|
||||||
|
|
||||||
|
private const string SettingsKey = "settings_key";
|
||||||
|
public static readonly string SettingsDefault = string.Empty;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
public static string GeneralSettings
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return AppSettings.GetValueOrDefault<string>(SettingsKey, SettingsDefault);
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
AppSettings.AddOrUpdateValue<string>(SettingsKey, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
59
BookAStar/BookAStar/Helpers/UserHelpers.cs
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace BookAStar.Helpers
|
||||||
|
{
|
||||||
|
public static class UserHelpers
|
||||||
|
{
|
||||||
|
public static ImageSource Avatar(string avatarPath)
|
||||||
|
{
|
||||||
|
var result = avatarPath == null ?
|
||||||
|
ImageSource.FromResource( "BookAStar.Images.icon_user.png") :
|
||||||
|
avatarPath.StartsWith("res://") ?
|
||||||
|
ImageSource.FromResource(avatarPath.Substring(6)) :
|
||||||
|
ImageSource.FromUri(new Uri(avatarPath));
|
||||||
|
var test = ImageSource.FromResource("none.resource.png");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HttpClient CreateClient()
|
||||||
|
{
|
||||||
|
var client = new HttpClient();
|
||||||
|
client.DefaultRequestHeaders.Authorization =
|
||||||
|
new System.Net.Http.Headers.AuthenticationHeaderValue(
|
||||||
|
"Bearer", MainSettings.CurrentUser.YavscTokens.AccessToken);
|
||||||
|
return client;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Uploads the given stream to
|
||||||
|
/// /api/fs, in order to be saved under the given file name
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inputStream"></param>
|
||||||
|
/// <param name="fileName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<bool> Upload(Stream inputStream, string fileName)
|
||||||
|
{
|
||||||
|
using (var client = CreateClient())
|
||||||
|
{
|
||||||
|
using (var content =
|
||||||
|
new MultipartFormDataContent("Upload----" + DateTime.Now.ToString(CultureInfo.InvariantCulture)))
|
||||||
|
{
|
||||||
|
content.Add(new StreamContent(inputStream), "Files", fileName);
|
||||||
|
|
||||||
|
using (
|
||||||
|
var message =
|
||||||
|
await client.PostAsync(Constants.FsUrl, content))
|
||||||
|
{
|
||||||
|
return (message.IsSuccessStatusCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
BookAStar/BookAStar/Images/icon_add_user.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
BookAStar/BookAStar/Images/icon_anon_user.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
BookAStar/BookAStar/Images/icon_block_user.png
Normal file
|
After Width: | Height: | Size: 7 KiB |
BIN
BookAStar/BookAStar/Images/icon_remove_user.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
BookAStar/BookAStar/Images/icon_user.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
BookAStar/BookAStar/Images/icon_user_settings.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
12
BookAStar/BookAStar/Interfaces/IBillingLine.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BookAStar.Interfaces
|
||||||
|
{
|
||||||
|
public interface IBillingLine
|
||||||
|
{
|
||||||
|
int Count { get; set; }
|
||||||
|
string Description { get; set; }
|
||||||
|
TimeSpan Duration { get; set; }
|
||||||
|
decimal UnitaryCost { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
15
BookAStar/BookAStar/Interfaces/IBookQueryData.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
using System;
|
||||||
|
using BookAStar.Model.Social;
|
||||||
|
using BookAStar.Model;
|
||||||
|
|
||||||
|
namespace BookAStar.Interfaces
|
||||||
|
{
|
||||||
|
public interface IBookQueryData
|
||||||
|
{
|
||||||
|
ClientProviderInfo Client { get; set; }
|
||||||
|
DateTime EventDate { get; set; }
|
||||||
|
long Id { get; set; }
|
||||||
|
Location Location { get; set; }
|
||||||
|
decimal? Previsionnal { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
11
BookAStar/BookAStar/Interfaces/IComponentContext.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BookAStar.Interfaces
|
||||||
|
{
|
||||||
|
public interface IComponentContext
|
||||||
|
{
|
||||||
|
T Resolve<T>() ;
|
||||||
|
object Resolve(Type t);
|
||||||
|
}
|
||||||
|
}
|
||||||
20
BookAStar/BookAStar/Interfaces/IEstimate.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
using BookAStar.Model.Workflow;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace BookAStar.Model.Interfaces
|
||||||
|
{
|
||||||
|
public interface IEstimate
|
||||||
|
{
|
||||||
|
List<string> AttachedFiles { get; set; }
|
||||||
|
List<string> AttachedGraphicList { get; }
|
||||||
|
List<BillingLine> Bill { get; set; }
|
||||||
|
string ClientId { get; set; }
|
||||||
|
long? CommandId { get; set; }
|
||||||
|
string CommandType { get; set; }
|
||||||
|
string Description { get; set; }
|
||||||
|
long Id { get; set; }
|
||||||
|
string OwnerId { get; set; }
|
||||||
|
int? Status { get; set; }
|
||||||
|
string Title { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
21
BookAStar/BookAStar/Interfaces/ILocalEntity.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BookAStar
|
||||||
|
{
|
||||||
|
public interface ILoadable
|
||||||
|
{
|
||||||
|
void Load();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ILocalEntity<V, K> : ILoadable where K : IEquatable<K>
|
||||||
|
{
|
||||||
|
V CurrentItem { get; }
|
||||||
|
|
||||||
|
Func<V, K> GetKey { get; set; }
|
||||||
|
|
||||||
|
V LocalGet(K key);
|
||||||
|
|
||||||
|
void Merge(V item);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
13
BookAStar/BookAStar/Interfaces/IMDEditor.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
using System;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace BookAStar.Interfaces
|
||||||
|
{
|
||||||
|
public interface IMDEditor
|
||||||
|
{
|
||||||
|
View EditorView { get; }
|
||||||
|
string Text { get; set; }
|
||||||
|
bool Editable { get; set; }
|
||||||
|
Action<string> Edited { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
16
BookAStar/BookAStar/Interfaces/IModelViewModel.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BookAStar.Interfaces
|
||||||
|
{
|
||||||
|
public interface IModelViewModel : INotifyPropertyChanged
|
||||||
|
{
|
||||||
|
string Title { get; set; }
|
||||||
|
|
||||||
|
void SetState<T>(Action<T> action) where T : class, IModelViewModel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,14 +3,13 @@ using System;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using Yavsc.Models.Identity;
|
using Yavsc.Models.Identity;
|
||||||
|
|
||||||
namespace BookAStar
|
namespace BookAStar.Interfaces
|
||||||
{
|
{
|
||||||
public interface IPlatform
|
public interface IPlatform
|
||||||
{
|
{
|
||||||
void OpenWeb (string Uri);
|
void OpenWeb (string Uri);
|
||||||
|
|
||||||
// TODO Better
|
// TODO Better
|
||||||
|
|
||||||
string GCMStatusMessage { get; }
|
string GCMStatusMessage { get; }
|
||||||
|
|
||||||
bool EnablePushNotifications (bool enable);
|
bool EnablePushNotifications (bool enable);
|
||||||
|
|
@ -24,8 +23,6 @@ namespace BookAStar
|
||||||
TAnswer InvokeApi<TAnswer>(string method, object arg);
|
TAnswer InvokeApi<TAnswer>(string method, object arg);
|
||||||
|
|
||||||
object InvokeApi(string method, object arg);
|
object InvokeApi(string method, object arg);
|
||||||
|
|
||||||
View CreateMarkdownView(string markdown, Action<string> update);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
25
BookAStar/BookAStar/Interfaces/IViewFactory.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace BookAStar.Interfaces
|
||||||
|
{
|
||||||
|
public interface IViewFactory
|
||||||
|
{
|
||||||
|
void Register<TViewModel, TView>()
|
||||||
|
where TViewModel : class, IModelViewModel
|
||||||
|
where TView : Page;
|
||||||
|
|
||||||
|
Page Resolve<TViewModel>(Action<TViewModel> setStateAction = null)
|
||||||
|
where TViewModel : class, IModelViewModel;
|
||||||
|
|
||||||
|
Page Resolve<TViewModel>(out TViewModel viewModel, Action<TViewModel> setStateAction = null)
|
||||||
|
where TViewModel : class, IModelViewModel;
|
||||||
|
|
||||||
|
Page Resolve<TViewModel>(TViewModel viewModel)
|
||||||
|
where TViewModel : class, IModelViewModel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
using System;
|
using BookAStar.Helpers;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
namespace BookAStar.Model.Auth.Account
|
namespace BookAStar.Model.Auth.Account
|
||||||
{
|
{
|
||||||
|
|
@ -79,6 +81,14 @@ namespace BookAStar.Model.Auth.Account
|
||||||
OnPropertyChanged("Avatar");
|
OnPropertyChanged("Avatar");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[JsonIgnore]
|
||||||
|
public ImageSource AvatarSource
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return UserHelpers.Avatar(avatar);
|
||||||
|
}
|
||||||
|
}
|
||||||
private Tokens yavscTokens;
|
private Tokens yavscTokens;
|
||||||
public Tokens YavscTokens
|
public Tokens YavscTokens
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,10 @@
|
||||||
using BookAStar.Model.Social;
|
using BookAStar.Interfaces;
|
||||||
|
using BookAStar.Model.Social;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace BookAStar.Model
|
namespace BookAStar.Model
|
||||||
{
|
{
|
||||||
public class ClientProviderInfo
|
public class BookQueryData : IBookQueryData
|
||||||
{
|
|
||||||
public string UserName { get; set; }
|
|
||||||
public string UserId { get; set; }
|
|
||||||
public int Rate { get; set; }
|
|
||||||
}
|
|
||||||
public class BookQueryData
|
|
||||||
{
|
{
|
||||||
public ClientProviderInfo Client { get; set; }
|
public ClientProviderInfo Client { get; set; }
|
||||||
public Location Location { get; set; }
|
public Location Location { get; set; }
|
||||||
|
|
|
||||||
29
BookAStar/BookAStar/Model/ClientProviderInfo.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
using BookAStar.Helpers;
|
||||||
|
using BookAStar.Model.Social;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace BookAStar.Model
|
||||||
|
{
|
||||||
|
public class ClientProviderInfo
|
||||||
|
{
|
||||||
|
public string UserName { get; set; }
|
||||||
|
|
||||||
|
public string Avatar { get; set; }
|
||||||
|
public string UserId { get; set; }
|
||||||
|
public int Rate { get; set; }
|
||||||
|
public string EMail { get; set; }
|
||||||
|
public string Phone { get; set; }
|
||||||
|
public Location BillingAddress { get; set; }
|
||||||
|
// TODO Get User Professional status existence as a boolean
|
||||||
|
// And hack the avatar with
|
||||||
|
[JsonIgnore]
|
||||||
|
public ImageSource AvatarOrNot
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return UserHelpers.Avatar(Avatar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -5,17 +5,14 @@ using System.Collections.ObjectModel;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace BookAStar
|
namespace BookAStar
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use Helpers.DataManager")]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static class Manager
|
public static class Manager
|
||||||
{
|
{
|
||||||
static Manager ()
|
static Manager ()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ICommand RefreshBookQueries;
|
public static ICommand RefreshBookQueries;
|
||||||
// TODO WIP TEST rop this
|
// TODO WIP TEST rop this
|
||||||
private static Location[] _places = new Location[] {
|
private static Location[] _places = new Location[] {
|
||||||
|
|
|
||||||
|
|
@ -27,18 +27,16 @@ namespace BookAStar.Model.Social
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class Location : Position {
|
public class Location : Position
|
||||||
|
{
|
||||||
|
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public string Address { get; set; }
|
public string Address { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LocalizedEvent : YaEvent
|
public class LocalizedEvent : YaEvent
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public Location Location { get; set; }
|
public Location Location { get; set; }
|
||||||
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
14
BookAStar/BookAStar/Model/Workflow/BillingLine.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
|
||||||
|
using BookAStar.Interfaces;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BookAStar.Model.Workflow
|
||||||
|
{
|
||||||
|
public class BillingLine : IBillingLine
|
||||||
|
{
|
||||||
|
public string Description { get; set; }
|
||||||
|
public TimeSpan Duration { get; set; }
|
||||||
|
public int Count { get; set; } = 1;
|
||||||
|
public decimal UnitaryCost { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
|
|
||||||
namespace BookAStar.Model.Workflow
|
|
||||||
{
|
|
||||||
|
|
||||||
public class CommandLine
|
|
||||||
{
|
|
||||||
public long Id { get; set; }
|
|
||||||
public string Comment { get; set; }
|
|
||||||
public BaseProduct Article { get; set; }
|
|
||||||
public int Count { get; set; }
|
|
||||||
public decimal UnitaryCost { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,17 +1,20 @@
|
||||||
using System.Collections.Generic;
|
using BookAStar.Helpers;
|
||||||
|
using BookAStar.Model.Interfaces;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace BookAStar.Model.Workflow
|
namespace BookAStar.Model.Workflow
|
||||||
{
|
{
|
||||||
public partial class Estimate
|
public partial class Estimate : IEstimate
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
|
|
||||||
public long? CommandId { get; set; }
|
public long? CommandId { get; set; }
|
||||||
|
public string CommandType { get; set; }
|
||||||
|
// Markdown expected
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public int? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public List<CommandLine> Bill { get; set; }
|
public List<BillingLine> Bill { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// List of attached graphic files
|
/// List of attached graphic files
|
||||||
/// to this estimate, as relative pathes to
|
/// to this estimate, as relative pathes to
|
||||||
|
|
@ -19,11 +22,11 @@ namespace BookAStar.Model.Workflow
|
||||||
/// In db, they are separated by <c>:</c>
|
/// In db, they are separated by <c>:</c>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<string> AttachedGraphicList { get; private set; }
|
public List<string> AttachedGraphicList { get; set; }
|
||||||
|
|
||||||
public string AttachedGraphicsString
|
public string AttachedGraphicsString
|
||||||
{
|
{
|
||||||
get { return string.Join(":", AttachedGraphicList); }
|
get { return AttachedGraphicList==null?null:string.Join(":", AttachedGraphicList); }
|
||||||
set { AttachedGraphicList = value.Split(':').ToList(); }
|
set { AttachedGraphicList = value.Split(':').ToList(); }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -36,12 +39,40 @@ namespace BookAStar.Model.Workflow
|
||||||
public List<string> AttachedFiles { get; set; }
|
public List<string> AttachedFiles { get; set; }
|
||||||
public string AttachedFilesString
|
public string AttachedFilesString
|
||||||
{
|
{
|
||||||
get { return string.Join(":", AttachedFiles); }
|
get { return AttachedFiles == null ? null : string.Join(":", AttachedFiles); }
|
||||||
set { AttachedFiles = value.Split(':').ToList(); }
|
set { AttachedFiles = value.Split(':').ToList(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string OwnerId { get; set; }
|
public string OwnerId { get; set; }
|
||||||
|
|
||||||
public string ClientId { get; set; }
|
public string ClientId { get; set; }
|
||||||
|
|
||||||
|
public BookQueryData Query
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (CommandId.HasValue)
|
||||||
|
{
|
||||||
|
return DataManager.Current.BookQueries.LocalGet(CommandId.Value);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProviderInfo Client
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return DataManager.Current.Contacts.LocalGet(ClientId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public decimal Total { get
|
||||||
|
{
|
||||||
|
return Bill?.Aggregate((decimal)0, (t, l) => t + l.Count * l.UnitaryCost) ?? (decimal)0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
46
BookAStar/BookAStar/Pages/AccountChooserPage.xaml
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
|
xmlns:local="clr-namespace:BookAStar;assembly=BookAStar"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
x:Class="BookAStar.Pages.AccountChooserPage"
|
||||||
|
Title="Paramètres Booking star" Style="{StaticResource PageStyle}"
|
||||||
|
xmlns:lc="clr-namespace:XLabs.Forms.Controls;assembly=XLabs.Forms"
|
||||||
|
xmlns:lb="clr-namespace:XLabs.Forms.Behaviors;assembly=XLabs.Forms">
|
||||||
|
|
||||||
|
<StackLayout>
|
||||||
|
<Label Text="Compte utilisateur" StyleClass="Header"/>
|
||||||
|
|
||||||
|
<ListView x:Name="AccountListView"
|
||||||
|
SeparatorVisibility="Default"
|
||||||
|
VerticalOptions="FillAndExpand"
|
||||||
|
>
|
||||||
|
<ListView.Header>
|
||||||
|
<StackLayout Orientation="Horizontal">
|
||||||
|
|
||||||
|
<Button x:Name="AddAccountBtn" Text="Connection, ou création d'un compte" />
|
||||||
|
</StackLayout>
|
||||||
|
</ListView.Header>
|
||||||
|
|
||||||
|
<ListView.ItemTemplate HeightRequest="60" VerticalOptions="StartAndExpand">
|
||||||
|
<DataTemplate>
|
||||||
|
<ViewCell>
|
||||||
|
<Grid Padding="5"
|
||||||
|
ColumnSpacing="10"
|
||||||
|
RowSpacing="2" >
|
||||||
|
<Image Source="{Binding AvatarSource}" HeightRequest="80"
|
||||||
|
x:Name="avatarImage"/>
|
||||||
|
<Label Grid.Column="0" Text="{Binding UserName}" >
|
||||||
|
|
||||||
|
</Label>
|
||||||
|
</Grid>
|
||||||
|
</ViewCell>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
<ListView.Footer>
|
||||||
|
<StackLayout></StackLayout>
|
||||||
|
</ListView.Footer>
|
||||||
|
|
||||||
|
</ListView>
|
||||||
|
|
||||||
|
</StackLayout>
|
||||||
|
</ContentPage>
|
||||||
|
|
@ -6,17 +6,19 @@ using System.Windows.Input;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using BookAStar.Helpers;
|
||||||
|
using XLabs.Forms.Behaviors;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using XLabs.Forms.Controls;
|
||||||
|
|
||||||
namespace BookAStar
|
namespace BookAStar.Pages
|
||||||
{
|
{
|
||||||
|
|
||||||
public partial class SettingsPage : ContentPage
|
public partial class AccountChooserPage : ContentPage
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public ICommand RemoteSettingsRefreshCommand { get; private set; }
|
public ICommand RemoteSettingsRefreshCommand { get; private set; }
|
||||||
|
|
||||||
public SettingsPage ()
|
public AccountChooserPage ()
|
||||||
{
|
{
|
||||||
InitializeComponent ();
|
InitializeComponent ();
|
||||||
|
|
||||||
|
|
@ -28,25 +30,20 @@ namespace BookAStar
|
||||||
|
|
||||||
AddAccountBtn.Clicked += AddAccountBtn_Clicked;
|
AddAccountBtn.Clicked += AddAccountBtn_Clicked;
|
||||||
|
|
||||||
RemoveAccountBouton.Clicked += RemoveAccountBouton_Clicked;
|
// avatarImage.
|
||||||
|
//RemoveAccountBouton.Clicked += RemoveAccountBouton_Clicked;
|
||||||
|
|
||||||
AccountListView.ItemSelected += Accounts_ItemSelected;
|
AccountListView.ItemSelected += Accounts_ItemSelected;
|
||||||
|
DumpParam = new RelayGesture((g, x) =>
|
||||||
pushstatus.Toggled += Pushstatus_Toggled;
|
{
|
||||||
|
if (g.GestureType == GestureType.Swipe && g.Direction == Directionality.Left)
|
||||||
BtnViewDeviceInfo.Clicked += BtnDeviceInfo_Clicked;
|
{
|
||||||
}
|
RemoveAccount();
|
||||||
|
}
|
||||||
private void BtnDeviceInfo_Clicked(object sender, EventArgs e)
|
});
|
||||||
{
|
|
||||||
((BookAStar.App) App.Current).ShowDeviceInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void Pushstatus_Toggled(object sender, ToggledEventArgs e)
|
|
||||||
{
|
|
||||||
MainSettings.PushNotifications = pushstatus.IsToggled;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RelayGesture DumpParam { get; set; }
|
||||||
public ObservableCollection<User> Accounts { get; private set; }
|
public ObservableCollection<User> Accounts { get; private set; }
|
||||||
public Dictionary<string, double> Musical { get; private set; }
|
public Dictionary<string, double> Musical { get; private set; }
|
||||||
public Dictionary<string, double> Environ { get; private set; }
|
public Dictionary<string, double> Environ { get; private set; }
|
||||||
|
|
@ -55,36 +52,30 @@ namespace BookAStar
|
||||||
{
|
{
|
||||||
var user = e.SelectedItem as User;
|
var user = e.SelectedItem as User;
|
||||||
// should later invoke IdentificationChanged
|
// should later invoke IdentificationChanged
|
||||||
|
// FIXME don't do it when it's not from the user action
|
||||||
MainSettings.CurrentUser = user;
|
MainSettings.CurrentUser = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void RemoveAccountBouton_Clicked(object sender, EventArgs e)
|
private async void RemoveAccount()
|
||||||
{
|
{
|
||||||
User user = AccountListView.SelectedItem as User;
|
User user = AccountListView.SelectedItem as User;
|
||||||
var doIt = await Confirm("Suppression de l'identification",
|
var doIt = await this.Confirm("Suppression de l'identification",
|
||||||
$"Vous êtes sur le point de supprimer votre identification pour ce compte : {user.UserName}\nContinuer ?");
|
$"Vous êtes sur le point de supprimer votre identification pour ce compte : {user.UserName}\nContinuer ?");
|
||||||
if (doIt)
|
if (doIt)
|
||||||
App.PlateformSpecificInstance.RevokeAccount(user.UserName);
|
App.PlatformSpecificInstance.RevokeAccount(user.UserName);
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task<bool> Confirm(string title, string procedure)
|
|
||||||
{
|
|
||||||
string yes = "Oui", no = "Non";
|
|
||||||
var answer = await DisplayAlert(title,
|
|
||||||
procedure, yes, no);
|
|
||||||
return answer;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnAppearing()
|
protected override void OnAppearing()
|
||||||
{
|
{
|
||||||
base.OnAppearing();
|
base.OnAppearing();
|
||||||
AccountListView.SelectedItem = MainSettings.CurrentUser;
|
AccountListView.SelectedItem = MainSettings.CurrentUser;
|
||||||
pushstatus.IsToggled = MainSettings.PushNotifications;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddAccountBtn_Clicked(object sender, EventArgs e)
|
private void AddAccountBtn_Clicked(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
App.PlateformSpecificInstance.AddAccount();
|
App.PlatformSpecificInstance.AddAccount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -17,7 +17,7 @@ namespace BookAStar.Pages
|
||||||
_source = new HtmlWebViewSource();
|
_source = new HtmlWebViewSource();
|
||||||
_sourceTitle = new HtmlWebViewSource();
|
_sourceTitle = new HtmlWebViewSource();
|
||||||
_md = new MarkdownDeep.Markdown();
|
_md = new MarkdownDeep.Markdown();
|
||||||
_sourceTitle.BaseUrl = _source.BaseUrl = MainSettings.YavscHomeUrl;
|
_sourceTitle.BaseUrl = _source.BaseUrl = Constants.YavscHomeUrl;
|
||||||
_sourceTitle.Html = "Hello";
|
_sourceTitle.Html = "Hello";
|
||||||
titleLabel = new WebView { Source = _sourceTitle };
|
titleLabel = new WebView { Source = _sourceTitle };
|
||||||
contentView = new WebView { Source = _source };
|
contentView = new WebView { Source = _source };
|
||||||
|
|
|
||||||
|
|
@ -1,40 +1,56 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
xmlns:local="clr-namespace:BookAStar.Views;assembly=BookAStar"
|
xmlns:local="clr-namespace:BookAStar;assembly=BookAStar"
|
||||||
x:Class="BookAStar.Pages.BookQueriesPage">
|
x:Class="BookAStar.Pages.BookQueriesPage"
|
||||||
<StackLayout>
|
Style="{StaticResource PageStyle}"
|
||||||
|
Page.Title="Les Demandes"
|
||||||
|
>
|
||||||
|
<ContentPage.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
|
||||||
<ListView x:Name="list"
|
<Style x:Key="labelStyle" TargetType="Label">
|
||||||
HasUnevenRows="true" ItemTapped="OnViewDetail">
|
<Setter Property="TextColor" Value="{DynamicResource EmphasisTextColor}" />
|
||||||
<ListView.ItemTemplate>
|
<Setter Property="FontAttributes" Value="Bold" />
|
||||||
|
<Setter Property="FontSize" Value="{DynamicResource LargeFontSize}" />
|
||||||
|
<Setter Property="VerticalOptions" Value="Start" />
|
||||||
|
<Setter Property="LineBreakMode" Value="WordWrap" />
|
||||||
|
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="Label">
|
||||||
|
<Setter Property="Style" Value="{StaticResource ContentLabelStyle}" />
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="Button">
|
||||||
|
<Setter Property="Style" Value="{StaticResource ButtonStyle}" />
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ContentPage.Resources>
|
||||||
|
|
||||||
|
<StackLayout Padding="10,10,10,10">
|
||||||
|
|
||||||
|
<ListView RefreshCommand="{Binding RefreshQueries}" IsPullToRefreshEnabled="True"
|
||||||
|
ItemsSource="{Binding Queries}" x:Name="list" ItemTapped="OnViewDetail" HasUnevenRows="true" RowHeight="80">
|
||||||
|
<ListView.ItemTemplate HeightRequest="80" VerticalOptions="StartAndExpand">
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<ViewCell>
|
<ViewCell>
|
||||||
<ViewCell.View>
|
<ViewCell.View>
|
||||||
<StackLayout Orientation="Horizontal">
|
<StackLayout Orientation="Horizontal" Padding="10,10,10,10" VerticalOptions="StartAndExpand">
|
||||||
<StackLayout Orientation="Vertical">
|
<StackLayout Orientation="Vertical"
|
||||||
<Label Text="{Binding Title}" FontSize="12"/>
|
HeightRequest="80" VerticalOptions="StartAndExpand">
|
||||||
<Label Text="{Binding Description}"/>
|
|
||||||
<Label Text="{Binding Comment}"/>
|
|
||||||
<Label Text="{Binding CommandId}"/>
|
|
||||||
|
|
||||||
<StackLayout Orientation="Horizontal">
|
|
||||||
|
|
||||||
<StackLayout>
|
|
||||||
<Label Text="Date:" FontAttributes="Italic"/>
|
|
||||||
<Label Text="{Binding StartDate, StringFormat='{0:jj/MM/yyyy}'}" VerticalOptions="End"/>
|
|
||||||
</StackLayout>
|
|
||||||
<StackLayout>
|
|
||||||
<Label Text="Heure:" FontAttributes="Italic" />
|
|
||||||
<Label Text="{Binding StartDate, StringFormat='{0:H:mm}'}" VerticalOptions="End"/>
|
|
||||||
</StackLayout>
|
|
||||||
<StackLayout>
|
|
||||||
<Label Text="Lieu:" FontAttributes="Italic" VerticalOptions="End"/>
|
|
||||||
<Label Text="{Binding Location.Address}"/>
|
|
||||||
</StackLayout>
|
|
||||||
|
|
||||||
|
<StackLayout Orientation="Vertical" >
|
||||||
|
<Image Source="{Binding Client.Avatar}" />
|
||||||
|
<Label Text="{Binding Client.UserName}"
|
||||||
|
Style="{StaticResource labelStyle}"></Label>
|
||||||
|
</StackLayout>
|
||||||
|
|
||||||
|
<Label LineBreakMode="WordWrap" Text="{Binding EventDate, StringFormat='{0:dddd d MMMM à HH:mm}'}" FontSize="12" FontFamily="Italic"/>
|
||||||
|
</StackLayout>
|
||||||
|
<StackLayout Orientation="Vertical" VerticalOptions="StartAndExpand">
|
||||||
|
<Label LineBreakMode="WordWrap" Text="{Binding Location.Address}"/>
|
||||||
|
<Label Text="{Binding Previsionnal}"/>
|
||||||
|
<Label Text="{Binding Id}" HorizontalTextAlignment="End"/>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</StackLayout>
|
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</ViewCell.View>
|
</ViewCell.View>
|
||||||
</ViewCell>
|
</ViewCell>
|
||||||
|
|
|
||||||
|
|
@ -1,46 +1,24 @@
|
||||||
using BookAStar.Model;
|
using BookAStar.Model;
|
||||||
using System;
|
using BookAStar.ViewModels;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
|
using XLabs.Ioc;
|
||||||
|
using XLabs.Platform.Services;
|
||||||
|
|
||||||
namespace BookAStar.Pages
|
namespace BookAStar.Pages
|
||||||
{
|
{
|
||||||
|
|
||||||
public partial class BookQueriesPage : ContentPage
|
public partial class BookQueriesPage : ContentPage
|
||||||
{
|
{
|
||||||
public BookQueriesPage()
|
public BookQueriesPage()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
BindingContext = App.CurrentApp.DataManager.BookQueries;
|
BindingContext = new BookQueriesViewModel();
|
||||||
list.ItemsSource = BindingContext as ObservableCollection<BookQueryData>;
|
|
||||||
list.RefreshCommand = BindingContext as ICommand;
|
|
||||||
list.IsPullToRefreshEnabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public RemoteEntity<BookQueryData,long> Queries
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return BindingContext!=null? BindingContext as RemoteEntity<BookQueryData, long>:null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnAppearing()
|
|
||||||
{
|
|
||||||
base.OnAppearing();
|
|
||||||
if (!Queries.IsExecuting)
|
|
||||||
Queries.Execute(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnViewDetail(object sender, ItemTappedEventArgs e)
|
private void OnViewDetail(object sender, ItemTappedEventArgs e)
|
||||||
{
|
{
|
||||||
BookQueryData data = e.Item as BookQueryData;
|
BookQueryData data = e.Item as BookQueryData;
|
||||||
App.CurrentApp.ShowBookQuery(data);
|
App.CurrentApp.NavigationService.NavigateTo<BookQueryPage>(true,data);
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,30 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
xmlns:local="clr-namespace:BookAStar;assembly=BookAStar"
|
||||||
xmlns:maps="clr-namespace:Xamarin.Forms.Maps;assembly=Xamarin.Forms.Maps.dll"
|
xmlns:maps="clr-namespace:Xamarin.Forms.Maps;assembly=Xamarin.Forms.Maps.dll"
|
||||||
x:Class="BookAStar.Pages.BookQueryPage">
|
x:Class="BookAStar.Pages.BookQueryPage"
|
||||||
|
Style ="{StaticResource PageStyle}"
|
||||||
|
>
|
||||||
|
<ContentPage.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<Style TargetType="Label">
|
||||||
|
<Setter Property="Style" Value="{StaticResource ContentLabelStyle}" />
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="Button">
|
||||||
|
<Setter Property="Style" Value="{StaticResource ButtonStyle}" />
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ContentPage.Resources>
|
||||||
|
|
||||||
<StackLayout x:Name="bookQueryLayout">
|
<StackLayout x:Name="bookQueryLayout">
|
||||||
|
|
||||||
|
<Image Source="{Binding Client.AvatarOrNot}" Aspect="AspectFit" VisualElement.HeightRequest="{StaticResource BigUserAvatarSize}"/>
|
||||||
<Label Text="{Binding Title}" VerticalOptions="Start" HorizontalOptions="Center" />
|
<Label Text="{Binding Client.UserName}"/>
|
||||||
<Label Text="{Binding Description}" VerticalOptions="FillAndExpand" HorizontalOptions="Center" />
|
<Label Text="{Binding EventDate, StringFormat='le {0:dddd d MMMM yyyy à hh:mm}'}" />
|
||||||
<Label Text="{Binding CommandId}" VerticalOptions="Center" HorizontalOptions="Center" />
|
<Label Text="{Binding Location.Address}" />
|
||||||
<Label Text="{Binding Comment}" VerticalOptions="Center" HorizontalOptions="Center" />
|
<Label Text="{Binding Previsional}" />
|
||||||
<Label Text="{Binding StartDate}" VerticalOptions="Center" HorizontalOptions="Center" />
|
<maps:Map x:Name="map" VerticalOptions="FillAndExpand"></maps:Map>
|
||||||
<Label Text="{Binding EndDate}" VerticalOptions="Center" HorizontalOptions="Center" />
|
<Button Text="Faire un devis" Clicked="MakeAnEstimate" />
|
||||||
<Label Text="{Binding Location}" VerticalOptions="Center" HorizontalOptions="Center" />
|
</StackLayout>
|
||||||
<maps:Map x:Name="map"></maps:Map>
|
|
||||||
<Button Text="Faire un devis" Clicked="MakeAnEstimate" VerticalOptions="Center" HorizontalOptions="End"/>
|
|
||||||
</StackLayout>
|
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
|
|
@ -6,8 +6,14 @@ using Xamarin.Forms.Maps;
|
||||||
|
|
||||||
namespace BookAStar.Pages
|
namespace BookAStar.Pages
|
||||||
{
|
{
|
||||||
|
using Helpers;
|
||||||
using Model;
|
using Model;
|
||||||
|
using Model.Workflow;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using ViewModels;
|
||||||
|
using XLabs.Forms.Mvvm;
|
||||||
|
using XLabs.Ioc;
|
||||||
|
using XLabs.Platform.Services;
|
||||||
|
|
||||||
public partial class BookQueryPage : ContentPage
|
public partial class BookQueryPage : ContentPage
|
||||||
{
|
{
|
||||||
|
|
@ -43,8 +49,13 @@ namespace BookAStar.Pages
|
||||||
map.MoveToRegion(MapSpan.FromCenterAndRadius(
|
map.MoveToRegion(MapSpan.FromCenterAndRadius(
|
||||||
new Position(lat, lon), Distance.FromMeters(100)));
|
new Position(lat, lon), Distance.FromMeters(100)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public BookQueryPage(BookQueryData bookQuery)
|
public BookQueryPage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
public BookQueryPage(BookQueryData bookQuery=null)
|
||||||
{
|
{
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
@ -55,9 +66,19 @@ namespace BookAStar.Pages
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MakeAnEstimate(object sender, EventArgs e)
|
private void MakeAnEstimate(object sender, EventArgs ev)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
DataManager.Current.Contacts.Merge(BookQuery.Client);
|
||||||
|
var e = new Estimate()
|
||||||
|
{
|
||||||
|
ClientId = BookQuery.Client.UserId,
|
||||||
|
CommandId = BookQuery.Id,
|
||||||
|
OwnerId = MainSettings.CurrentUser.Id,
|
||||||
|
Id = 0,
|
||||||
|
Description = "# **Hello Estimate!**"
|
||||||
|
};
|
||||||
|
App.CurrentApp.NavigationService.NavigateTo<EditEstimatePage>(true,
|
||||||
|
new EstimateViewModel(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
53
BookAStar/BookAStar/Pages/DashboardPage.xaml
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
x:Class="BookAStar.Pages.DashboardPage"
|
||||||
|
xmlns:lc="clr-namespace:XLabs.Forms.Controls;assembly=XLabs.Forms"
|
||||||
|
xmlns:lb="clr-namespace:XLabs.Forms.Behaviors;assembly=XLabs.Forms"
|
||||||
|
Style="{StaticResource PageStyle}">
|
||||||
|
<ContentPage.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<Style TargetType="Label">
|
||||||
|
<Setter Property="Style" Value="{StaticResource ContentLabelStyle}" />
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="Button">
|
||||||
|
<Setter Property="Style" Value="{StaticResource ButtonStyle}" />
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ContentPage.Resources>
|
||||||
|
<ScrollView>
|
||||||
|
<StackLayout Orientation="Vertical" >
|
||||||
|
<lc:GesturesContentView>
|
||||||
|
<Frame>
|
||||||
|
<Label Text="Compte utilisateur" StyleClass="Header">
|
||||||
|
</Label>
|
||||||
|
<lb:Gestures.Interests>
|
||||||
|
<lb:GestureCollection>
|
||||||
|
<lb:GestureInterest GestureType="LongPress" GestureCommand="{Binding UserNameGesture}" GestureParameter="LongPress" />
|
||||||
|
</lb:GestureCollection>
|
||||||
|
</lb:Gestures.Interests>
|
||||||
|
<Image Source="{Binding Avatar}" Aspect="AspectFit" VisualElement.HeightRequest="{StaticResource BigUserAvatarSize}" />
|
||||||
|
</Frame>
|
||||||
|
</lc:GesturesContentView>
|
||||||
|
<Label Text="{Binding UserName}" Style="{StaticResource LabelPageHeadingStyle}"
|
||||||
|
HorizontalTextAlignment="Center"
|
||||||
|
LineBreakMode="WordWrap" XAlign="Center"
|
||||||
|
></Label>
|
||||||
|
<Button Text="{Binding PerformerStatus}" Clicked="OnViewPerformerStatus" />
|
||||||
|
<Button Text="{Binding UserQueries}" Clicked="OnViewUserQueries" />
|
||||||
|
<StackLayout Orientation="Horizontal" >
|
||||||
|
<Label Text="Recevoir les notifications push" StyleClass="Header" />
|
||||||
|
<Switch IsToggled="{Binding ReceivePushNotifications, Mode=TwoWay}"
|
||||||
|
HorizontalOptions="End" />
|
||||||
|
</StackLayout>
|
||||||
|
<StackLayout Orientation="Horizontal">
|
||||||
|
<Label Text="Utiliser ma position" StyleClass="Header" />
|
||||||
|
<Switch HorizontalOptions="End" IsToggled="{Binding AllowUseMyPosition, Mode=TwoWay}"/>
|
||||||
|
</StackLayout>
|
||||||
|
<StackLayout Orientation="Horizontal" VerticalOptions="Start">
|
||||||
|
<Label Text="Ne recevoir de demande de devis que de la part de professionnels uniquement" StyleClass="Header"/>
|
||||||
|
<Switch HorizontalOptions="End" IsToggled="{Binding AllowProBookingOnly, Mode=TwoWay}"/>
|
||||||
|
</StackLayout>
|
||||||
|
</StackLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</ContentPage>
|
||||||
43
BookAStar/BookAStar/Pages/DashboardPage.xaml.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
using BookAStar.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
using Xamarin.Forms;
|
||||||
|
using XLabs.Forms.Behaviors;
|
||||||
|
using XLabs.Forms.Controls;
|
||||||
|
using XLabs.Forms.Mvvm;
|
||||||
|
using XLabs.Ioc;
|
||||||
|
using XLabs.Platform.Services;
|
||||||
|
|
||||||
|
namespace BookAStar.Pages
|
||||||
|
{
|
||||||
|
public partial class DashboardPage : ContentPage
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public DashboardPage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnViewPerformerStatus(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ShowPage<AccountChooserPage>(null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnViewUserQueries(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ShowPage<BookQueriesPage>(null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowPage<T>(object [] args, bool animate=false) where T:Page
|
||||||
|
{
|
||||||
|
App.CurrentApp.NavigationService.NavigateTo<T>(animate, args);
|
||||||
|
App.MasterPresented = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
using BookAStar.Model.Auth.Account;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
using Xamarin.Forms;
|
|
||||||
using Yavsc.Models.Identity;
|
|
||||||
|
|
||||||
namespace BookAStar.Pages
|
|
||||||
{
|
|
||||||
public class DeviceInfoPage : ContentPage
|
|
||||||
{
|
|
||||||
public DeviceInfoPage(IGCMDeclaration infos)
|
|
||||||
{
|
|
||||||
Content = new StackLayout
|
|
||||||
{
|
|
||||||
Padding = 50,
|
|
||||||
VerticalOptions = LayoutOptions.Center,
|
|
||||||
Children = {
|
|
||||||
new Label{ Text = "Id: " + infos.DeviceId},
|
|
||||||
new Label{ Text = "Model: " + infos.Model},
|
|
||||||
new Label{ Text = "Platform: " + infos.Platform},
|
|
||||||
new Label{ Text = "Version: " + infos.Version},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
42
BookAStar/BookAStar/Pages/EditBillingLinePage.xaml
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
xmlns:local="clr-namespace:BookAStar;assembly=BookAStar"
|
||||||
|
xmlns:views="clr-namespace:BookAStar.Views;assembly=BookAStar"
|
||||||
|
x:Class="BookAStar.Pages.EditBillingLinePage"
|
||||||
|
Style="{StaticResource PageStyle}">
|
||||||
|
<ContentPage.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<Style TargetType="Label">
|
||||||
|
<Setter Property="Style" Value="{StaticResource ContentLabelStyle}" />
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="Button">
|
||||||
|
<Setter Property="Style" Value="{StaticResource ButtonStyle}" />
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ContentPage.Resources>
|
||||||
|
<StackLayout x:Name="mainStackLayout">
|
||||||
|
<Label Text="Description de la ligne de facture" Style="{StaticResource InputLabelStyle}"></Label>
|
||||||
|
<Editor VerticalOptions="FillAndExpand"></Editor>
|
||||||
|
<Label Text="Durée de la prestation"
|
||||||
|
Style="{StaticResource InputLabelStyle}"></Label>
|
||||||
|
<StackLayout Orientation="Horizontal">
|
||||||
|
<Entry Placeholder="Durée" Keyboard="Numeric" Style="{StaticResource BigEntry}" />
|
||||||
|
<Picker x:Name="picker" SelectedIndex="1" Style="{StaticResource PickerStyle}" Title="Unité de temps">
|
||||||
|
<Picker.Items>
|
||||||
|
<x:String>Heures</x:String>
|
||||||
|
<x:String>Jours</x:String>
|
||||||
|
<x:String>Minutes</x:String>
|
||||||
|
</Picker.Items>
|
||||||
|
</Picker>
|
||||||
|
</StackLayout>
|
||||||
|
<Label Text="Quantité facturée" Style="{StaticResource InputLabelStyle}"></Label>
|
||||||
|
<Entry Placeholder="Quantité" Text="1" Keyboard="Numeric" Style="{StaticResource BigEntry}"/>
|
||||||
|
<Label Text="Prix unitaire" Style="{StaticResource InputLabelStyle}"></Label>
|
||||||
|
<StackLayout Orientation="Horizontal">
|
||||||
|
<Entry Placeholder="Prix" Keyboard="Numeric" Style="{StaticResource BigEntry}"></Entry>
|
||||||
|
<Label Text="€" Style="{StaticResource BigLabel}" HorizontalTextAlignment="Start"/>
|
||||||
|
</StackLayout>
|
||||||
|
<Button Text="Valider cette ligne de facture" Command="{Binding ValidateCommand}"></Button>
|
||||||
|
</StackLayout>
|
||||||
|
</ContentPage>
|
||||||
21
BookAStar/BookAStar/Pages/EditBillingLinePage.xaml.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
using BookAStar.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace BookAStar.Pages
|
||||||
|
{
|
||||||
|
public partial class EditBillingLinePage : ContentPage
|
||||||
|
{
|
||||||
|
public EditBillingLinePage(BillingLineViewModel model)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
BindingContext = model;
|
||||||
|
InvalidateMeasure();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
55
BookAStar/BookAStar/Pages/EditEstimatePage.xaml
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
x:Class="BookAStar.Pages.EditEstimatePage"
|
||||||
|
xmlns:views="clr-namespace:BookAStar.Views;assembly=BookAStar"
|
||||||
|
xmlns:local="clr-namespace:BookAStar;assembly=BookAStar"
|
||||||
|
Style="{StaticResource PageStyle}">
|
||||||
|
<ContentPage.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<Style TargetType="Label">
|
||||||
|
<Setter Property="Style" Value="{StaticResource ContentLabelStyle}" />
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="Button">
|
||||||
|
<Setter Property="Style" Value="{StaticResource ButtonStyle}" />
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ContentPage.Resources>
|
||||||
|
<ScrollView>
|
||||||
|
<StackLayout Padding="10,10,10,10">
|
||||||
|
<StackLayout Orientation="Horizontal" Padding="10,10,10,10" View.VerticalOptions="CenterAndExpand">
|
||||||
|
<Label Text="{Binding Client.UserName}" LineBreakMode="WordWrap" View.VerticalOptions="CenterAndExpand"></Label>
|
||||||
|
<Label Text="{Binding Query.Location.Address}" LineBreakMode="WordWrap" View.VerticalOptions="CenterAndExpand"></Label>
|
||||||
|
<Label Text="{Binding Query.EventDate, StringFormat='{0:dddd d MMMM yyyy à hh:mm}'}" LineBreakMode="WordWrap" View.VerticalOptions="CenterAndExpand"></Label>
|
||||||
|
</StackLayout>
|
||||||
|
|
||||||
|
<views:MarkdownView x:Name="mdview"
|
||||||
|
Modified="OnDescriptionChanged"
|
||||||
|
HorizontalOptions="FillAndExpand"
|
||||||
|
View.VerticalOptions="CenterAndExpand"
|
||||||
|
Markdown="{Binding Description, Mode=TwoWay}"
|
||||||
|
MinimumHeightRequest="160"
|
||||||
|
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent,
|
||||||
|
Property=Height,
|
||||||
|
Factor=.6}"
|
||||||
|
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent,
|
||||||
|
Property=Width,
|
||||||
|
Factor=1}"
|
||||||
|
></views:MarkdownView>
|
||||||
|
|
||||||
|
<ListView HeightRequest="80" View.VerticalOptions="End">
|
||||||
|
<ListView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<ViewCell>
|
||||||
|
<ViewCell.View HeightRequest="80">
|
||||||
|
</ViewCell.View>
|
||||||
|
</ViewCell>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
</ListView>
|
||||||
|
<Button Text="Ajouter une ligne de facture" Clicked="OnNewCommanLine"></Button>
|
||||||
|
<Label FormattedText="{Binding FormattedTotal}"/>
|
||||||
|
<Button Text="Valider ce devis"></Button>
|
||||||
|
</StackLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</ContentPage>
|
||||||
53
BookAStar/BookAStar/Pages/EditEstimatePage.xaml.cs
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
using BookAStar.Model;
|
||||||
|
using BookAStar.Model.Workflow;
|
||||||
|
using BookAStar.ViewModels;
|
||||||
|
using BookAStar.Views;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
using Xamarin.Forms;
|
||||||
|
using Xamarin.Forms.Internals;
|
||||||
|
using XLabs.Forms.Services;
|
||||||
|
using XLabs.Ioc;
|
||||||
|
using XLabs.Platform.Services;
|
||||||
|
|
||||||
|
namespace BookAStar.Pages
|
||||||
|
{
|
||||||
|
public partial class EditEstimatePage : ContentPage
|
||||||
|
{
|
||||||
|
|
||||||
|
public EditEstimatePage(EstimateViewModel model)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
BindingContext = model;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnBindingContextChanged()
|
||||||
|
{
|
||||||
|
base.OnBindingContextChanged();
|
||||||
|
// FIXME WAZA
|
||||||
|
if (BindingContext != null) {
|
||||||
|
mdview.Markdown = ((EstimateViewModel)BindingContext).Description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void OnDescriptionChanged (object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// FIXME Why the Binding don't work?
|
||||||
|
((EstimateViewModel)BindingContext).Description = mdview.Markdown;
|
||||||
|
InvalidateMeasure();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void OnNewCommanLine(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var com = new BillingLine();
|
||||||
|
App.CurrentApp.NavigationService.NavigateTo<EditBillingLinePage>(
|
||||||
|
true,
|
||||||
|
new object[] { new BillingLineViewModel(((EstimateViewModel)this.BindingContext).Data,com) } );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,7 +2,17 @@
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
xmlns:local="clr-namespace:BookAStar;Assembly:BookAStar"
|
xmlns:local="clr-namespace:BookAStar;Assembly:BookAStar"
|
||||||
x:Class="BookAStar.Pages.EventDetail">
|
x:Class="BookAStar.Pages.EventDetail" Style="{StaticResource PageStyle}">
|
||||||
|
<ContentPage.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<Style TargetType="Label">
|
||||||
|
<Setter Property="Style" Value="{StaticResource ContentLabelStyle}" />
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="Button">
|
||||||
|
<Setter Property="Style" Value="{StaticResource ButtonStyle}" />
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ContentPage.Resources>
|
||||||
<ContentPage.Content>
|
<ContentPage.Content>
|
||||||
<ScrollView>
|
<ScrollView>
|
||||||
<StackLayout>
|
<StackLayout>
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace BookAStar
|
||||||
BindingContext = ev;
|
BindingContext = ev;
|
||||||
btn_webpage.Clicked += (object sender, EventArgs e) =>
|
btn_webpage.Clicked += (object sender, EventArgs e) =>
|
||||||
{
|
{
|
||||||
App.PlateformSpecificInstance.OpenWeb(ev.EventWebPage);
|
App.PlatformSpecificInstance.OpenWeb(ev.EventWebPage);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
17
BookAStar/BookAStar/Pages/HomePage.xaml
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
x:Class="BookAStar.Pages.HomePage"
|
||||||
|
Style="{StaticResource PageStyle}">
|
||||||
|
<ContentPage.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<Style TargetType="Label">
|
||||||
|
<Setter Property="Style" Value="{StaticResource ContentLabelStyle}" />
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="Button">
|
||||||
|
<Setter Property="Style" Value="{StaticResource ButtonStyle}" />
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ContentPage.Resources>
|
||||||
|
<Label Text="Blah" VerticalOptions="Center" HorizontalOptions="Center" />
|
||||||
|
</ContentPage>
|
||||||
|
|
@ -6,11 +6,11 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
|
|
||||||
namespace BookAStar
|
namespace BookAStar.Pages
|
||||||
{
|
{
|
||||||
public partial class QueriesPage : ContentPage
|
public partial class HomePage : ContentPage
|
||||||
{
|
{
|
||||||
public QueriesPage()
|
public HomePage()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
||||||
xmlns:local="clr-namespace:App2"
|
|
||||||
x:Class="App2.MainPage">
|
|
||||||
|
|
||||||
<Label Text="Welcome to Xamarin Forms!"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
HorizontalOptions="Center" />
|
|
||||||
|
|
||||||
</ContentPage>
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
||||||
x:Class="BookAStar.Pages.MakeAnEstimatePage"
|
|
||||||
xmlns:local="clr-namespace:BookAStar.Views;assembly=BookAStar"
|
|
||||||
>
|
|
||||||
|
|
||||||
<local:MarkdownView x:Name="mdview" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
|
|
||||||
Markdown="hello estimate"></local:MarkdownView>
|
|
||||||
</ContentPage>
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
using BookAStar.Model.Workflow;
|
|
||||||
using BookAStar.Views;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
using Xamarin.Forms;
|
|
||||||
|
|
||||||
namespace BookAStar.Pages
|
|
||||||
{
|
|
||||||
public partial class MakeAnEstimatePage : ContentPage
|
|
||||||
{
|
|
||||||
public Estimate Estimate { get { return BindingContext as Estimate; } set {
|
|
||||||
BindingContext = value;
|
|
||||||
} }
|
|
||||||
|
|
||||||
public static readonly BindableProperty MarkdownProperty =
|
|
||||||
BindableProperty.Create("Description", typeof(string), typeof(Estimate),
|
|
||||||
null, BindingMode.TwoWay);
|
|
||||||
|
|
||||||
public MakeAnEstimatePage(string clientId,long bookQueryId)
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
||||||
x:Class="BookAStar.Pages.MarkdownEditorPage">
|
|
||||||
<Editor VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"
|
|
||||||
x:Name="editor"
|
|
||||||
/>
|
|
||||||
<WebView x:Name="webView"></WebView>
|
|
||||||
</ContentPage>
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
using Xamarin.Forms;
|
|
||||||
|
|
||||||
namespace BookAStar.Pages
|
|
||||||
{
|
|
||||||
public partial class MarkdownEditorPage : ContentPage
|
|
||||||
{
|
|
||||||
public MarkdownEditorPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void GetText()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
||||||
x:Class="BookAStar.QueriesPage">
|
|
||||||
<Label Text="{Binding MainText}" VerticalOptions="Center" HorizontalOptions="Center" />
|
|
||||||
</ContentPage>
|
|
||||||
|
|
@ -3,13 +3,20 @@
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
xmlns:local="clr-namespace:BookAStar;Assembly:BookAStar"
|
xmlns:local="clr-namespace:BookAStar;Assembly:BookAStar"
|
||||||
x:Class="BookAStar.SearchPage" Title="Page de recherche"
|
x:Class="BookAStar.SearchPage" Title="Page de recherche"
|
||||||
Padding="10,40,10,10" >
|
Style="{StaticResource PageStyle}">
|
||||||
|
<ContentPage.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<Style TargetType="Label">
|
||||||
|
<Setter Property="Style" Value="{StaticResource ContentLabelStyle}" />
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="Button">
|
||||||
|
<Setter Property="Style" Value="{StaticResource ButtonStyle}" />
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ContentPage.Resources>
|
||||||
<ContentPage.Content>
|
<ContentPage.Content>
|
||||||
<StackLayout>
|
<StackLayout>
|
||||||
<StackLayout Orientation="Horizontal">
|
|
||||||
<Label Text="Utiliser ma position" />
|
|
||||||
<Switch x:Name="use_my_pos" HorizontalOptions="End" />
|
|
||||||
</StackLayout>
|
|
||||||
|
|
||||||
<StackLayout Orientation="Horizontal">
|
<StackLayout Orientation="Horizontal">
|
||||||
<Editor x:Name="search_phrase" HorizontalOptions="FillAndExpand"/>
|
<Editor x:Name="search_phrase" HorizontalOptions="FillAndExpand"/>
|
||||||
|
|
@ -19,7 +26,6 @@
|
||||||
|
|
||||||
<ListView x:Name="list" ItemsSource="{x:Static local:Manager.Events}"
|
<ListView x:Name="list" ItemsSource="{x:Static local:Manager.Events}"
|
||||||
HasUnevenRows="true">
|
HasUnevenRows="true">
|
||||||
s
|
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<ViewCell>
|
<ViewCell>
|
||||||
|
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
|
||||||
xmlns:local="clr-namespace:BookAStar;assembly=BookAStar"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
||||||
x:Class="BookAStar.SettingsPage"
|
|
||||||
Title="Paramètres Booking star"
|
|
||||||
BindingContext="." >
|
|
||||||
<ContentPage.Resources>
|
|
||||||
<ResourceDictionary>
|
|
||||||
|
|
||||||
</ResourceDictionary>
|
|
||||||
</ContentPage.Resources>
|
|
||||||
|
|
||||||
<StackLayout>
|
|
||||||
<Label Text="Compte utilisateur" StyleClass="Header"/>
|
|
||||||
|
|
||||||
<ListView x:Name="AccountListView"
|
|
||||||
SeparatorVisibility="Default"
|
|
||||||
VerticalOptions="FillAndExpand"
|
|
||||||
>
|
|
||||||
<ListView.Header>
|
|
||||||
<StackLayout Orientation="Horizontal">
|
|
||||||
<Button x:Name="RemoveAccountBouton"
|
|
||||||
Text="Supprimer cette identité" />
|
|
||||||
<Button x:Name="AddAccountBtn" Text="s'inscrire ou se connecter avec un nouveau compte" />
|
|
||||||
|
|
||||||
</StackLayout>
|
|
||||||
</ListView.Header>
|
|
||||||
|
|
||||||
<ListView.ItemTemplate HeightRequest="60" VerticalOptions="StartAndExpand">
|
|
||||||
<DataTemplate>
|
|
||||||
<ViewCell>
|
|
||||||
<Grid Padding="0"
|
|
||||||
ColumnSpacing="10"
|
|
||||||
RowSpacing="0">
|
|
||||||
<Label Grid.Column="0" Text="{Binding UserName}" />
|
|
||||||
</Grid>
|
|
||||||
</ViewCell>
|
|
||||||
</DataTemplate>
|
|
||||||
</ListView.ItemTemplate>
|
|
||||||
<ListView.Footer><StackLayout></StackLayout></ListView.Footer>
|
|
||||||
|
|
||||||
</ListView>
|
|
||||||
|
|
||||||
<StackLayout Orientation="Horizontal" VerticalOptions="Start">
|
|
||||||
<Label Text="Recevoir les notifications push" StyleClass="Header"/>
|
|
||||||
<Switch x:Name="pushstatus" />
|
|
||||||
</StackLayout>
|
|
||||||
|
|
||||||
<StackLayout Orientation="Horizontal" VerticalOptions="Start">
|
|
||||||
<Label Text="Recevoir les demandes de devis de la part de professionnels uniquement"
|
|
||||||
StyleClass="Header"/>
|
|
||||||
<Switch x:Name="restrictToPro" />
|
|
||||||
</StackLayout>
|
|
||||||
|
|
||||||
<Button x:Name="BtnViewDeviceInfo" Text="Device info" StyleClass="Info"></Button>
|
|
||||||
</StackLayout>
|
|
||||||
</ContentPage>
|
|
||||||
|
|
@ -9,11 +9,11 @@ using System.Runtime.InteropServices;
|
||||||
[assembly: AssemblyTitle("BookAStar")]
|
[assembly: AssemblyTitle("BookAStar")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("Paul Schneider")]
|
||||||
[assembly: AssemblyProduct("BookAStar")]
|
[assembly: AssemblyProduct("BookAStar")]
|
||||||
[assembly: AssemblyCopyright("Copyright © Paul Albert Schneider 2016")]
|
[assembly: AssemblyCopyright("Copyright © Paul Albert Schneider 2016")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("Yavsc")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("fr")]
|
||||||
[assembly: NeutralResourcesLanguage("fr")]
|
[assembly: NeutralResourcesLanguage("fr")]
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
|
|
|
||||||