Merge branch 'vnext' of github.com:pazof/yavsc into vnext

vnext
Paul Schneider 8 years ago
commit 7f327f7a77
12 changed files with 285 additions and 47 deletions

@ -343,6 +343,8 @@
<Compile Include="Markdown\MarkdownViewModel.cs" />
<Compile Include="Markdown\MarkdownViewRenderer.cs" />
<Compile Include="Markdown\MarkdownWebChromeClient.cs" />
<Compile Include="Markdown\MDContextMenu.cs" />
<Compile Include="Markdown\MDWebView.cs" />
<Compile Include="OAuth2\YaOAuth2Authenticator.cs" />
<Compile Include="Rendering\ImageButtonRenderer.cs" />
<Compile Include="Resources\Resource.Designer.cs" />
@ -374,6 +376,9 @@
<AndroidResource Include="Resources\layout\EditEstimate.axml">
<SubType>Designer</SubType>
</AndroidResource>
<AndroidResource Include="Resources\menu\md_menu.axml">
<SubType>Designer</SubType>
</AndroidResource>
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\icon.png" />
@ -383,7 +388,9 @@
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\layout\Tabbar.axml" />
<AndroidResource Include="Resources\layout\Toolbar.axml" />
<AndroidResource Include="Resources\layout\Toolbar.axml">
<SubType>Designer</SubType>
</AndroidResource>
<AndroidResource Include="Resources\values\styles.xml">
<SubType>Designer</SubType>
</AndroidResource>

@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.Support.V7.App;
using XLabs.Ioc;
using XLabs.Platform.Mvvm;
using XLabs.Forms;
using static Android.Views.View;
namespace BookAStar.Droid.Markdown
{
class MDContextMenu : AppCompatDialog
{
private ActionMode mActionMode = null;
public MDContextMenu(Context context) : base(context)
{
}
public override void OnActionModeStarted(ActionMode mode)
{
if (mActionMode == null)
{
mActionMode = mode;
var menu = mode.Menu;
// Remove the default menu items (select all, copy, paste, search)
menu.Clear();
// If you want to keep any of the defaults,
// remove the items you don't want individually:
// menu.removeItem(android.R.id.[id_of_item_to_remove])
// Inflate your own menu items
mode.MenuInflater.Inflate(Resource.Menu.md_menu, menu);
}
mActionMode = mode;
base.OnActionModeStarted(mode);
}
public override void OnActionModeFinished(ActionMode mode)
{
base.OnActionModeFinished(mode);
}
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
}
public void OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMenuInfo menuInfo)
{
/* if (menuInfo!=null)
{
var info = menuInfo.ToString();
}
menu.Add(0, 0, 0, "test");
var subMenu = menu.AddSubMenu(
0, 1, 1, "...");
subMenu.Add(0, 3, 0, "nkjnkjn");
var app = Resolver.Resolve<IXFormsApp>() as IXFormsApp<XFormsCompatApplicationDroid>;
var mgr = ClipboardManager.FromContext(app.AppContext);
if (mgr.HasText)
menu.Add(0, 0, 0, "Coller!");*/
//base.OnCreateContextMenu(menu, v, menuInfo);
}
}
}

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.Webkit;
namespace BookAStar.Droid.Markdown
{
class MDWebView : WebView
{
public MDWebView (Context context) : base (context)
{
}
public override ActionMode StartActionMode(ActionMode.ICallback callback)
{
return base.StartActionMode(callback);
}
}
}

