Merge branch 'vnext' of github.com:pazof/yavsc into vnext
|
After Width: | Height: | Size: 20 KiB |
@ -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>
|
||||||
|
|
||||||
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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,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);
|
|
||||||
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 1.0 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"
|
||||||
|
/>
|
||||||
@ -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,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>
|
||||||
@ -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
|
||||||
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
@ -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>
|
||||||
@ -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"
|
||||||
<StackLayout x:Name="bookQueryLayout">
|
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">
|
||||||
|
|
||||||
<Label Text="{Binding Title}" VerticalOptions="Start" HorizontalOptions="Center" />
|
<Image Source="{Binding Client.AvatarOrNot}" Aspect="AspectFit" VisualElement.HeightRequest="{StaticResource BigUserAvatarSize}"/>
|
||||||
<Label Text="{Binding Description}" VerticalOptions="FillAndExpand" HorizontalOptions="Center" />
|
<Label Text="{Binding Client.UserName}"/>
|
||||||
<Label Text="{Binding CommandId}" VerticalOptions="Center" HorizontalOptions="Center" />
|
<Label Text="{Binding EventDate, StringFormat='le {0:dddd d MMMM yyyy à hh:mm}'}" />
|
||||||
<Label Text="{Binding Comment}" VerticalOptions="Center" HorizontalOptions="Center" />
|
<Label Text="{Binding Location.Address}" />
|
||||||
<Label Text="{Binding StartDate}" VerticalOptions="Center" HorizontalOptions="Center" />
|
<Label Text="{Binding Previsional}" />
|
||||||
<Label Text="{Binding EndDate}" VerticalOptions="Center" HorizontalOptions="Center" />
|
<maps:Map x:Name="map" VerticalOptions="FillAndExpand"></maps:Map>
|
||||||
<Label Text="{Binding Location}" VerticalOptions="Center" HorizontalOptions="Center" />
|
<Button Text="Faire un devis" Clicked="MakeAnEstimate" />
|
||||||
<maps:Map x:Name="map"></maps:Map>
|
</StackLayout>
|
||||||
<Button Text="Faire un devis" Clicked="MakeAnEstimate" VerticalOptions="Center" HorizontalOptions="End"/>
|
|
||||||
</StackLayout>
|
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
@ -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>
|
||||||
@ -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>
|
||||||
@ -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>
|
||||||
@ -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>
|
||||||
@ -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,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,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>
|
|
||||||
@ -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>
|
|
||||||