WIP
This commit is contained in:
@ -0,0 +1,58 @@
|
||||
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.Accounts;
|
||||
|
||||
namespace BookAStar.Droid.Accounts
|
||||
{
|
||||
class YavscAccountAuthenticator : AbstractAccountAuthenticator
|
||||
{
|
||||
public YavscAccountAuthenticator(Context context): base(context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override Bundle AddAccount(AccountAuthenticatorResponse response, string accountType, string authTokenType, string[] requiredFeatures, Bundle options)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Bundle ConfirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Bundle EditProperties(AccountAuthenticatorResponse response, string accountType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Bundle GetAuthToken(AccountAuthenticatorResponse response, Account account, string authTokenType, Bundle options)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override string GetAuthTokenLabel(string authTokenType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Bundle HasFeatures(AccountAuthenticatorResponse response, Account account, string[] features)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Bundle UpdateCredentials(AccountAuthenticatorResponse response, Account account, string authTokenType, Bundle options)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@ -328,6 +328,7 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Accounts\YavscAccountAuthenticator.cs" />
|
||||
<Compile Include="Helpers\Settings.cs" />
|
||||
<Compile Include="Helpers\SimpleJsonPostMethod.cs" />
|
||||
<Compile Include="Helpers\YavscHelpers.cs" />
|
||||
@ -347,6 +348,7 @@
|
||||
<Compile Include="Resources\Resource.Designer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SendFilesActivity.cs" />
|
||||
<Compile Include="Services\AccountChooserService.cs" />
|
||||
<Compile Include="Services\YavscChooserTargetService.cs" />
|
||||
<Compile Include="Services\GcmListenerService.cs" />
|
||||
<Compile Include="Services\GcmRegistrationIntentService.cs" />
|
||||
@ -474,7 +476,9 @@
|
||||
<SubType>Designer</SubType>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\values\dimens.xml" />
|
||||
<AndroidResource Include="Resources\values\strings.xml" />
|
||||
<AndroidResource Include="Resources\values\strings.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\glyphish_07_map_marker.png" />
|
||||
<AndroidResource Include="Resources\drawable\glyphish_13_target.png" />
|
||||
<AndroidResource Include="Resources\drawable\glyphish_74_location.png" />
|
||||
@ -499,6 +503,14 @@
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\peer_to_peer.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\xml\authenticator.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</AndroidResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\xml\account_preferences.xml" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
|
@ -319,15 +319,16 @@ namespace BookAStar.Droid
|
||||
return manager.FindAccountsForService(Constants.ApplicationName);
|
||||
});
|
||||
}
|
||||
YaOAuth2Authenticator auth = new YaOAuth2Authenticator(
|
||||
clientId: "d9be5e97-c19d-42e4-b444-0e65863b19e1",
|
||||
clientSecret: "blouh",
|
||||
scope: "profile",
|
||||
authorizeUrl: new Uri(Constants.AuthorizeUrl),
|
||||
redirectUrl: new Uri("http://dev.pschneider.fr/oauth/success"),
|
||||
accessTokenUrl: new Uri("http://dev.pschneider.fr/token"));
|
||||
|
||||
public void AddAccount()
|
||||
{
|
||||
var auth = new YaOAuth2Authenticator(
|
||||
clientId: "d9be5e97-c19d-42e4-b444-0e65863b19e1",
|
||||
clientSecret: "blouh",
|
||||
scope: "profile",
|
||||
authorizeUrl: new Uri(Constants.AuthorizeUrl),
|
||||
redirectUrl: new Uri("http://dev.pschneider.fr/oauth/success"),
|
||||
accessTokenUrl: new Uri("http://dev.pschneider.fr/token"));
|
||||
Intent loginIntent = auth.GetUI(this);
|
||||
var accStore = AccountStore.Create(this);
|
||||
auth.Completed += (sender, eventArgs) =>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
|
||||
<receiver android:name="com.google.android.gms.gcm.GcmReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
|
||||
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
|
||||
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
|
||||
<category android:name="fr.pschneider.bas" />
|
||||
</intent-filter>
|
||||
@ -30,6 +30,13 @@
|
||||
<action android:name="android.service.chooser.ChooserTargetService" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<service android:name="fr.pschneider.bas.AccountChooserService" >
|
||||
<intent-filter>
|
||||
<action android:name="android.accounts.AccountAuthenticator" />
|
||||
</intent-filter>
|
||||
<meta-data android:name="android.accounts.AccountAuthenticator"
|
||||
android:resource="@xml/authenticator" />
|
||||
</service>
|
||||
</application>
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WAVE_LOCK" />
|
||||
|
3791
BookAStar/BookAStar.Droid/Resources/Resource.Designer.cs
generated
3791
BookAStar/BookAStar.Droid/Resources/Resource.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@ -14,5 +14,12 @@
|
||||
<string name="url">url</string>
|
||||
<string name="url_hint">url_hint</string>
|
||||
<string name="picture">picture</string>
|
||||
<string name="google_app_id">325408689282</string>
|
||||
<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="accounts">Comptes</string>
|
||||
<string name="bookingstar_accounts_pref_screen_summary">
|
||||
Préférences des comptes Booking Star
|
||||
</string>
|
||||
</resources>
|
||||
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<PreferenceCategory android:title="@string/accounts" />
|
||||
<PreferenceScreen
|
||||
android:key="bookingstar_accounts_pref_screen"
|
||||
android:title="@string/pref_screen_title"
|
||||
android:summary="@string/bookingstar_accounts_pref_screen_summary">
|
||||
<intent
|
||||
android:action="bookingstar_accounts_pref_screen.ACTION"
|
||||
android:targetPackage="bookingstar_accounts_pref_screen.package"
|
||||
android:targetClass="bookingstar_accounts_pref_screen.class" />
|
||||
</PreferenceScreen>
|
||||
</PreferenceScreen>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:accountType="typeOfAuthenticator"
|
||||
android:icon="@drawable/icon"
|
||||
android:smallIcon="@drawable/icon"
|
||||
android:label="@string/account_authenticator_label"
|
||||
android:accountPreferences="@xml/account_preferences"
|
||||
/>
|
41
BookAStar/BookAStar.Droid/Services/AccountChooserService.cs
Normal file
41
BookAStar/BookAStar.Droid/Services/AccountChooserService.cs
Normal file
@ -0,0 +1,41 @@
|
||||
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 BookAStar.Droid.OAuth;
|
||||
|
||||
namespace BookAStar.Droid.Services
|
||||
{
|
||||
[Service(
|
||||
Name = "fr.pschneider.bas.AccountChooserService",
|
||||
Label = "Yavsc accounts service",
|
||||
Icon = "@drawable/icon",
|
||||
Exported = true,
|
||||
Enabled = true
|
||||
)]
|
||||
[IntentFilter(new String[] { "android.accounts.AccountAuthenticator" })]
|
||||
|
||||
class AccountChooserService : Service
|
||||
{
|
||||
public static YaOAuth2Authenticator authenticator;
|
||||
public override void OnCreate()
|
||||
{
|
||||
base.OnCreate();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override IBinder OnBind(Intent intent)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@ -75,19 +75,19 @@ namespace BookAStar
|
||||
// omg
|
||||
private void OnError(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Called on rotation after OnSuspended
|
||||
private void OnClosing(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
ChatHubConnection.Dispose();
|
||||
}
|
||||
|
||||
// FIXME Never called.
|
||||
private void OnInitialize(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
// called on app startup, not on rotation
|
||||
@ -106,7 +106,7 @@ namespace BookAStar
|
||||
// Called on rotation
|
||||
private void OnSuspended(object sender, EventArgs e)
|
||||
{
|
||||
// TODO save the navigation stack
|
||||
StopHubConnection();
|
||||
int position = 0;
|
||||
DataManager.Instance.AppState.Clear();
|
||||
foreach (Page page in Navigation.NavigationStack)
|
||||
@ -125,6 +125,7 @@ namespace BookAStar
|
||||
// called on app startup, after OnStartup, not on rotation
|
||||
private void OnAppResumed(object sender, EventArgs e)
|
||||
{
|
||||
StartHubConnection();
|
||||
// TODO restore the navigation stack
|
||||
base.OnResume();
|
||||
foreach (var pageState in DataManager.Instance.AppState)
|
||||
@ -146,7 +147,7 @@ namespace BookAStar
|
||||
// FIXME Not called?
|
||||
private void OnRotation(object sender, EventArgs<Orientation> e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static GenericConfigSettingsMgr ConfigManager { protected set; get; }
|
||||
@ -154,9 +155,6 @@ namespace BookAStar
|
||||
private void Configure(IXFormsApp app)
|
||||
{
|
||||
ViewFactory.EnableCache = true;
|
||||
ViewFactory.Register<ChatPage, ChatViewModel>(
|
||||
r=> new ChatViewModel { }
|
||||
);
|
||||
ViewFactory.Register<DashboardPage, DashboardViewModel>(
|
||||
resolver => new DashboardViewModel());
|
||||
ViewFactory.Register<BookQueryPage, BookQueryViewModel>();
|
||||
@ -184,13 +182,18 @@ namespace BookAStar
|
||||
Init();
|
||||
// Builds the Main page
|
||||
BuildMainPage();
|
||||
|
||||
|
||||
}
|
||||
|
||||
BookQueriesPage bQueriesPage;
|
||||
AccountChooserPage accChooserPage;
|
||||
HomePage homePage;
|
||||
UserProfilePage userProfilePage;
|
||||
|
||||
private static UserProfilePage userProfilePage;
|
||||
|
||||
public static UserProfilePage UserProfilePage
|
||||
{ get { return userProfilePage; } }
|
||||
|
||||
ChatPage chatPage;
|
||||
|
||||
private void ShowPage(Page page)
|
||||
@ -207,6 +210,10 @@ namespace BookAStar
|
||||
|
||||
private void BuildMainPage()
|
||||
{
|
||||
// TODO
|
||||
// in case of App resume,
|
||||
// do not create new BindingContext's,
|
||||
// but use those from the AppState property
|
||||
accChooserPage = new AccountChooserPage();
|
||||
|
||||
bQueriesPage = new BookQueriesPage
|
||||
@ -218,6 +225,7 @@ namespace BookAStar
|
||||
homePage = new HomePage() { Title = "Accueil", Icon = "icon.png" };
|
||||
userProfilePage = new UserProfilePage { Title = "Profile utilisateur", Icon = "ic_corp_icon.png",
|
||||
BindingContext = new UserProfileViewModel() };
|
||||
|
||||
chatPage = new ChatPage
|
||||
{
|
||||
Title = "Chat",
|
||||
@ -359,7 +367,22 @@ namespace BookAStar
|
||||
DataManager.Instance.ChatUsers.OnPrivateMessage(msg);
|
||||
});
|
||||
}
|
||||
|
||||
public static void StopHubConnection()
|
||||
{
|
||||
try
|
||||
{
|
||||
chatHubConnection.Stop();
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
// TODO use webex, set this cx down status somewhere,
|
||||
// & display it & maybe try again later.
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// TODO use ex
|
||||
}
|
||||
}
|
||||
private void MainSettings_UserChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (chatHubConnection != null)
|
||||
|
@ -62,6 +62,9 @@
|
||||
<Compile Include="Model\Settings\SignatureSettings.cs" />
|
||||
<Compile Include="Model\Social\Chat\ChatStatus.cs" />
|
||||
<Compile Include="Model\Social\Chat\ChatMessage.cs" />
|
||||
<Compile Include="Pages\ClientPages\SearchPage.xaml.cs">
|
||||
<DependentUpon>SearchPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ViewModels\Messaging\ChatUserCollection.cs" />
|
||||
<Compile Include="ViewModels\Messaging\ChatUserInfo.cs" />
|
||||
<Compile Include="Model\Social\Chat\Connection.cs" />
|
||||
@ -211,9 +214,6 @@
|
||||
<Compile Include="Views\ImageButton.cs" />
|
||||
<Compile Include="Views\MarkdownView.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Pages\SearchPage.xaml.cs">
|
||||
<DependentUpon>SearchPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Pages\UserProfile\AccountChooserPage.xaml.cs">
|
||||
<DependentUpon>AccountChooserPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@ -246,17 +246,12 @@
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Pages\SearchPage.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Pages\UserProfile\AccountChooserPage.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Model\Billing\" />
|
||||
<Folder Include="Model\UI\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -507,6 +502,12 @@
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Images\Chat\talk.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Pages\ClientPages\SearchPage.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.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">
|
||||
|
@ -47,7 +47,19 @@ namespace BookAStar.Model.Workflow
|
||||
}
|
||||
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public ClientProviderInfo Owner
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(OwnerId))
|
||||
{
|
||||
var dm = DataManager.Instance;
|
||||
return dm.Contacts.LocalGet(OwnerId);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public string ClientId { get; set; }
|
||||
[JsonIgnore]
|
||||
public BookQueryData Query
|
||||
|
@ -9,7 +9,6 @@
|
||||
xmlns:local="clr-namespace:BookAStar;Assembly:BookAStar"
|
||||
xmlns:extensions="clr-namespace:BookAStar.Extensions;assembly=BookAStar"
|
||||
Style="{StaticResource PageStyle}" >
|
||||
|
||||
<TabbedPage.Resources>
|
||||
<ResourceDictionary>
|
||||
<converters:SignalRConnectionStateToObject x:Key="cxToStyleImage" x:TypeArguments="Style">
|
||||
|
@ -12,8 +12,18 @@ namespace BookAStar.Pages.Chat
|
||||
public partial class ChatPage : TabbedPage
|
||||
{
|
||||
public string ChatUser { get; set; }
|
||||
public ChatPage(ChatViewModel model)
|
||||
{
|
||||
Init();
|
||||
BindingContext = model;
|
||||
}
|
||||
|
||||
public ChatPage()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
@ -45,7 +55,7 @@ namespace BookAStar.Pages.Chat
|
||||
chatUserList.BindingContext = DataManager.Instance.ChatUsers;
|
||||
|
||||
|
||||
sendPVButton.Clicked += async (sender, args) =>
|
||||
sendPVButton.Clicked += (sender, args) =>
|
||||
{
|
||||
var dest = chatUserList.SelectedUser;
|
||||
if (dest!=null)
|
||||
@ -56,7 +66,7 @@ namespace BookAStar.Pages.Chat
|
||||
foreach (var cx in dest.ObservableConnections)
|
||||
{
|
||||
if (cx.Connected)
|
||||
await App.ChatHubProxy.Invoke<string>("SendPV", cx.ConnectionId, pvEntry.Text);
|
||||
App.ChatHubProxy.Invoke<string>("SendPV", cx.ConnectionId, pvEntry.Text);
|
||||
}
|
||||
pvEntry.Text = null;
|
||||
}
|
||||
|
51
BookAStar/BookAStar/Pages/ClientPages/SearchPage.xaml
Normal file
51
BookAStar/BookAStar/Pages/ClientPages/SearchPage.xaml
Normal file
@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="BookAStar.Pages.ClientPages.SearchPage"
|
||||
xmlns:views="clr-namespace:BookAStar.Views;assembly=BookAStar"
|
||||
xmlns:controls="clr-namespace:XLabs.Forms.Controls;assembly=XLabs.Forms"
|
||||
xmlns:toolkit="clr-namespace:XLabs.Forms.Mvvm;assembly=XLabs.Forms"
|
||||
xmlns:converters="clr-namespace:BookAStar.Converters;assembly=BookAStar"
|
||||
xmlns:local="clr-namespace:BookAStar;Assembly:BookAStar"
|
||||
xmlns:extensions="clr-namespace:BookAStar.Extensions;assembly=BookAStar"
|
||||
|
||||
Style="{StaticResource PageStyle}" >
|
||||
|
||||
<TabbedPage.Children>
|
||||
<ContentPage Title="Une star" Icon="">
|
||||
<StackLayout Orientation="Horizontal">
|
||||
<Editor x:Name="search_phrase" HorizontalOptions="FillAndExpand"/>
|
||||
<Button x:Name="btn_update" HorizontalOptions="End" />
|
||||
</StackLayout>
|
||||
<DatePicker x:Name="search_date" />
|
||||
</ContentPage>
|
||||
</TabbedPage.Children>
|
||||
<TabbedPage.Children>
|
||||
<ContentPage Title="Un DJ" Icon="">
|
||||
<StackLayout Orientation="Horizontal">
|
||||
<Editor x:Name="search_phrase" HorizontalOptions="FillAndExpand"/>
|
||||
<Button x:Name="btn_update" HorizontalOptions="End" />
|
||||
</StackLayout>
|
||||
<DatePicker x:Name="search_date" />
|
||||
</ContentPage>
|
||||
</TabbedPage.Children>
|
||||
<TabbedPage.Children>
|
||||
<ContentPage Title="Un chanteur" Icon="">
|
||||
<StackLayout Orientation="Horizontal">
|
||||
<Editor x:Name="search_phrase" HorizontalOptions="FillAndExpand"/>
|
||||
<Button x:Name="btn_update" HorizontalOptions="End" />
|
||||
</StackLayout>
|
||||
<DatePicker x:Name="search_date" />
|
||||
</ContentPage>
|
||||
</TabbedPage.Children>
|
||||
<TabbedPage.Children>
|
||||
<ContentPage Title="Une formation musicale" Icon="">
|
||||
<StackLayout Orientation="Horizontal">
|
||||
<Editor x:Name="search_phrase" HorizontalOptions="FillAndExpand"/>
|
||||
<Button x:Name="btn_update" HorizontalOptions="End" />
|
||||
</StackLayout>
|
||||
<DatePicker x:Name="search_date" />
|
||||
</ContentPage>
|
||||
</TabbedPage.Children>
|
||||
|
||||
</TabbedPage>
|
18
BookAStar/BookAStar/Pages/ClientPages/SearchPage.xaml.cs
Normal file
18
BookAStar/BookAStar/Pages/ClientPages/SearchPage.xaml.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace BookAStar.Pages.ClientPages
|
||||
{
|
||||
public partial class SearchPage : TabbedPage
|
||||
{
|
||||
public SearchPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +1,40 @@
|
||||
<?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.EstimatesClientPage">
|
||||
|
||||
<Label Text="{Binding MainText}" VerticalOptions="Center" HorizontalOptions="Center" />
|
||||
x:Class="BookAStar.Pages.EstimatesClientPage"
|
||||
Style="{StaticResource PageStyle}">
|
||||
|
||||
<ScrollView>
|
||||
<StackLayout Padding="10,10,10,10" x:Name="mainLayout">
|
||||
<ListView RefreshCommand="{Binding RefreshCommand}" IsPullToRefreshEnabled="True"
|
||||
ItemsSource="{Binding Estimates}" x:Name="estimates" ItemTapped="OnViewDetail" HasUnevenRows="true" RowHeight="80">
|
||||
<ListView.ItemTemplate HeightRequest="80" VerticalOptions="StartAndExpand">
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<ViewCell.View>
|
||||
<StackLayout Orientation="Horizontal" Padding="10,10,10,10" VerticalOptions="StartAndExpand">
|
||||
<StackLayout Orientation="Vertical"
|
||||
HeightRequest="80" VerticalOptions="StartAndExpand">
|
||||
|
||||
<StackLayout Orientation="Vertical" >
|
||||
<Image Source="{Binding Owner.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" HorizontalOptions="FillAndExpand">
|
||||
<Label LineBreakMode="WordWrap" Text="{Binding Location.Address}"/>
|
||||
<Label Text="{Binding Previsionnal}"/>
|
||||
<Label Text="{Binding Id}" HorizontalTextAlignment="End"/>
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
</ViewCell.View>
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
@ -1,55 +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:BookAStar;Assembly:BookAStar"
|
||||
x:Class="BookAStar.SearchPage" Title="Page de recherche"
|
||||
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>
|
||||
<StackLayout>
|
||||
|
||||
|
||||
<StackLayout Orientation="Horizontal">
|
||||
<Editor x:Name="search_phrase" HorizontalOptions="FillAndExpand"/>
|
||||
<Button x:Name="btn_update" HorizontalOptions="End" />
|
||||
</StackLayout>
|
||||
<DatePicker x:Name="search_date" />
|
||||
|
||||
<ListView x:Name="list" ItemsSource="{x:Static local:Manager.Events}"
|
||||
HasUnevenRows="true">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<ViewCell.View>
|
||||
<StackLayout Orientation="Horizontal">
|
||||
<Image Source="{Binding ImgLocator}" HeightRequest="80" />
|
||||
<StackLayout Orientation="Vertical">
|
||||
<Label Text="{Binding Title}"/>
|
||||
<StackLayout Orientation="Horizontal">
|
||||
<StackLayout><Label Text="Heure:" FontAttributes="Italic" FontSize="9" />
|
||||
<Label Text="{Binding StartDate, StringFormat='{0:H:mm}'}" VerticalOptions="End"/>
|
||||
</StackLayout>
|
||||
<StackLayout><Label Text="Lieu:" FontAttributes="Italic" FontSize="9" VerticalOptions="End"/>
|
||||
<Label Text="{Binding Location.Name}"/></StackLayout>
|
||||
|
||||
<Label Text="{Binding Promotion}" FontSize="20" TextColor="Yellow" BackgroundColor="#102030"/>
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
</ViewCell.View>
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</StackLayout>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
@ -1,31 +0,0 @@
|
||||
using System;
|
||||
using Xamarin.Forms;
|
||||
using System.Collections.ObjectModel;
|
||||
using BookAStar.Model.Social;
|
||||
using BookAStar.Model.Workflow.Messaging;
|
||||
using BookAStar.Pages;
|
||||
|
||||
namespace BookAStar
|
||||
{
|
||||
public partial class SearchPage : ContentPage
|
||||
{
|
||||
public ObservableCollection<LocalizedEvent> Events { get; private set; }
|
||||
public SearchPage ()
|
||||
{
|
||||
|
||||
InitializeComponent ();
|
||||
|
||||
BindingContext = this;
|
||||
Events = Manager.Events;
|
||||
list.ItemTapped += async (object sender, ItemTappedEventArgs e) => {
|
||||
await Navigation.PushAsync(new EventDetail( (YaEvent) e.Item) { Title = "Détail de la soirée" } );
|
||||
};
|
||||
search_date.Date = DateTime.Now;
|
||||
search_date.MinimumDate = DateTime.Now;
|
||||
search_phrase.Text = "Suresnes";
|
||||
btn_update.Clicked += (object sender, EventArgs e) => {
|
||||
//
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -21,7 +21,18 @@
|
||||
<ContentPage.Content>
|
||||
<ScrollView>
|
||||
<StackLayout BoxView.Color="{StaticResource ContentBackgroundColor}">
|
||||
<Image Source="{Binding Avatar}" HeightRequest="{StaticResource BigUserAvatarSize}" />
|
||||
<lc:GesturesContentView>
|
||||
<Image Source="{Binding Avatar}" HeightRequest="{StaticResource BigUserAvatarSize}" >
|
||||
<lb:Gestures.Interests>
|
||||
<lb:GestureCollection>
|
||||
<lb:GestureInterest GestureType="SingleTap" GestureCommand="{Binding AvatarCommand}" GestureParameter="{Binding Ready}"/>
|
||||
<lb:GestureInterest GestureType="LongPress" GestureCommand="{Binding AvatarCommand}" GestureParameter="{Binding Ready}"/>
|
||||
<lb:GestureInterest GestureType="Swipe" Direction="Left" GestureCommand="{Binding AvatarCommand}" GestureParameter="{Binding Ready}"/>
|
||||
<lb:GestureInterest GestureType="Swipe" Direction="Right" GestureCommand="{Binding AvatarCommand}" GestureParameter="{Binding Ready}"/>
|
||||
</lb:GestureCollection>
|
||||
</lb:Gestures.Interests>
|
||||
</Image>
|
||||
</lc:GesturesContentView>
|
||||
<Button Text="{Binding UserName}" Clicked="OnRefreshQuery" />
|
||||
|
||||
<Button Text="{Binding UserFilesText}" Clicked="OnManageFiles" />
|
||||
|
@ -10,6 +10,7 @@ namespace BookAStar.Pages.UserProfile
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using ViewModels.UserProfile;
|
||||
using XLabs.Forms.Controls;
|
||||
|
||||
public partial class DashboardPage : ContentPage
|
||||
{
|
||||
|
@ -93,7 +93,7 @@ namespace BookAStar.Model.Social.Chat
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.Join(", ", Roles);
|
||||
return Roles == null? "": string.Join(", ", Roles);
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,6 +151,7 @@ namespace BookAStar.Model.Social.Chat
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool Unread
|
||||
{
|
||||
get
|
||||
@ -159,6 +160,8 @@ namespace BookAStar.Model.Social.Chat
|
||||
m => !m.Read);
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public ImageSource MessagesBadge
|
||||
{
|
||||
get
|
||||
@ -166,6 +169,7 @@ namespace BookAStar.Model.Social.Chat
|
||||
return Unread ? ImageSource.FromResource("BookAStar.Images.Chat.talk.png") :null;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnConnected(string cxId)
|
||||
{
|
||||
// We do assume this cxId dosn't already exist in this list.
|
||||
|
@ -10,7 +10,7 @@ namespace BookAStar.ViewModels.Messaging
|
||||
using Model.Social.Chat;
|
||||
using Model.Social.Messaging;
|
||||
|
||||
class ChatViewModel: ViewModel
|
||||
public class ChatViewModel: ViewModel
|
||||
{
|
||||
public ObservableCollection<ChatMessage> Messages { get; set; }
|
||||
public ObservableCollection<ChatMessage> Notifs { get; set; }
|
||||
|
@ -146,7 +146,7 @@ namespace BookAStar.ViewModels.UserProfile
|
||||
{
|
||||
if (g.GestureType == GestureType.LongPress)
|
||||
{
|
||||
Resolver.Resolve<INavigationService>().NavigateTo<AccountChooserPage>(true);
|
||||
Navigation.PushAsync(App.UserProfilePage);
|
||||
}
|
||||
});
|
||||
MainSettings.UserChanged += MainSettings_UserChanged;
|
||||
@ -179,14 +179,14 @@ namespace BookAStar.ViewModels.UserProfile
|
||||
bool newUserIsPro;
|
||||
ImageSource newAvatar;
|
||||
string newQueriesButtonText;
|
||||
bool newHaveAnUser = user == null;
|
||||
if (newHaveAnUser)
|
||||
bool userIsNull = user == null;
|
||||
if (userIsNull)
|
||||
{
|
||||
newQueryCount = 0;
|
||||
newUserIsPro = false;
|
||||
newStatusString = null;
|
||||
newStatusString = "no user selected";
|
||||
newAvatar = null;
|
||||
newQueriesButtonText = null;
|
||||
newQueriesButtonText = "no user selected";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -202,7 +202,7 @@ namespace BookAStar.ViewModels.UserProfile
|
||||
"Profile professionel non renseigné";
|
||||
newAvatar = UserHelpers.Avatar(user.Avatar);
|
||||
}
|
||||
SetProperty<bool>(ref haveAnUser, newHaveAnUser, "HaveAnUser");
|
||||
SetProperty<bool>(ref haveAnUser, userIsNull, "HaveAnUser");
|
||||
SetProperty<bool>(ref userIsPro, newUserIsPro, "UserIsPro");
|
||||
SetProperty<string>(ref performerStatus, newStatusString, "PerformerStatus");
|
||||
SetProperty<string>(ref userQueries, newQueriesButtonText, "UserQueries");
|
||||
@ -216,8 +216,6 @@ namespace BookAStar.ViewModels.UserProfile
|
||||
|
||||
NotifyPropertyChanged("UserName");
|
||||
NotifyPropertyChanged("UserId");
|
||||
NotifyPropertyChanged("HaveAnUser");
|
||||
NotifyPropertyChanged("UserIsPro");
|
||||
});
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user