@ -12,6 +12,11 @@ using Android.Views;
namespace BookAStar.Droid
{
using Markdown;
using XLabs.Forms;
using XLabs.Ioc;
using XLabs.Platform.Mvvm;
using static View;
public class MarkdownViewRenderer : ViewRenderer<MarkdownView, WebView>
{
private WebView editorView;
@ -35,7 +40,9 @@ namespace BookAStar.Droid
{
if (view == null || xview == null) return;
var vch = view.ContentHeight;
xview.HeightRequest = vch > xview.MinimumHeightRequest ? vch : xview.MinimumHeightRequest;
// var oldH = xview.Height;
var newH = vch > xview.MinimumHeightRequest ? vch : xview.MinimumHeightRequest;
xview.HeightRequest = newH;
}
protected override void OnElementChanged(ElementChangedEventArgs<MarkdownView> e)
@ -73,7 +80,7 @@ namespace BookAStar.Droid
Control.LoadUrl(string.Format("javascript: {0}", script));
}
}
MDContextMenu contextMenu;
private WebView CreateNativeControl()
{
editorView = new WebView(Context);
@ -93,9 +100,18 @@ namespace BookAStar.Droid
EditorView.Settings.DomStorageEnabled = true;
EditorView.AddJavascriptInterface(new JsBridgeMarkdown(this), "jsBridge");
EditorView.ViewTreeObserver.PreDraw += ViewTreeObserver_PreDraw;
//var app = Resolver.Resolve<IXFormsApp>() as IXFormsApp<XFormsCompatApplicationDroid>;
//contextMenu = new MDContextMenu(app.AppContext);
//EditorView.SetOnCreateContextMenuListener(contextMenu);
return EditorView;
}
private void EditorView_Touch(object sender, TouchEventArgs e)
{
}
private void ViewTreeObserver_PreDraw(object sender, ViewTreeObserver.PreDrawEventArgs e)
{
AdjustHeightRequest(Element, Control);

@ -4553,6 +4553,9 @@ namespace BookAStar.Droid
// aapt resource value: 0x7f0d0026
public const int beginning = 2131558438;
// aapt resource value: 0x7f0d00ba
public const int bold = 2131558586;
// aapt resource value: 0x7f0d0035
public const int bottom = 2131558453;
@ -4601,6 +4604,9 @@ namespace BookAStar.Droid
// aapt resource value: 0x7f0d0055
public const int contentPanel = 2131558485;
// aapt resource value: 0x7f0d00b6
public const int copy = 2131558582;
// aapt resource value: 0x7f0d005b
public const int custom = 2131558491;
@ -4673,6 +4679,15 @@ namespace BookAStar.Droid
// aapt resource value: 0x7f0d00b2
public const int fullscreen = 2131558578;
// aapt resource value: 0x7f0d00b7
public const int group = 2131558583;
// aapt resource value: 0x7f0d00be
public const int header1 = 2131558590;
// aapt resource value: 0x7f0d00bf
public const int header2 = 2131558591;
// aapt resource value: 0x7f0d0005
public const int home = 2131558405;
@ -4697,6 +4712,9 @@ namespace BookAStar.Droid
// aapt resource value: 0x7f0d00a6
public const int info = 2131558566;
// aapt resource value: 0x7f0d00bb
public const int italic = 2131558587;
// aapt resource value: 0x7f0d0000
public const int item_touch_helper_previous_elevation = 2131558400;
@ -4832,6 +4850,9 @@ namespace BookAStar.Droid
// aapt resource value: 0x7f0d0051
public const int parentPanel = 2131558481;
// aapt resource value: 0x7f0d00b8
public const int past = 2131558584;
// aapt resource value: 0x7f0d00ad
public const int pause = 2131558573;
@ -4955,6 +4976,12 @@ namespace BookAStar.Droid
// aapt resource value: 0x7f0d009d
public const int status_bar_latest_event_content = 2131558557;
// aapt resource value: 0x7f0d00b9
public const int submenu_character = 2131558585;
// aapt resource value: 0x7f0d00bd
public const int submenu_paragraph = 2131558589;
// aapt resource value: 0x7f0d0070
public const int submit_area = 2131558512;
@ -5006,6 +5033,9 @@ namespace BookAStar.Droid
// aapt resource value: 0x7f0d0078
public const int touch_outside = 2131558520;
// aapt resource value: 0x7f0d00bc
public const int underline = 2131558588;
// aapt resource value: 0x7f0d0009
public const int up = 2131558409;
@ -5319,6 +5349,22 @@ namespace BookAStar.Droid
}
}
public partial class Menu
{
// aapt resource value: 0x7f100000
public const int md_menu = 2131755008;
static Menu()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Menu()
{
}
}
public partial class Raw
{
@ -5425,8 +5471,8 @@ namespace BookAStar.Droid
// aapt resource value: 0x7f08006a
public const int account_authenticator_label = 2131230826;
// aapt resource value: 0x7f08006b
public const int accounts = 2131230827;
// aapt resource value: 0x7f080074
public const int accounts = 2131230836;
// aapt resource value: 0x7f08005a
public const int app_name = 2131230810;
@ -5440,8 +5486,11 @@ namespace BookAStar.Droid
// aapt resource value: 0x7f080000
public const int auth_google_play_services_client_google_display_name = 2131230720;
// aapt resource value: 0x7f08006c
public const int bookingstar_accounts_pref_screen_summary = 2131230828;
// aapt resource value: 0x7f08006e
public const int bold = 2131230830;
// aapt resource value: 0x7f080075
public const int bookingstar_accounts_pref_screen_summary = 2131230837;
// aapt resource value: 0x7f080049
public const int bottom_sheet_behavior = 2131230793;
@ -5449,6 +5498,9 @@ namespace BookAStar.Droid
// aapt resource value: 0x7f08005e
public const int cancel = 2131230814;
// aapt resource value: 0x7f08006d
public const int character = 2131230829;
// aapt resource value: 0x7f08004a
public const int character_counter_pattern = 2131230794;
@ -5539,6 +5591,9 @@ namespace BookAStar.Droid
// aapt resource value: 0x7f08001e
public const int common_signin_button_text_long = 2131230750;
// aapt resource value: 0x7f08006b
public const int copy = 2131230827;
// aapt resource value: 0x7f080024
public const int create_calendar_message = 2131230756;
@ -5560,9 +5615,18 @@ namespace BookAStar.Droid
// aapt resource value: 0x7f080068
public const int google_app_id = 2131230824;
// aapt resource value: 0x7f080072
public const int header1 = 2131230834;
// aapt resource value: 0x7f080073
public const int header2 = 2131230835;
// aapt resource value: 0x7f08004f
public const int invalid_date = 2131230799;
// aapt resource value: 0x7f08006f
public const int italic = 2131230831;
// aapt resource value: 0x7f08004d
public const int library_name = 2131230797;
@ -5620,6 +5684,12 @@ namespace BookAStar.Droid
// aapt resource value: 0x7f080054
public const int overflow = 2131230804;
// aapt resource value: 0x7f080071
public const int paragraph = 2131230833;
// aapt resource value: 0x7f08006c
public const int past = 2131230828;
// aapt resource value: 0x7f080055
public const int pause = 2131230805;
@ -5653,6 +5723,9 @@ namespace BookAStar.Droid
// aapt resource value: 0x7f080059
public const int time_duration = 2131230809;
// aapt resource value: 0x7f080070
public const int underline = 2131230832;
// aapt resource value: 0x7f080065
public const int url = 2131230821;

@ -8,4 +8,4 @@
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:tabIndicatorColor="@android:color/white"
app:tabGravity="fill"
app:tabMode="fixed" />
app:tabMode="fixed" />

@ -7,7 +7,7 @@
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:popupTheme="@style/ThemeOverlay.AppCompat.Light"
android:popupTheme="@style/ThemeOverlay.AppCompat.Dark"
tools:context=".MainActivity"
app:layout_scrollFlags="scroll|enterAlways"
/>

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/copy"
android:title="@string/copy"/>
<group android:id="@+id/group">
<item android:id="@+id/past"
android:title="@string/past"
android:showAsAction="ifRoom|withText"/>
</group>
<item android:id="@+id/submenu_character"
android:title="@string/character" >
<menu>
<item android:id="@+id/bold"
android:title="@string/bold" />
<item android:id="@+id/italic"
android:title="@string/italic" />
<item android:id="@+id/underline"
android:title="@string/underline" />
</menu>
</item>
<item android:id="@+id/submenu_paragraph"
android:title="@string/paragraph" >
<menu>
<item android:id="@+id/header1"
android:onClick="onGroupItemClick"
android:title="@string/header1" />
<item android:id="@+id/header2"
android:onClick="onGroupItemClick"
android:title="@string/header2" />
</menu>
</item>
</menu>

@ -17,6 +17,19 @@
<string name="google_app_id">325408689282</string>
<string name="pref_screen_title">Comptes Booking Star</string>
<string name="account_authenticator_label">Comptes Booking Star</string>
<string name="copy">Copier</string>
<string name="past">Coller</string>
<string name="character">Caractère</string>
<string name="bold">Gras</string>
<string name="italic">Italique</string>
<string name="underline">Sousligné</string>
<string name="paragraph">Paragraphe</string>
<string name="header1">Titre</string>
<string name="header2">Sous-titre</string>
<string name="accounts">Comptes</string>
<string name="bookingstar_accounts_pref_screen_summary">

@ -14,16 +14,30 @@ namespace BookAStar.Pages
public BookQueriesPage()
{
InitializeComponent();
var model = new BookQueriesViewModel();
model.RefreshQueries =
new Command( () => {
DataManager.Instance.BookQueries.Execute(null);
this.list.EndRefresh();
});
BindingContext = new BookQueriesViewModel();
}
public BookQueriesPage(BookQueriesViewModel model)
{
InitializeComponent();
BindingContext = model;
}
protected override void OnBindingContextChanged()
{
BookQueriesViewModel model = (BookQueriesViewModel) BindingContext;
if (model!=null)
{
model.RefreshQueries =
new Command(() =>
{
DataManager.Instance.BookQueries.Execute(null);
this.list.EndRefresh();
});
}
base.OnBindingContextChanged();
}
private void OnViewDetail(object sender, ItemTappedEventArgs e)
{
var item = e.Item as BookQueryViewModel;

@ -70,7 +70,7 @@
HorizontalOptions="FillAndExpand"
BackgroundColor="White"
CaptionText="Caption This" CaptionTextColor="Black"
ClearText="Clear Me!" ClearTextColor="Red"
ClearText="Effacer!" ClearTextColor="Red"
PromptText="Prompt Here" PromptTextColor="Red"
SignatureLineColor="Aqua" StrokeColor="Black" StrokeWidth="2" />
<Button Clicked="OnValidate" Text="Valider cette signature" x:Name="btnValidate" />

@ -16,43 +16,20 @@
</ResourceDictionary>
</ContentPage.Resources>
<!-- La recherche d'un pro -->
<TabbedPage.Children>
<!-- La recherche d'un pro -->
<TabbedPage Title="{x:Static local:Strings.SearchForAPro}" >
<TabbedPage.Children>
<ContentPage Title="Les stars, musiciens, chanteurs DJ">
<StackLayout Orientation="Horizontal">
<Editor HorizontalOptions="FillAndExpand"/>
<Button HorizontalOptions="End" />
</StackLayout>
<StackLayout Orientation="Horizontal" VerticalOptions="Start">
<Label Text="{x:Static local:Strings.GeographicalyNear}" />
<Switch HorizontalOptions="End" VerticalOptions="Start"
IsToggled="{Binding ByLocation, Mode=TwoWay}" />
</StackLayout>
</ContentPage>
<ContentPage Title="Les formations musicales">
<StackLayout Orientation="Horizontal">
<Editor HorizontalOptions="FillAndExpand"/>
<Button HorizontalOptions="End" />
</StackLayout>
</ContentPage>
</TabbedPage.Children>
</TabbedPage>
<!--
les derniers sons/videos/articles postés
<TabbedPage.Children>
-->
<ContentPage Title="Blogspot">
<StackLayout Orientation="Horizontal">
<Editor x:Name="search_blog_phrase" HorizontalOptions="FillAndExpand"/>
<Button x:Name="btn_blog_update" HorizontalOptions="End" />
</StackLayout>
</ContentPage>
</TabbedPage.Children>
-->
<!--
Les demandes devis en attente de réponse (pro)
@ -99,22 +76,26 @@
<!-- Les signatures de contrat en souffreances (pro) -->
<ContentPage Title="Contrats à signer" IsVisible="{Binding UserProfile.IsAPerformer}">
<ContentPage Title="Contrats fournisseur" IsVisible="{Binding UserProfile.IsAPerformer}">
</ContentPage>
<!-- Les signatures de contrat en souffreances (client) -->
<ContentPage Title="Contrats client" IsVisible="{Binding UserProfile.IsAPerformer}">
</ContentPage>
<!-- Les annonces pro (pro) -->
<ContentPage Title="Annonces pro" IsVisible="{Binding UserProfile.IsAPerformer}">
<StackLayout Orientation="Horizontal" >
<Editor x:Name="search_pub_pro_phrase" HorizontalOptions="FillAndExpand"/>
<Button x:Name="btn_pro_pub" HorizontalOptions="End" />
<Editor x:Name="search_pub_pro_phrase" HorizontalOptions="FillAndExpand" VerticalOptions="Start"/>
<Button x:Name="btn_pro_pub" HorizontalOptions="End" VerticalOptions="Start" Text="Chercher"/>
</StackLayout>
</ContentPage>
<!-- les petites annonces des clients (pro) -->
<ContentPage Title="Annonces client" Icon="" IsVisible="{Binding UserProfile.IsAPerformer}">
<StackLayout Orientation="Horizontal" >
<Editor x:Name="search_pub_cli_phrase" HorizontalOptions="FillAndExpand"/>
<Button x:Name="btn_cli_pub" HorizontalOptions="End" />
<Editor x:Name="search_pub_cli_phrase" HorizontalOptions="FillAndExpand" VerticalOptions="Start"/>
<Button x:Name="btn_cli_pub" HorizontalOptions="End" VerticalOptions="Start" Text="Chercher"/>
</StackLayout>
</ContentPage>
</TabbedPage.Children>

Loading…