Merge branch 'vnext' of github.com:pazof/yavsc into vnext
This commit is contained in:
commit
29a0cb9c4b
8 changed files with 81 additions and 40 deletions
|
|
@ -48,6 +48,7 @@ namespace ZicMoove.Droid
|
||||||
using Model.Auth.Account;
|
using Model.Auth.Account;
|
||||||
using static Android.Manifest;
|
using static Android.Manifest;
|
||||||
using Settings;
|
using Settings;
|
||||||
|
using Model.Auth;
|
||||||
|
|
||||||
[Activity(Name = "fr.pschneider.bas.MainActivity", Label = "ZicMoove", Theme = "@style/MainTheme", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
|
[Activity(Name = "fr.pschneider.bas.MainActivity", Label = "ZicMoove", Theme = "@style/MainTheme", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
|
||||||
public class MainActivity :
|
public class MainActivity :
|
||||||
|
|
@ -398,28 +399,12 @@ namespace ZicMoove.Droid
|
||||||
// TODO handle
|
// TODO handle
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GCMDeclaration : IGCMDeclaration
|
|
||||||
{
|
|
||||||
public string DeviceId
|
|
||||||
{ get; set; }
|
|
||||||
|
|
||||||
public string GCMRegistrationId
|
|
||||||
{ get; set; }
|
|
||||||
|
|
||||||
public string Model
|
|
||||||
{ get; set; }
|
|
||||||
|
|
||||||
public string Platform
|
|
||||||
{ get; set; }
|
|
||||||
|
|
||||||
public string Version
|
|
||||||
{ get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public IGCMDeclaration GetDeviceInfo()
|
public IGCMDeclaration GetDeviceInfo()
|
||||||
{
|
{
|
||||||
var devinfo = CrossDeviceInfo.Current;
|
var devinfo = CrossDeviceInfo.Current;
|
||||||
return new GCMDeclaration
|
return new GCMRegIdDeclaration
|
||||||
{
|
{
|
||||||
DeviceId = devinfo.Id,
|
DeviceId = devinfo.Id,
|
||||||
GCMRegistrationId = MainSettings.GoogleRegId,
|
GCMRegistrationId = MainSettings.GoogleRegId,
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,7 @@ namespace ZicMoove
|
||||||
{ get { return userProfilePage; } }
|
{ get { return userProfilePage; } }
|
||||||
|
|
||||||
ChatPage chatPage;
|
ChatPage chatPage;
|
||||||
|
PinPage pinPage;
|
||||||
|
|
||||||
public static void ShowPage(Page page)
|
public static void ShowPage(Page page)
|
||||||
{
|
{
|
||||||
|
|
@ -248,6 +249,9 @@ namespace ZicMoove
|
||||||
Icon = "",
|
Icon = "",
|
||||||
BindingContext = new ChatViewModel()
|
BindingContext = new ChatViewModel()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pinPage = new PinPage();
|
||||||
|
|
||||||
// var mainPage = new NavigationPage(bQueriesPage);
|
// var mainPage = new NavigationPage(bQueriesPage);
|
||||||
|
|
||||||
masterDetail = new ExtendedMasterDetailPage()
|
masterDetail = new ExtendedMasterDetailPage()
|
||||||
|
|
@ -293,6 +297,14 @@ namespace ZicMoove
|
||||||
() => { ShowPage(chatPage); }
|
() => { ShowPage(chatPage); }
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
ToolbarItem tiPinPage = new ToolbarItem()
|
||||||
|
{
|
||||||
|
Text = "Map",
|
||||||
|
Icon = "glyphish_103_map.png",
|
||||||
|
Command = new Command(
|
||||||
|
() => { ShowPage(pinPage); }
|
||||||
|
)
|
||||||
|
};
|
||||||
masterDetail.ToolbarItems.Add(tiHome);
|
masterDetail.ToolbarItems.Add(tiHome);
|
||||||
masterDetail.ToolbarItems.Add(tiSetts);
|
masterDetail.ToolbarItems.Add(tiSetts);
|
||||||
masterDetail.ToolbarItems.Add(tiPubChat);
|
masterDetail.ToolbarItems.Add(tiPubChat);
|
||||||
|
|
|
||||||
27
ZicMoove/ZicMoove/Model/Auth/GCRegIdDeclaration.cs
Normal file
27
ZicMoove/ZicMoove/Model/Auth/GCRegIdDeclaration.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yavsc.Models.Identity;
|
||||||
|
|
||||||
|
namespace ZicMoove.Model.Auth
|
||||||
|
{
|
||||||
|
public class GCMRegIdDeclaration : IGCMDeclaration
|
||||||
|
{
|
||||||
|
public string DeviceId
|
||||||
|
{ get; set; }
|
||||||
|
|
||||||
|
public string GCMRegistrationId
|
||||||
|
{ get; set; }
|
||||||
|
|
||||||
|
public string Model
|
||||||
|
{ get; set; }
|
||||||
|
|
||||||
|
public string Platform
|
||||||
|
{ get; set; }
|
||||||
|
|
||||||
|
public string Version
|
||||||
|
{ get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -12,10 +12,19 @@ namespace ZicMoove.Model.Social
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Position
|
public class Position
|
||||||
{
|
{
|
||||||
|
public Position()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public Position(double lat, double lon)
|
||||||
|
{
|
||||||
|
Latitude = lat;
|
||||||
|
Longitude = lon;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The longitude.
|
/// The longitude.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
||||||
public double Longitude { get; set; }
|
public double Longitude { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -3,23 +3,27 @@ using System;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using Xamarin.Forms.Maps;
|
using Xamarin.Forms.Maps;
|
||||||
using Yavsc;
|
using Yavsc;
|
||||||
|
using ZicMoove.Data;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using XLabs.Platform.Services.Geolocation;
|
||||||
|
using Plugin.Geolocator;
|
||||||
|
|
||||||
namespace ZicMoove.Pages
|
namespace ZicMoove.Pages
|
||||||
{
|
{
|
||||||
public class PinPage : ContentPage
|
public class PinPage : ContentPage
|
||||||
{
|
{
|
||||||
Map map;
|
Map map;
|
||||||
/*
|
|
||||||
protected async Task<Geolocator.Plugin.Abstractions.Position> GetPos() {
|
protected async Task<Plugin.Geolocator.Abstractions.Position> GetPos() {
|
||||||
var locator = CrossGeolocator.Current;
|
var locator = CrossGeolocator.Current;
|
||||||
locator.DesiredAccuracy = 50;
|
locator.DesiredAccuracy = 50;
|
||||||
|
|
||||||
return await locator.GetPositionAsync (timeout: 10000);
|
return await locator.GetPositionAsync (10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Position _pos;
|
private Model.Social.Position _pos;
|
||||||
public Position MyPosition {
|
public Model.Social.Position MyPosition {
|
||||||
get {
|
get {
|
||||||
return _pos;
|
return _pos;
|
||||||
}
|
}
|
||||||
|
|
@ -28,9 +32,9 @@ namespace ZicMoove.Pages
|
||||||
public async Task UpdateMyPos()
|
public async Task UpdateMyPos()
|
||||||
{
|
{
|
||||||
var pos = await GetPos();
|
var pos = await GetPos();
|
||||||
_pos = new Position(pos.Latitude,pos.Longitude);
|
_pos = new Model.Social.Position(pos.Latitude,pos.Longitude);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
protected override void OnAppearing ()
|
protected override void OnAppearing ()
|
||||||
{
|
{
|
||||||
base.OnAppearing ();
|
base.OnAppearing ();
|
||||||
|
|
@ -49,19 +53,20 @@ namespace ZicMoove.Pages
|
||||||
double lat=0;
|
double lat=0;
|
||||||
double lon=0;
|
double lon=0;
|
||||||
int pc = 0;
|
int pc = 0;
|
||||||
foreach (LocalizedEvent ev in Manager.Events) {
|
foreach (var query in DataManager.Instance.BookQueries)
|
||||||
var pin = new Pin {
|
{
|
||||||
|
var pin = new Pin {
|
||||||
Type = PinType.SearchResult,
|
Type = PinType.SearchResult,
|
||||||
Position = new Xamarin.Forms.Maps.Position(
|
Position = new Xamarin.Forms.Maps.Position(
|
||||||
ev.Location.Latitude, ev.Location.Longitude),
|
query.Location.Latitude, query.Location.Longitude),
|
||||||
Label = ev.Title,
|
Label = query.Reason,
|
||||||
Address = ev.Location.Address
|
Address = query.Location.Address
|
||||||
};
|
};
|
||||||
pin.BindingContext = ev;
|
pin.BindingContext = query;
|
||||||
map.Pins.Add (pin);
|
map.Pins.Add (pin);
|
||||||
// TODO find a true solution
|
// TODO find a true solution
|
||||||
lat = (lat * pc + ev.Location.Latitude) / (pc + 1);
|
lat = (lat * pc + query.Location.Latitude) / (pc + 1);
|
||||||
lon = (lon * pc + ev.Location.Longitude) / (pc + 1);
|
lon = (lon * pc + query.Location.Longitude) / (pc + 1);
|
||||||
pc++;
|
pc++;
|
||||||
}
|
}
|
||||||
// TODO build a MapSpan covering events
|
// TODO build a MapSpan covering events
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
<ListView x:Name="AccountListView"
|
<ListView x:Name="AccountListView"
|
||||||
SeparatorVisibility="Default"
|
SeparatorVisibility="Default"
|
||||||
VerticalOptions="FillAndExpand"
|
VerticalOptions="FillAndExpand"
|
||||||
ItemsSource="{x:Static local:MainSettings.AccountList}"
|
ItemsSource="{x:Static local:Settings.MainSettings.AccountList}"
|
||||||
>
|
>
|
||||||
<ListView.Header>
|
<ListView.Header>
|
||||||
<StackLayout Orientation="Horizontal">
|
<StackLayout Orientation="Horizontal">
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@ using Xamarin.Forms;
|
||||||
using XLabs.Forms.Behaviors;
|
using XLabs.Forms.Behaviors;
|
||||||
using XLabs.Forms.Controls;
|
using XLabs.Forms.Controls;
|
||||||
using XLabs.Forms.Mvvm;
|
using XLabs.Forms.Mvvm;
|
||||||
using XLabs.Ioc;
|
|
||||||
using XLabs.Platform.Services;
|
|
||||||
|
|
||||||
namespace ZicMoove.ViewModels.UserProfile
|
namespace ZicMoove.ViewModels.UserProfile
|
||||||
{
|
{
|
||||||
|
|
@ -138,8 +136,6 @@ namespace ZicMoove.ViewModels.UserProfile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool userIsPro = false;
|
|
||||||
|
|
||||||
public UserProfileViewModel()
|
public UserProfileViewModel()
|
||||||
{
|
{
|
||||||
Accounts = MainSettings.AccountList;
|
Accounts = MainSettings.AccountList;
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@
|
||||||
<Compile Include="Data\EstimateEntity.cs" />
|
<Compile Include="Data\EstimateEntity.cs" />
|
||||||
<Compile Include="Data\NonCrUD\RemoteFiles.cs" />
|
<Compile Include="Data\NonCrUD\RemoteFiles.cs" />
|
||||||
<Compile Include="Model\Access\BlackListed.cs" />
|
<Compile Include="Model\Access\BlackListed.cs" />
|
||||||
|
<Compile Include="Model\Auth\GCRegIdDeclaration.cs" />
|
||||||
<Compile Include="Model\Booking\MusicalPreference.cs" />
|
<Compile Include="Model\Booking\MusicalPreference.cs" />
|
||||||
<Compile Include="Model\Booking\MusicalTendency.cs" />
|
<Compile Include="Model\Booking\MusicalTendency.cs" />
|
||||||
<Compile Include="Model\FileSystem\UserDirectoryInfo.cs" />
|
<Compile Include="Model\FileSystem\UserDirectoryInfo.cs" />
|
||||||
|
|
@ -219,7 +220,7 @@
|
||||||
<Compile Include="Pages\HomePage.xaml.cs">
|
<Compile Include="Pages\HomePage.xaml.cs">
|
||||||
<DependentUpon>HomePage.xaml</DependentUpon>
|
<DependentUpon>HomePage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\Oooops\PinPage.cs" />
|
<Compile Include="Pages\EstimatePages\PinPage.cs" />
|
||||||
<Compile Include="ViewModels\EstimateAndBilling\BookQueriesViewModel.cs" />
|
<Compile Include="ViewModels\EstimateAndBilling\BookQueriesViewModel.cs" />
|
||||||
<Compile Include="ViewModels\EstimateAndBilling\BookQueryViewModel.cs" />
|
<Compile Include="ViewModels\EstimateAndBilling\BookQueryViewModel.cs" />
|
||||||
<Compile Include="ViewModels\EstimateAndBilling\BillingLineViewModel.cs" />
|
<Compile Include="ViewModels\EstimateAndBilling\BillingLineViewModel.cs" />
|
||||||
|
|
@ -299,6 +300,12 @@
|
||||||
<Reference Include="Plugin.Connectivity.Abstractions">
|
<Reference Include="Plugin.Connectivity.Abstractions">
|
||||||
<HintPath>..\..\packages\Xam.Plugin.Connectivity.2.2.12\lib\MonoAndroid10\Plugin.Connectivity.Abstractions.dll</HintPath>
|
<HintPath>..\..\packages\Xam.Plugin.Connectivity.2.2.12\lib\MonoAndroid10\Plugin.Connectivity.Abstractions.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Plugin.Geolocator">
|
||||||
|
<HintPath>..\..\packages\Xam.Plugin.Geolocator.3.0.4\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\Plugin.Geolocator.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Plugin.Geolocator.Abstractions">
|
||||||
|
<HintPath>..\..\packages\Xam.Plugin.Geolocator.3.0.4\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\Plugin.Geolocator.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Plugin.Media">
|
<Reference Include="Plugin.Media">
|
||||||
<HintPath>..\..\packages\Xam.Plugin.Media.2.3.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Plugin.Media.dll</HintPath>
|
<HintPath>..\..\packages\Xam.Plugin.Media.2.3.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Plugin.Media.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue