diff --git a/BookAStar/BookAStar.Droid/Assets/test.html b/BookAStar/BookAStar.Droid/Assets/test.html
new file mode 100644
index 00000000..1a5fbf10
--- /dev/null
+++ b/BookAStar/BookAStar.Droid/Assets/test.html
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+ Title
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BookAStar/BookAStar.Droid/BookAStar.Droid.csproj b/BookAStar/BookAStar.Droid/BookAStar.Droid.csproj
index e2410b5b..c7b024ce 100644
--- a/BookAStar/BookAStar.Droid/BookAStar.Droid.csproj
+++ b/BookAStar/BookAStar.Droid/BookAStar.Droid.csproj
@@ -88,7 +88,8 @@
..\..\packages\Xam.Plugin.Media.1.0.1\lib\MonoAndroid10\Media.Plugin.Abstractions.dll
True
-
+
+
@@ -203,6 +204,7 @@
True
MarkdownEditor.cshtml
+
@@ -224,6 +226,9 @@
+
+ Designer
+
@@ -301,6 +306,7 @@
+
diff --git a/BookAStar/BookAStar.Droid/MainActivity.cs b/BookAStar/BookAStar.Droid/MainActivity.cs
index 11e58483..d1dd5105 100644
--- a/BookAStar/BookAStar.Droid/MainActivity.cs
+++ b/BookAStar/BookAStar.Droid/MainActivity.cs
@@ -27,7 +27,8 @@ using Android.Webkit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using Android.Views;
-
+using BookAStar.Helpers;
+using BookAStar.Interfaces;
namespace BookAStar.Droid
{
@@ -87,11 +88,11 @@ namespace BookAStar.Droid
{
var accStore = AccountStore.Create(this);
- var accounts = accStore.FindAccountsForService(MainSettings.ApplicationName);
+ var accounts = accStore.FindAccountsForService(Constants.ApplicationName);
accStore.Delete(
accounts.Where(a => a.Username == userName).FirstOrDefault()
- , MainSettings.ApplicationName);
+ , Constants.ApplicationName);
Toast.MakeText(this,
Resource.String.yavscIdentRemoved
, ToastLength.Short);
@@ -160,7 +161,7 @@ namespace BookAStar.Droid
using (var reader = new StreamReader(response.GetResponseStream()))
{
responseText = reader.ReadToEnd();
- Log.Debug(MainSettings.ApplicationName, responseText);
+ Log.Debug(Constants.ApplicationName, responseText);
}
}
}
@@ -180,7 +181,7 @@ namespace BookAStar.Droid
{
return await Task.Run(() => {
var manager = AccountStore.Create(this);
- return manager.FindAccountsForService(MainSettings.ApplicationName);
+ return manager.FindAccountsForService(Constants.ApplicationName);
});
}
YaOAuth2Authenticator auth = new YaOAuth2Authenticator(
@@ -215,7 +216,7 @@ namespace BookAStar.Droid
// get me
// 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 =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", tokens.AccessToken);
@@ -244,7 +245,7 @@ namespace BookAStar.Droid
};
MainSettings.SaveUser(newuser);
- accStore.Save(acc, MainSettings.ApplicationName);
+ accStore.Save(acc, Constants.ApplicationName);
}
}
@@ -331,34 +332,6 @@ namespace BookAStar.Droid
return m.InvokeJson(arg);
}
}
-
- public Xamarin.Forms.View CreateMarkdownView(string markdown, Action update)
- {
- var view = new Android.Webkit.WebView(Forms.Context);
- var viewclient = new MarkdownWebViewClient(update);
- view.SetWebViewClient(viewclient);
- var mde = new MarkdownEditor();
- if (markdown!=null)
- {
- var md = new MarkdownDeep.Markdown();
- mde.Model = md.Transform(markdown);
- }
- var html = mde.GenerateString();
- view.Settings.BuiltInZoomControls = true;
- view.Settings.JavaScriptEnabled = true;
- view.Settings.LoadsImagesAutomatically = true;
- view.Settings.SetAppCacheEnabled(true);
- view.Settings.AllowContentAccess = true;
- view.Settings.AllowFileAccess = true;
- view.Settings.AllowFileAccessFromFileURLs = true;
- view.Settings.AllowUniversalAccessFromFileURLs = true;
- view.Settings.BlockNetworkImage = false;
- view.Settings.BlockNetworkLoads = false;
- view.LoadDataWithBaseURL("file:///android_asset/",
- html, "text/html", "utf-8",null);
-
- return view.ToView();
- }
}
}
diff --git a/BookAStar/BookAStar.Droid/MarkdownEditor.cs b/BookAStar/BookAStar.Droid/MarkdownEditor.cs
index 24f34298..854ebed9 100644
--- a/BookAStar/BookAStar.Droid/MarkdownEditor.cs
+++ b/BookAStar/BookAStar.Droid/MarkdownEditor.cs
@@ -17,7 +17,7 @@ using System.Linq;
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
{
@@ -32,32 +32,30 @@ public string Model { get; set; }
public override void Execute()
{
-WriteLiteral("\r\n\r\n\r\n \r\n \r\n\r\n\r\n \r\n\r\n \r\n
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
diff --git a/BookAStar/BookAStar/Pages/BookQueriesPage.xaml.cs b/BookAStar/BookAStar/Pages/BookQueriesPage.xaml.cs
index c278d4e5..977886bc 100644
--- a/BookAStar/BookAStar/Pages/BookQueriesPage.xaml.cs
+++ b/BookAStar/BookAStar/Pages/BookQueriesPage.xaml.cs
@@ -15,10 +15,11 @@ namespace BookAStar.Pages
public BookQueriesPage()
{
InitializeComponent();
- BindingContext = App.CurrentApp.DataManager.BookQueries;
+ }
+ protected override void OnBindingContextChanged()
+ {
list.ItemsSource = BindingContext as ObservableCollection;
- list.RefreshCommand = BindingContext as ICommand;
- list.IsPullToRefreshEnabled = true;
+ base.OnBindingContextChanged();
}
public RemoteEntity Queries
@@ -40,7 +41,6 @@ namespace BookAStar.Pages
{
BookQueryData data = e.Item as BookQueryData;
App.CurrentApp.ShowBookQuery(data);
- throw new NotImplementedException();
}
}
}
diff --git a/BookAStar/BookAStar/Pages/BookQueryPage.xaml b/BookAStar/BookAStar/Pages/BookQueryPage.xaml
index 9067855d..0925bce4 100644
--- a/BookAStar/BookAStar/Pages/BookQueryPage.xaml
+++ b/BookAStar/BookAStar/Pages/BookQueryPage.xaml
@@ -1,19 +1,35 @@
+ x:Class="BookAStar.Pages.BookQueryPage"
+ BackgroundColor="{x:Static local:Constants.BackgroundColor}"
+ Padding="{x:Static local:Constants.PagePadding}"
+ >
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
+
+
\ No newline at end of file
diff --git a/BookAStar/BookAStar/Pages/BookQueryPage.xaml.cs b/BookAStar/BookAStar/Pages/BookQueryPage.xaml.cs
index 8211b72d..68357877 100644
--- a/BookAStar/BookAStar/Pages/BookQueryPage.xaml.cs
+++ b/BookAStar/BookAStar/Pages/BookQueryPage.xaml.cs
@@ -6,7 +6,9 @@ using Xamarin.Forms.Maps;
namespace BookAStar.Pages
{
+ using Helpers;
using Model;
+ using Model.Workflow;
using System.Threading.Tasks;
public partial class BookQueryPage : ContentPage
@@ -43,8 +45,9 @@ namespace BookAStar.Pages
map.MoveToRegion(MapSpan.FromCenterAndRadius(
new Position(lat, lon), Distance.FromMeters(100)));
}
+
}
- public BookQueryPage(BookQueryData bookQuery)
+ public BookQueryPage(BookQueryData bookQuery=null)
{
InitializeComponent();
@@ -55,9 +58,18 @@ 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.EditEstimate(e);
}
}
diff --git a/BookAStar/BookAStar/Pages/EditEstimatePage.xaml b/BookAStar/BookAStar/Pages/EditEstimatePage.xaml
new file mode 100644
index 00000000..7b489cd4
--- /dev/null
+++ b/BookAStar/BookAStar/Pages/EditEstimatePage.xaml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BookAStar/BookAStar/Pages/EditEstimatePage.xaml.cs b/BookAStar/BookAStar/Pages/EditEstimatePage.xaml.cs
new file mode 100644
index 00000000..5d4ecb15
--- /dev/null
+++ b/BookAStar/BookAStar/Pages/EditEstimatePage.xaml.cs
@@ -0,0 +1,44 @@
+using BookAStar.Model;
+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 EditEstimatePage : 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 static readonly BindableProperty ClientProperty =
+ BindableProperty.Create("Client", typeof(ClientProviderInfo), typeof(Estimate),
+ null, BindingMode.OneWay);
+ public static readonly BindableProperty QueryProperty =
+ BindableProperty.Create("Query", typeof(BookQueryData), typeof(Estimate),
+ null, BindingMode.OneWay);
+
+ public EditEstimatePage()
+ {
+ InitializeComponent();
+ }
+ protected override void OnBindingContextChanged()
+ {
+ base.OnBindingContextChanged();
+ mdview.Markdown = Estimate?.Description;
+ }
+
+ protected void OnDescriptionChanged (object sender, EventArgs e)
+ {
+ Estimate.Description = mdview.Markdown;
+ }
+ }
+}
diff --git a/BookAStar/BookAStar/Pages/EventDetail.xaml.cs b/BookAStar/BookAStar/Pages/EventDetail.xaml.cs
index 9099b96e..70c2d88d 100644
--- a/BookAStar/BookAStar/Pages/EventDetail.xaml.cs
+++ b/BookAStar/BookAStar/Pages/EventDetail.xaml.cs
@@ -15,7 +15,7 @@ namespace BookAStar
BindingContext = ev;
btn_webpage.Clicked += (object sender, EventArgs e) =>
{
- App.PlateformSpecificInstance.OpenWeb(ev.EventWebPage);
+ App.PlatformSpecificInstance.OpenWeb(ev.EventWebPage);
};
}
diff --git a/BookAStar/BookAStar/Pages/MakeAnEstimatePage.xaml b/BookAStar/BookAStar/Pages/MakeAnEstimatePage.xaml
deleted file mode 100644
index 0b3b4b8f..00000000
--- a/BookAStar/BookAStar/Pages/MakeAnEstimatePage.xaml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/BookAStar/BookAStar/Pages/MakeAnEstimatePage.xaml.cs b/BookAStar/BookAStar/Pages/MakeAnEstimatePage.xaml.cs
deleted file mode 100644
index 9d124474..00000000
--- a/BookAStar/BookAStar/Pages/MakeAnEstimatePage.xaml.cs
+++ /dev/null
@@ -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();
- }
- }
-}
diff --git a/BookAStar/BookAStar/Pages/QueriesPage.xaml b/BookAStar/BookAStar/Pages/QueriesPage.xaml
deleted file mode 100644
index 19125c42..00000000
--- a/BookAStar/BookAStar/Pages/QueriesPage.xaml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/BookAStar/BookAStar/Pages/QueriesPage.xaml.cs b/BookAStar/BookAStar/Pages/QueriesPage.xaml.cs
deleted file mode 100644
index a3bbc670..00000000
--- a/BookAStar/BookAStar/Pages/QueriesPage.xaml.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-using Xamarin.Forms;
-
-namespace BookAStar
-{
- public partial class QueriesPage : ContentPage
- {
- public QueriesPage()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/BookAStar/BookAStar/Pages/SearchPage.xaml b/BookAStar/BookAStar/Pages/SearchPage.xaml
index c47a8d5d..7a9cfccb 100644
--- a/BookAStar/BookAStar/Pages/SearchPage.xaml
+++ b/BookAStar/BookAStar/Pages/SearchPage.xaml
@@ -6,10 +6,7 @@
Padding="10,40,10,10" >
-
-
-
-
+
@@ -19,7 +16,6 @@
- s
diff --git a/BookAStar/BookAStar/Pages/SettingsPage.xaml b/BookAStar/BookAStar/Pages/SettingsPage.xaml
index e0984276..9301f215 100644
--- a/BookAStar/BookAStar/Pages/SettingsPage.xaml
+++ b/BookAStar/BookAStar/Pages/SettingsPage.xaml
@@ -30,9 +30,10 @@ BindingContext="." >
-
+ RowSpacing="2">
+
@@ -42,10 +43,18 @@ BindingContext="." >
+
+
-
+
+
+
+
+
+
+
-
diff --git a/BookAStar/BookAStar/Pages/SettingsPage.xaml.cs b/BookAStar/BookAStar/Pages/SettingsPage.xaml.cs
index d1ad3c51..1a47a79b 100644
--- a/BookAStar/BookAStar/Pages/SettingsPage.xaml.cs
+++ b/BookAStar/BookAStar/Pages/SettingsPage.xaml.cs
@@ -33,13 +33,7 @@ namespace BookAStar
AccountListView.ItemSelected += Accounts_ItemSelected;
pushstatus.Toggled += Pushstatus_Toggled;
-
- BtnViewDeviceInfo.Clicked += BtnDeviceInfo_Clicked;
- }
-
- private void BtnDeviceInfo_Clicked(object sender, EventArgs e)
- {
- ((BookAStar.App) App.Current).ShowDeviceInfo();
+
}
protected void Pushstatus_Toggled(object sender, ToggledEventArgs e)
@@ -64,7 +58,7 @@ namespace BookAStar
var doIt = await Confirm("Suppression de l'identification",
$"Vous êtes sur le point de supprimer votre identification pour ce compte : {user.UserName}\nContinuer ?");
if (doIt)
- App.PlateformSpecificInstance.RevokeAccount(user.UserName);
+ App.PlatformSpecificInstance.RevokeAccount(user.UserName);
}
async Task Confirm(string title, string procedure)
@@ -84,7 +78,7 @@ namespace BookAStar
private void AddAccountBtn_Clicked(object sender, EventArgs e)
{
- App.PlateformSpecificInstance.AddAccount();
+ App.PlatformSpecificInstance.AddAccount();
}
diff --git a/BookAStar/BookAStar/Properties/AssemblyInfo.cs b/BookAStar/BookAStar/Properties/AssemblyInfo.cs
index 076d24fe..dcb0c729 100644
--- a/BookAStar/BookAStar/Properties/AssemblyInfo.cs
+++ b/BookAStar/BookAStar/Properties/AssemblyInfo.cs
@@ -9,11 +9,11 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("BookAStar")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
+[assembly: AssemblyCompany("Paul Schneider")]
[assembly: AssemblyProduct("BookAStar")]
[assembly: AssemblyCopyright("Copyright © Paul Albert Schneider 2016")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
+[assembly: AssemblyTrademark("Yavsc")]
+[assembly: AssemblyCulture("fr")]
[assembly: NeutralResourcesLanguage("fr")]
// Version information for an assembly consists of the following four values:
diff --git a/BookAStar/BookAStar/Views/MarkdownView.cs b/BookAStar/BookAStar/Views/MarkdownView.cs
index 0ede50ea..b00195ac 100644
--- a/BookAStar/BookAStar/Views/MarkdownView.cs
+++ b/BookAStar/BookAStar/Views/MarkdownView.cs
@@ -1,14 +1,15 @@
-using System;
+using BookAStar.Interfaces;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using Xamarin.Forms;
-
+
namespace BookAStar.Views
{
- public partial class MarkdownView : ContentView
+ public class MarkdownView : View
{
public static readonly BindableProperty MarkdownProperty = BindableProperty.Create(
"Markdown", typeof(string), typeof(MarkdownView), null, BindingMode.TwoWay
@@ -23,25 +24,20 @@ namespace BookAStar.Views
return markdown;
}
set {
- markdown = value;
- Content = App.PlateformSpecificInstance.CreateMarkdownView(
- markdown,
- e => {
- Markdown = e;
- if (Validated != null)
- Validated.Invoke(this, new EventArgs());
+ if (markdown != value)
+ if (Edited != null)
+ {
+ markdown = value;
+ Edited.Invoke(this, new EventArgs());
+ return;
}
- );
-
+
+ markdown = value;
}
}
-
- public MarkdownView() : base()
- {
-
- }
-
- public event EventHandler Validated;
-
+
+ public event EventHandler Edited;
+
}
+
}
diff --git a/BookAStar/BookAStar/icon-anon.png b/BookAStar/BookAStar/icon-anon.png
new file mode 100644
index 00000000..38d6db94
Binary files /dev/null and b/BookAStar/BookAStar/icon-anon.png differ