complete
parent
6681c11444
commit
345405e7b1
|
@ -3,6 +3,8 @@ using Android.App;
|
||||||
using Android.Content.PM;
|
using Android.Content.PM;
|
||||||
using Android.OS;
|
using Android.OS;
|
||||||
using Android.Views;
|
using Android.Views;
|
||||||
|
using MediaManager;
|
||||||
|
using MediaManager.Forms.Platforms.Android;
|
||||||
using Prism;
|
using Prism;
|
||||||
using Prism.Ioc;
|
using Prism.Ioc;
|
||||||
using Xamarin.Forms.Platform.Android;
|
using Xamarin.Forms.Platform.Android;
|
||||||
|
@ -23,6 +25,9 @@ namespace iElection.Droid
|
||||||
Xamarin.Forms.Forms.SetFlags(new string[] { "CarouselView_Experimental", "SwipeView_Experimental", "IndicatorView_Experimental" });
|
Xamarin.Forms.Forms.SetFlags(new string[] { "CarouselView_Experimental", "SwipeView_Experimental", "IndicatorView_Experimental" });
|
||||||
FFImageLoading.Forms.Platform.CachedImageRenderer.Init(true);
|
FFImageLoading.Forms.Platform.CachedImageRenderer.Init(true);
|
||||||
Rg.Plugins.Popup.Popup.Init(this);
|
Rg.Plugins.Popup.Popup.Init(this);
|
||||||
|
|
||||||
|
CrossMediaManager.Current.Init(this);
|
||||||
|
|
||||||
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
|
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,15 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="2" android:versionName="1.1" package="com.viranasirfanavar.ielection" android:installLocation="auto">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:usesCleartextTraffic="True" android:versionCode="9" android:versionName="1.29" package="com.viranasirfanavar.ielection" android:installLocation="auto">
|
||||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29" />
|
<uses-sdk android:minSdkVersion="22" android:targetSdkVersion="29" />
|
||||||
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||||
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
|
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
<application android:label="شورای شهر" android:icon="@mipmap/ic_ielection"></application>
|
<application android:label="شورای شهر" android:icon="@mipmap/ic_ielection"></application>
|
||||||
</manifest>
|
</manifest>
|
|
@ -68,6 +68,12 @@
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Octane.Xam.VideoPlayer">
|
||||||
|
<Version>3.1.0</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Plugin.MediaManager.Forms">
|
||||||
|
<Version>1.0.8</Version>
|
||||||
|
</PackageReference>
|
||||||
<PackageReference Include="Prism.Unity.Forms">
|
<PackageReference Include="Prism.Unity.Forms">
|
||||||
<Version>8.0.0.1909</Version>
|
<Version>8.0.0.1909</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
|
@ -198,6 +198,12 @@
|
||||||
<Reference Include="Xamarin.iOS" />
|
<Reference Include="Xamarin.iOS" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Octane.Xam.VideoPlayer">
|
||||||
|
<Version>3.1.0</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Plugin.MediaManager.Forms">
|
||||||
|
<Version>1.0.8</Version>
|
||||||
|
</PackageReference>
|
||||||
<PackageReference Include="Prism.Unity.Forms">
|
<PackageReference Include="Prism.Unity.Forms">
|
||||||
<Version>8.0.0.1909</Version>
|
<Version>8.0.0.1909</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
|
@ -50,6 +50,7 @@ namespace iElection
|
||||||
containerRegistry.RegisterForNavigation<SignUpPage, SignUpPageViewModel>();
|
containerRegistry.RegisterForNavigation<SignUpPage, SignUpPageViewModel>();
|
||||||
|
|
||||||
containerRegistry.RegisterForNavigation<AddContactPage, AddContactPageViewModel>();
|
containerRegistry.RegisterForNavigation<AddContactPage, AddContactPageViewModel>();
|
||||||
|
containerRegistry.RegisterForNavigation<TestPage, TestPageViewModel>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,5 +13,6 @@ namespace iElection.Models
|
||||||
public static string NotificationController { get; } = $"{BaseController}Notification";
|
public static string NotificationController { get; } = $"{BaseController}Notification";
|
||||||
public static string ContactController { get; } = $"{BaseController}Contact";
|
public static string ContactController { get; } = $"{BaseController}Contact";
|
||||||
public static string PageController { get; } = $"{BaseController}Page";
|
public static string PageController { get; } = $"{BaseController}Page";
|
||||||
|
public static string ActivityController { get; } = $"{BaseController}Activity";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,5 +7,6 @@ namespace iElection.Models.Config
|
||||||
public static class Settings
|
public static class Settings
|
||||||
{
|
{
|
||||||
public static string UserToken { get; set; } = "UserToken";
|
public static string UserToken { get; set; } = "UserToken";
|
||||||
|
public static string FullName { get; set; } = "FullName";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,6 @@ namespace iElection.Models.Dto
|
||||||
{
|
{
|
||||||
public ObservableCollection<Notification> Notifications { get; set; } = new ObservableCollection<Notification>();
|
public ObservableCollection<Notification> Notifications { get; set; } = new ObservableCollection<Notification>();
|
||||||
public ObservableCollection<Contact> Contacts { get; set; } = new ObservableCollection<Contact>();
|
public ObservableCollection<Contact> Contacts { get; set; } = new ObservableCollection<Contact>();
|
||||||
|
public ObservableCollection<Activity> Activities { get; set; } = new ObservableCollection<Activity>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace iElection.Models.Entities
|
||||||
|
{
|
||||||
|
public enum ActivityType
|
||||||
|
{
|
||||||
|
Image, Clip
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Activity
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
public string NameFile { get; set; }
|
||||||
|
public string ImageUrl { get; set; }
|
||||||
|
public string ClipUrl { get; set; }
|
||||||
|
|
||||||
|
public ActivityType ActivityType { get; set; }
|
||||||
|
public string CreateAt { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -54,8 +54,8 @@ namespace iElection.Services
|
||||||
await UtilitiesWrapper.Instance.PopUpUtilities.PushAsync(popup);
|
await UtilitiesWrapper.Instance.PopUpUtilities.PushAsync(popup);
|
||||||
popup.Accepted += ((sender, e) =>
|
popup.Accepted += ((sender, e) =>
|
||||||
{
|
{
|
||||||
//UtilitiesWrapper.Instance.UserUtilities.Logout();
|
UtilitiesWrapper.Instance.UserUtilities.LogOut();
|
||||||
//NavigationService.NavigateAsync("myapp:///NavigationPage/LoginPage");
|
NavigationService.NavigateAsync("myapp:///NavigationPage/LoginPage");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,29 @@ namespace iElection.Utilities
|
||||||
_userToken = value;
|
_userToken = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private string _fullName;
|
||||||
|
public string FullName
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_fullName == null)
|
||||||
|
_fullName = Preferences.Get(Settings.FullName, string.Empty);
|
||||||
|
return _fullName;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
Preferences.Set(Settings.FullName, value);
|
||||||
|
_fullName = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LogOut()
|
||||||
|
{
|
||||||
|
_userToken = null;
|
||||||
|
Preferences.Set(Settings.UserToken, null);
|
||||||
|
_fullName = null;
|
||||||
|
Preferences.Set(Settings.FullName, null);
|
||||||
|
}
|
||||||
public bool IsAuthorized
|
public bool IsAuthorized
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
|
@ -115,8 +115,7 @@ namespace iElection.ViewModels
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(PageDto.FirstName))
|
UtilitiesWrapper.Instance.PopUpUtilities.PushIndicator();
|
||||||
throw new Exception("نام را وارد کنید");
|
|
||||||
if (string.IsNullOrEmpty(PageDto.LastName))
|
if (string.IsNullOrEmpty(PageDto.LastName))
|
||||||
throw new Exception("نام خانوادگی را وارد کنید");
|
throw new Exception("نام خانوادگی را وارد کنید");
|
||||||
if (string.IsNullOrEmpty(PageDto.Phone))
|
if (string.IsNullOrEmpty(PageDto.Phone))
|
||||||
|
@ -129,6 +128,7 @@ namespace iElection.ViewModels
|
||||||
.Create(PageDto, UtilitiesWrapper.Instance.UserUtilities.UserToken);
|
.Create(PageDto, UtilitiesWrapper.Instance.UserUtilities.UserToken);
|
||||||
if (rest.IsSuccess)
|
if (rest.IsSuccess)
|
||||||
{
|
{
|
||||||
|
UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
||||||
UtilitiesWrapper.Instance.PopUpUtilities.PushSuccess("افزودن مخاطب با موفقیت انجام شد");
|
UtilitiesWrapper.Instance.PopUpUtilities.PushSuccess("افزودن مخاطب با موفقیت انجام شد");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ namespace iElection.ViewModels
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
UtilitiesWrapper.Instance.PopUpUtilities.PushIndicator();
|
||||||
if (string.IsNullOrEmpty(PageDto.Phone))
|
if (string.IsNullOrEmpty(PageDto.Phone))
|
||||||
throw new Exception("شماره تلفن خود را وارد کنید");
|
throw new Exception("شماره تلفن خود را وارد کنید");
|
||||||
if (string.IsNullOrEmpty(PageDto.Password))
|
if (string.IsNullOrEmpty(PageDto.Password))
|
||||||
|
@ -37,8 +38,10 @@ namespace iElection.ViewModels
|
||||||
var rest = await RestWrapper.AccountApiRest.LoginUser(PageDto);
|
var rest = await RestWrapper.AccountApiRest.LoginUser(PageDto);
|
||||||
if (rest.IsSuccess)
|
if (rest.IsSuccess)
|
||||||
{
|
{
|
||||||
|
UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
||||||
UtilitiesWrapper.Instance.UserUtilities.UserToken = "Bearer " + rest.Data.jwt;
|
UtilitiesWrapper.Instance.UserUtilities.UserToken = "Bearer " + rest.Data.jwt;
|
||||||
await NavigationService.NavigateAsync("MainPage");
|
UtilitiesWrapper.Instance.UserUtilities.FullName = rest.Data.fullName;
|
||||||
|
await NavigationService.NavigateAsync("myapp:///NavigationPage/MainPage");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (ApiException e)
|
catch (ApiException e)
|
||||||
|
|
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using iElection.Models;
|
using iElection.Models;
|
||||||
using iElection.Models.Dto;
|
using iElection.Models.Dto;
|
||||||
|
@ -22,8 +23,22 @@ namespace iElection.ViewModels
|
||||||
public ICommand AddNewContactCommand { get; set; }
|
public ICommand AddNewContactCommand { get; set; }
|
||||||
public ICommand SelectContactCommand { get; set; }
|
public ICommand SelectContactCommand { get; set; }
|
||||||
public ICommand SelectNotificationCommand { get; set; }
|
public ICommand SelectNotificationCommand { get; set; }
|
||||||
|
public ICommand ContactsRefreshCommand { get; set; }
|
||||||
|
public ICommand ActivitiesRefreshCommand { get; set; }
|
||||||
|
public ICommand ResomeRefreshCommand { get; set; }
|
||||||
|
public ICommand NotificationsRefreshCommand { get; set; }
|
||||||
|
public ICommand LogOutCommand { get; set; }
|
||||||
public bool IsWorking { get; set; } = false;
|
public bool IsWorking { get; set; } = false;
|
||||||
|
public bool IsContactsRefreshing { get; set; } = false;
|
||||||
|
private bool isContactsRefreshing = false;
|
||||||
|
public bool IsResomeRefreshing { get; set; } = false;
|
||||||
|
private bool isResomeRefreshing = false;
|
||||||
|
public bool IsActivityRefreshing { get; set; } = false;
|
||||||
|
private bool isActivityRefreshing = false;
|
||||||
|
public bool IsNotificationRefreshing { get; set; } = false;
|
||||||
|
private bool isNotificationRefreshing = false;
|
||||||
public string Text { get; set; }
|
public string Text { get; set; }
|
||||||
|
public string FullName { get; set; }
|
||||||
public ObservableCollection<string> Images { get; set; } = new ObservableCollection<string>();
|
public ObservableCollection<string> Images { get; set; } = new ObservableCollection<string>();
|
||||||
public MainPageViewModel(INavigationService navigationService , IRestWrapper restWrapper) : base(navigationService,restWrapper)
|
public MainPageViewModel(INavigationService navigationService , IRestWrapper restWrapper) : base(navigationService,restWrapper)
|
||||||
{
|
{
|
||||||
|
@ -36,34 +51,18 @@ namespace iElection.ViewModels
|
||||||
{
|
{
|
||||||
if (IsWorking)
|
if (IsWorking)
|
||||||
return;
|
return;
|
||||||
PageDto.Contacts.Clear();
|
|
||||||
PageDto.Notifications.Clear();
|
|
||||||
Images.Clear();
|
|
||||||
IsWorking = true;
|
IsWorking = true;
|
||||||
|
FullName = UtilitiesWrapper.Instance.UserUtilities.FullName;
|
||||||
UtilitiesWrapper.Instance.PopUpUtilities.PushIndicator();
|
GetActivities();
|
||||||
var rest = await RestWrapper.CrudApiRest<Notification, int>(Address.NotificationController)
|
GetContacts();
|
||||||
.ReadAll(UtilitiesWrapper.Instance.UserUtilities.UserToken);
|
GetNotifications();
|
||||||
if (rest.IsSuccess)
|
await GetResome();
|
||||||
rest.Data.ForEach(n => PageDto.Notifications.Add(n));
|
|
||||||
var restContact = await RestWrapper.CrudApiRest<Contact, int>(Address.ContactController)
|
|
||||||
.ReadAll(UtilitiesWrapper.Instance.UserUtilities.UserToken);
|
|
||||||
if (restContact.IsSuccess)
|
|
||||||
restContact.Data.ForEach(c => PageDto.Contacts.Add(c));
|
|
||||||
var restCV = await RestWrapper.PageRestApi.GetInfoCv(UtilitiesWrapper.Instance.UserUtilities.UserToken);
|
|
||||||
if (restCV.IsSuccess)
|
|
||||||
{
|
|
||||||
Text = restCV.Data.Text;
|
|
||||||
restCV.Data.Images.ForEach(i=>Images.Add(i));
|
|
||||||
Title = restCV.Data.Title;
|
|
||||||
}
|
|
||||||
await UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (ApiException e)
|
catch (ApiException e)
|
||||||
{
|
{
|
||||||
await UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
await UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
||||||
RestWrapper.UnhandledExceptionRaiser(e);
|
RestWrapper.UnhandledExceptionRaiser(e,NavigationService);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -76,9 +75,136 @@ namespace iElection.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task GetActivities()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (isActivityRefreshing)
|
||||||
|
return;
|
||||||
|
PageDto.Activities.Clear();
|
||||||
|
isActivityRefreshing = true;
|
||||||
|
var restActive = await RestWrapper.CrudApiRest<Activity, int>(Address.ActivityController)
|
||||||
|
.ReadAll(UtilitiesWrapper.Instance.UserUtilities.UserToken);
|
||||||
|
if (restActive.IsSuccess)
|
||||||
|
{
|
||||||
|
restActive.Data.ForEach(a => PageDto.Activities.Add(a));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
await UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
||||||
|
RestWrapper.UnhandledExceptionRaiser(e, NavigationService);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
await UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
||||||
|
UtilitiesWrapper.Instance.PopUpUtilities.PushError(e.Message);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
isActivityRefreshing = false;
|
||||||
|
IsActivityRefreshing = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public async Task GetResome()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (isResomeRefreshing)
|
||||||
|
return;
|
||||||
|
Images.Clear();
|
||||||
|
isResomeRefreshing = true;
|
||||||
|
var restCV = await RestWrapper.PageRestApi.GetInfoCv(UtilitiesWrapper.Instance.UserUtilities.UserToken);
|
||||||
|
if (restCV.IsSuccess)
|
||||||
|
{
|
||||||
|
Text = restCV.Data.Text;
|
||||||
|
restCV.Data.Images.ForEach(i => Images.Add(i));
|
||||||
|
Title = restCV.Data.Title;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
await UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
||||||
|
RestWrapper.UnhandledExceptionRaiser(e, NavigationService);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
await UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
||||||
|
UtilitiesWrapper.Instance.PopUpUtilities.PushError(e.Message);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
IsResomeRefreshing = false;
|
||||||
|
isResomeRefreshing = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public async Task GetNotifications()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (isNotificationRefreshing)
|
||||||
|
return;
|
||||||
|
PageDto.Notifications.Clear();
|
||||||
|
isNotificationRefreshing = true;
|
||||||
|
var rest = await RestWrapper.CrudApiRest<Notification, int>(Address.NotificationController)
|
||||||
|
.ReadAll(UtilitiesWrapper.Instance.UserUtilities.UserToken);
|
||||||
|
if (rest.IsSuccess)
|
||||||
|
rest.Data.ForEach(n => PageDto.Notifications.Add(n));
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
await UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
||||||
|
RestWrapper.UnhandledExceptionRaiser(e, NavigationService);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
await UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
||||||
|
UtilitiesWrapper.Instance.PopUpUtilities.PushError(e.Message);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
isNotificationRefreshing = false;
|
||||||
|
IsNotificationRefreshing = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public async Task GetContacts()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if(isContactsRefreshing)
|
||||||
|
return;
|
||||||
|
PageDto.Contacts.Clear();
|
||||||
|
isContactsRefreshing = true;
|
||||||
|
var restContact = await RestWrapper.CrudApiRest<Contact, int>(Address.ContactController)
|
||||||
|
.ReadAll(UtilitiesWrapper.Instance.UserUtilities.UserToken);
|
||||||
|
if (restContact.IsSuccess)
|
||||||
|
restContact.Data.ForEach(c => PageDto.Contacts.Add(c));
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
await UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
||||||
|
RestWrapper.UnhandledExceptionRaiser(e, NavigationService);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
await UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
||||||
|
UtilitiesWrapper.Instance.PopUpUtilities.PushError(e.Message);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
isContactsRefreshing = false;
|
||||||
|
IsContactsRefreshing = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void InitializeCommand()
|
public override void InitializeCommand()
|
||||||
{
|
{
|
||||||
base.InitializeCommand();
|
base.InitializeCommand();
|
||||||
|
|
||||||
AddNewContactCommand = new DelegateCommand(() =>
|
AddNewContactCommand = new DelegateCommand(() =>
|
||||||
{
|
{
|
||||||
NavigationService.NavigateAsync("AddContactPage");
|
NavigationService.NavigateAsync("AddContactPage");
|
||||||
|
@ -109,7 +235,7 @@ namespace iElection.ViewModels
|
||||||
}
|
}
|
||||||
catch (ApiException e)
|
catch (ApiException e)
|
||||||
{
|
{
|
||||||
RestWrapper.UnhandledExceptionRaiser(e);
|
RestWrapper.UnhandledExceptionRaiser(e, NavigationService);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -131,7 +257,7 @@ namespace iElection.ViewModels
|
||||||
}
|
}
|
||||||
catch (ApiException e)
|
catch (ApiException e)
|
||||||
{
|
{
|
||||||
RestWrapper.UnhandledExceptionRaiser(e);
|
RestWrapper.UnhandledExceptionRaiser(e, NavigationService);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -139,6 +265,15 @@ namespace iElection.ViewModels
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
ContactsRefreshCommand = new DelegateCommand(async () => await GetContacts());
|
||||||
|
NotificationsRefreshCommand = new DelegateCommand(async () => await GetNotifications());
|
||||||
|
ActivitiesRefreshCommand = new DelegateCommand(async () => await GetActivities());
|
||||||
|
ResomeRefreshCommand = new DelegateCommand(async () => await GetResome());
|
||||||
|
LogOutCommand = new DelegateCommand(async () =>
|
||||||
|
{
|
||||||
|
UtilitiesWrapper.Instance.UserUtilities.LogOut();
|
||||||
|
await NavigationService.NavigateAsync("myapp:///NavigationPage/LoginPage");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace iElection.ViewModels
|
||||||
public RegisterInfoDto InfoDto { get; set; } = new RegisterInfoDto();
|
public RegisterInfoDto InfoDto { get; set; } = new RegisterInfoDto();
|
||||||
public ICommand SignUpCommand { get; set; }
|
public ICommand SignUpCommand { get; set; }
|
||||||
public ICommand LoginCommand { get; set; }
|
public ICommand LoginCommand { get; set; }
|
||||||
public SignUpPageViewModel(INavigationService navigationService , IRestWrapper restWrapper):base(navigationService,restWrapper)
|
public SignUpPageViewModel(INavigationService navigationService, IRestWrapper restWrapper) : base(navigationService, restWrapper)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,8 @@ namespace iElection.ViewModels
|
||||||
{
|
{
|
||||||
|
|
||||||
UtilitiesWrapper.Instance.UserUtilities.UserToken = "Bearer " + rest.Data.jwt;
|
UtilitiesWrapper.Instance.UserUtilities.UserToken = "Bearer " + rest.Data.jwt;
|
||||||
await NavigationService.NavigateAsync("MainPage");
|
UtilitiesWrapper.Instance.UserUtilities.FullName = rest.Data.fullName;
|
||||||
|
await NavigationService.NavigateAsync("myapp:///NavigationPage/MainPage");
|
||||||
UtilitiesWrapper.Instance.PopUpUtilities.PushSuccess("ثبت نام با موفقیت انجام شد");
|
UtilitiesWrapper.Instance.PopUpUtilities.PushSuccess("ثبت نام با موفقیت انجام شد");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
using Prism.Commands;
|
||||||
|
using Prism.Mvvm;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace iElection.ViewModels
|
||||||
|
{
|
||||||
|
public class TestPageViewModel : BindableBase
|
||||||
|
{
|
||||||
|
public TestPageViewModel()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<ContentView
|
||||||
|
x:Class="iElection.Views.Controllers.PostItemTemplate"
|
||||||
|
xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
xmlns:forms="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
|
||||||
|
xmlns:models="clr-namespace:iElection.Models;assembly=iElection"
|
||||||
|
xmlns:videoPlayer="clr-namespace:Octane.Xamarin.Forms.VideoPlayer;assembly=Octane.Xamarin.Forms.VideoPlayer"
|
||||||
|
xmlns:views="http://xamarin.com/schemas/2020/toolkit">
|
||||||
|
<ContentView.Content>
|
||||||
|
<StackLayout>
|
||||||
|
<Frame
|
||||||
|
Margin="10,5"
|
||||||
|
Padding="0"
|
||||||
|
CornerRadius="7">
|
||||||
|
<StackLayout Margin="8">
|
||||||
|
<Grid>
|
||||||
|
<forms:CachedImage
|
||||||
|
Margin="-8"
|
||||||
|
Aspect="AspectFill"
|
||||||
|
Source="{Binding ImageUrl}" />
|
||||||
|
<Frame
|
||||||
|
x:Name="clipButton"
|
||||||
|
Padding="0"
|
||||||
|
BackgroundColor="{StaticResource Stylish}"
|
||||||
|
CornerRadius="25"
|
||||||
|
HorizontalOptions="End"
|
||||||
|
VerticalOptions="End">
|
||||||
|
<StackLayout Orientation="Horizontal">
|
||||||
|
<Label
|
||||||
|
FontFamily="{StaticResource MaterialFontFamily}"
|
||||||
|
FontSize="30"
|
||||||
|
Text="{x:Static models:MaterialIconFont.PlayCircle}"
|
||||||
|
TextColor="White" />
|
||||||
|
<Label
|
||||||
|
Margin="15,0,0,5"
|
||||||
|
HorizontalOptions="Center"
|
||||||
|
Text="نمایش ویدیو"
|
||||||
|
TextColor="White"
|
||||||
|
VerticalOptions="Center" />
|
||||||
|
</StackLayout>
|
||||||
|
<Frame.GestureRecognizers>
|
||||||
|
<TapGestureRecognizer Tapped="PlayVideo_OnTapped" />
|
||||||
|
</Frame.GestureRecognizers>
|
||||||
|
</Frame>
|
||||||
|
</Grid>
|
||||||
|
<Label
|
||||||
|
Margin="0,8,0,0"
|
||||||
|
HorizontalOptions="Start"
|
||||||
|
Text="{Binding CreateAt}"
|
||||||
|
TextColor="#777" />
|
||||||
|
<Label
|
||||||
|
Margin="0,-8"
|
||||||
|
FontSize="Medium"
|
||||||
|
Text="{Binding Title}"
|
||||||
|
TextColor="#222" />
|
||||||
|
<Label
|
||||||
|
LineBreakMode="WordWrap"
|
||||||
|
Text="{Binding Description}"
|
||||||
|
TextColor="#222" />
|
||||||
|
</StackLayout>
|
||||||
|
</Frame>
|
||||||
|
</StackLayout>
|
||||||
|
</ContentView.Content>
|
||||||
|
</ContentView>
|
|
@ -0,0 +1,39 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using iElection.Models.Entities;
|
||||||
|
using Xamarin.Essentials;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
using Xamarin.Forms.Xaml;
|
||||||
|
|
||||||
|
namespace iElection.Views.Controllers
|
||||||
|
{
|
||||||
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||||
|
public partial class PostItemTemplate : ContentView
|
||||||
|
{
|
||||||
|
public PostItemTemplate()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnBindingContextChanged()
|
||||||
|
{
|
||||||
|
base.OnBindingContextChanged();
|
||||||
|
if (BindingContext is Activity activity)
|
||||||
|
{
|
||||||
|
if (activity.ActivityType == ActivityType.Clip)
|
||||||
|
clipButton.IsVisible = true;
|
||||||
|
else
|
||||||
|
clipButton.IsVisible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void PlayVideo_OnTapped(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Launcher.OpenAsync((BindingContext as Activity).ClipUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -41,7 +41,7 @@
|
||||||
MaterialTheme="Acrylic">
|
MaterialTheme="Acrylic">
|
||||||
<Entry
|
<Entry
|
||||||
FontSize="Small"
|
FontSize="Small"
|
||||||
Placeholder="نام کاربری"
|
Placeholder="شماره تلفن"
|
||||||
Text="{Binding Path=PageDto.Phone, Mode=TwoWay}" />
|
Text="{Binding Path=PageDto.Phone, Mode=TwoWay}" />
|
||||||
</materialFrame:MaterialFrame>
|
</materialFrame:MaterialFrame>
|
||||||
<materialFrame:MaterialFrame
|
<materialFrame:MaterialFrame
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
x:Class="iElection.Views.MainPage"
|
x:Class="iElection.Views.MainPage"
|
||||||
xmlns="http://xamarin.com/schemas/2014/forms"
|
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:controllers="clr-namespace:iElection.Views.Controllers;assembly=iElection"
|
||||||
xmlns:forms="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
|
xmlns:forms="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
|
||||||
xmlns:materialFrame="http://sharpnado.com"
|
xmlns:materialFrame="http://sharpnado.com"
|
||||||
xmlns:models="clr-namespace:iElection.Models;assembly=iElection"
|
xmlns:models="clr-namespace:iElection.Models;assembly=iElection"
|
||||||
|
@ -11,213 +12,271 @@
|
||||||
BackgroundColor="{StaticResource Gray-200}"
|
BackgroundColor="{StaticResource Gray-200}"
|
||||||
NavigationPage.HasNavigationBar="False">
|
NavigationPage.HasNavigationBar="False">
|
||||||
|
|
||||||
<views:TabView
|
<Grid>
|
||||||
TabIndicatorColor="{StaticResource Blue}"
|
<Grid.RowDefinitions>
|
||||||
TabStripBackgroundColor="White"
|
<RowDefinition Height="Auto" />
|
||||||
TabStripHeight="60"
|
<RowDefinition Height="*" />
|
||||||
TabStripPlacement="Bottom">
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<views:TabViewItem FontFamily="{StaticResource ShabnameBold}" Text="مخاطبین">
|
<Frame
|
||||||
<Grid FlowDirection="RightToLeft">
|
Margin="0,-25,0,0"
|
||||||
|
Padding="10,35,10,10"
|
||||||
|
BackgroundColor="{StaticResource PrimaryColor}"
|
||||||
<CollectionView ItemsSource="{Binding PageDto.Contacts}">
|
CornerRadius="15"
|
||||||
<CollectionView.ItemTemplate>
|
FlowDirection="RightToLeft">
|
||||||
<DataTemplate>
|
<Grid ColumnDefinitions="*,Auto">
|
||||||
<Grid>
|
<Label
|
||||||
|
Margin="10,0"
|
||||||
<materialFrame:MaterialFrame
|
FontFamily="{StaticResource ShabnameBold}"
|
||||||
Margin="10,10"
|
|
||||||
Padding="12,8"
|
|
||||||
LightThemeBackgroundColor="#f9f9f9">
|
|
||||||
<Grid ColumnDefinitions="Auto,*">
|
|
||||||
<views:AvatarView
|
|
||||||
Margin="7,0,0,0"
|
|
||||||
Text="M"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
<StackLayout Grid.Column="1">
|
|
||||||
<Grid ColumnDefinitions="*,Auto">
|
|
||||||
<StackLayout Orientation="Horizontal">
|
|
||||||
<Label FontFamily="{StaticResource ShabnameBold}" Text="{Binding FullName}" />
|
|
||||||
</StackLayout>
|
|
||||||
<StackLayout
|
|
||||||
Grid.Column="1"
|
|
||||||
Orientation="Horizontal"
|
|
||||||
VerticalOptions="Center">
|
|
||||||
<Label FontSize="Caption" Text="{Binding CreateAt}" />
|
|
||||||
</StackLayout>
|
|
||||||
</Grid>
|
|
||||||
<StackLayout Orientation="Horizontal">
|
|
||||||
<Label Text="{Binding Phone}" />
|
|
||||||
</StackLayout>
|
|
||||||
</StackLayout>
|
|
||||||
</Grid>
|
|
||||||
<materialFrame:MaterialFrame.GestureRecognizers>
|
|
||||||
<TapGestureRecognizer Tapped="ContactSelect_OnTapped" />
|
|
||||||
</materialFrame:MaterialFrame.GestureRecognizers>
|
|
||||||
</materialFrame:MaterialFrame>
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</CollectionView.ItemTemplate>
|
|
||||||
</CollectionView>
|
|
||||||
<materialFrame:MaterialFrame
|
|
||||||
Margin="10,15"
|
|
||||||
Padding="0"
|
|
||||||
AcrylicGlowColor="#3498db"
|
|
||||||
CornerRadius="18"
|
|
||||||
HorizontalOptions="End"
|
|
||||||
LightThemeBackgroundColor="#2980b9"
|
|
||||||
MaterialTheme="Acrylic"
|
|
||||||
VerticalOptions="End">
|
|
||||||
<StackLayout Orientation="Horizontal">
|
|
||||||
<Label
|
|
||||||
FontFamily="{StaticResource MaterialFontFamily}"
|
|
||||||
FontSize="40"
|
|
||||||
Text="{x:Static models:MaterialIconFont.PlusCircle}"
|
|
||||||
TextColor="White" />
|
|
||||||
<Label
|
|
||||||
Margin="15,0,0,3"
|
|
||||||
FontFamily="{StaticResource ShabnameBold}"
|
|
||||||
Text="افزودن مخاطبــ"
|
|
||||||
TextColor="White"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
</StackLayout>
|
|
||||||
<materialFrame:MaterialFrame.GestureRecognizers>
|
|
||||||
<TapGestureRecognizer Tapped="AddNewContact_OnTapped" />
|
|
||||||
</materialFrame:MaterialFrame.GestureRecognizers>
|
|
||||||
</materialFrame:MaterialFrame>
|
|
||||||
</Grid>
|
|
||||||
</views:TabViewItem>
|
|
||||||
|
|
||||||
<views:TabViewItem FontFamily="{StaticResource ShabnameBold}" Text="رزومه">
|
|
||||||
<Grid FlowDirection="RightToLeft" RowDefinitions="4*,Auto,8*">
|
|
||||||
|
|
||||||
<Frame
|
|
||||||
Margin="8"
|
|
||||||
Padding="0"
|
|
||||||
CornerRadius="5">
|
|
||||||
<CarouselView
|
|
||||||
x:Name="carouselView"
|
|
||||||
Margin="0"
|
|
||||||
IndicatorView="indicatorView"
|
|
||||||
ItemsSource="{Binding Images}">
|
|
||||||
<CarouselView.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Frame Padding="0">
|
|
||||||
<forms:CachedImage Aspect="AspectFill" Source="{Binding .}" />
|
|
||||||
</Frame>
|
|
||||||
</DataTemplate>
|
|
||||||
</CarouselView.ItemTemplate>
|
|
||||||
</CarouselView>
|
|
||||||
</Frame>
|
|
||||||
|
|
||||||
<IndicatorView
|
|
||||||
x:Name="indicatorView"
|
|
||||||
Grid.Row="1"
|
|
||||||
Margin="0,-8,0,0"
|
|
||||||
HorizontalOptions="Center"
|
|
||||||
IndicatorColor="LightGray"
|
|
||||||
IndicatorsShape="Circle"
|
|
||||||
SelectedIndicatorColor="#F70000"
|
|
||||||
VerticalOptions="StartAndExpand" />
|
|
||||||
<materialFrame:MaterialFrame
|
|
||||||
Grid.Row="2"
|
|
||||||
Margin="10,0,10,10"
|
|
||||||
Padding="10">
|
|
||||||
|
|
||||||
<ScrollView>
|
|
||||||
<StackLayout>
|
|
||||||
<Label
|
|
||||||
Margin="0,10"
|
|
||||||
FontFamily="{StaticResource ShabnameBold}"
|
|
||||||
FontSize="Medium"
|
|
||||||
HorizontalOptions="Center"
|
|
||||||
Text="{Binding Title}"
|
|
||||||
TextColor="#222" />
|
|
||||||
<Label Text="{Binding Text}" TextColor="#222" />
|
|
||||||
</StackLayout>
|
|
||||||
</ScrollView>
|
|
||||||
</materialFrame:MaterialFrame>
|
|
||||||
</Grid>
|
|
||||||
</views:TabViewItem>
|
|
||||||
|
|
||||||
<views:TabViewItem FontFamily="{StaticResource ShabnameBold}" Text="اطلاعیه">
|
|
||||||
<Grid FlowDirection="RightToLeft">
|
|
||||||
|
|
||||||
<CollectionView ItemsSource="{Binding PageDto.Notifications}">
|
|
||||||
<CollectionView.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Grid>
|
|
||||||
|
|
||||||
<materialFrame:MaterialFrame
|
|
||||||
Margin="10,10"
|
|
||||||
Padding="12,8"
|
|
||||||
LightThemeBackgroundColor="#f9f9f9">
|
|
||||||
<Grid ColumnDefinitions="Auto,*">
|
|
||||||
<Label
|
|
||||||
Margin="0,0,0,5"
|
|
||||||
FontFamily="{StaticResource MaterialFontFamily}"
|
|
||||||
FontSize="45"
|
|
||||||
HorizontalTextAlignment="Center"
|
|
||||||
Text="{x:Static models:MaterialIconFont.BellCircle}"
|
|
||||||
TextColor="#3498db"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
VerticalTextAlignment="Center" />
|
|
||||||
<StackLayout Grid.Column="1" VerticalOptions="Center">
|
|
||||||
<Grid ColumnDefinitions="*,Auto">
|
|
||||||
<StackLayout Orientation="Horizontal">
|
|
||||||
<Label Text="{Binding Title}" TextColor="#222" />
|
|
||||||
</StackLayout>
|
|
||||||
<StackLayout
|
|
||||||
Grid.Column="1"
|
|
||||||
Orientation="Horizontal"
|
|
||||||
VerticalOptions="Center">
|
|
||||||
<Label
|
|
||||||
FontSize="Caption"
|
|
||||||
Text="{Binding CreateAt}"
|
|
||||||
TextColor="#222" />
|
|
||||||
</StackLayout>
|
|
||||||
</Grid>
|
|
||||||
<StackLayout Orientation="Horizontal">
|
|
||||||
<Label Text="{Binding Text}" TextColor="#222" />
|
|
||||||
</StackLayout>
|
|
||||||
</StackLayout>
|
|
||||||
</Grid>
|
|
||||||
<materialFrame:MaterialFrame.GestureRecognizers>
|
|
||||||
<TapGestureRecognizer Tapped="Notification_OnTapped" />
|
|
||||||
</materialFrame:MaterialFrame.GestureRecognizers>
|
|
||||||
</materialFrame:MaterialFrame>
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</CollectionView.ItemTemplate>
|
|
||||||
</CollectionView>
|
|
||||||
<!--<materialFrame:MaterialFrame
|
|
||||||
Margin="10,15"
|
|
||||||
Padding="0"
|
|
||||||
AcrylicGlowColor="#3498db"
|
|
||||||
CornerRadius="18"
|
|
||||||
HorizontalOptions="Start"
|
HorizontalOptions="Start"
|
||||||
LightThemeBackgroundColor="#2980b9"
|
Text="{Binding FullName}"
|
||||||
MaterialTheme="Acrylic"
|
TextColor="White"
|
||||||
VerticalOptions="End">
|
VerticalOptions="Center" />
|
||||||
<StackLayout Orientation="Horizontal">
|
<Button
|
||||||
<Label
|
Grid.Column="1"
|
||||||
FontFamily="{StaticResource MaterialFontFamily}"
|
Padding="0"
|
||||||
FontSize="40"
|
BackgroundColor="{StaticResource PrimaryLighterColor}"
|
||||||
Text="{x:Static models:MaterialIconFont.PlusCircle}"
|
Command="{Binding LogOutCommand}"
|
||||||
TextColor="White" />
|
CornerRadius="15"
|
||||||
<Label
|
HeightRequest="35"
|
||||||
Margin="15,0,0,3"
|
Text="خروج"
|
||||||
FontFamily="{StaticResource ShabnameBold}"
|
TextColor="White" />
|
||||||
Text="افزودن اطلاعیه"
|
|
||||||
TextColor="White"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
</StackLayout>
|
|
||||||
<materialFrame:MaterialFrame.GestureRecognizers>
|
|
||||||
<TapGestureRecognizer Tapped="AddNewContact_OnTapped" />
|
|
||||||
</materialFrame:MaterialFrame.GestureRecognizers>
|
|
||||||
</materialFrame:MaterialFrame>-->
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</views:TabViewItem>
|
</Frame>
|
||||||
</views:TabView>
|
<views:TabView
|
||||||
|
Grid.Row="1"
|
||||||
|
TabIndicatorColor="{StaticResource Blue}"
|
||||||
|
TabStripBackgroundColor="White"
|
||||||
|
TabStripHeight="60"
|
||||||
|
TabStripPlacement="Bottom">
|
||||||
|
|
||||||
|
<views:TabViewItem FontFamily="{StaticResource ShabnameBold}" Text="مخاطبین">
|
||||||
|
<Grid>
|
||||||
|
|
||||||
|
<RefreshView
|
||||||
|
Command="{Binding ContactsRefreshCommand}"
|
||||||
|
IsRefreshing="{Binding IsContactsRefreshing}"
|
||||||
|
RefreshColor="{StaticResource PrimaryColor}">
|
||||||
|
<RefreshView.Content>
|
||||||
|
|
||||||
|
<Grid FlowDirection="RightToLeft">
|
||||||
|
<CollectionView ItemsSource="{Binding PageDto.Contacts}">
|
||||||
|
<CollectionView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid>
|
||||||
|
|
||||||
|
<materialFrame:MaterialFrame
|
||||||
|
Margin="10,10"
|
||||||
|
Padding="12,8"
|
||||||
|
LightThemeBackgroundColor="#f9f9f9">
|
||||||
|
<Grid ColumnDefinitions="Auto,*">
|
||||||
|
<views:AvatarView
|
||||||
|
Margin="7,0,0,0"
|
||||||
|
Text="M"
|
||||||
|
VerticalOptions="Center" />
|
||||||
|
<StackLayout Grid.Column="1">
|
||||||
|
<Grid ColumnDefinitions="*,Auto">
|
||||||
|
<StackLayout Orientation="Horizontal">
|
||||||
|
<Label FontFamily="{StaticResource ShabnameBold}" Text="{Binding FullName}" />
|
||||||
|
</StackLayout>
|
||||||
|
<StackLayout
|
||||||
|
Grid.Column="1"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
VerticalOptions="Center">
|
||||||
|
<Label FontSize="Caption" Text="{Binding CreateAt}" />
|
||||||
|
</StackLayout>
|
||||||
|
</Grid>
|
||||||
|
<StackLayout Orientation="Horizontal">
|
||||||
|
<Label Text="{Binding Phone}" />
|
||||||
|
</StackLayout>
|
||||||
|
</StackLayout>
|
||||||
|
</Grid>
|
||||||
|
<materialFrame:MaterialFrame.GestureRecognizers>
|
||||||
|
<TapGestureRecognizer Tapped="ContactSelect_OnTapped" />
|
||||||
|
</materialFrame:MaterialFrame.GestureRecognizers>
|
||||||
|
</materialFrame:MaterialFrame>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</CollectionView.ItemTemplate>
|
||||||
|
</CollectionView>
|
||||||
|
<materialFrame:MaterialFrame
|
||||||
|
Margin="10,15"
|
||||||
|
Padding="0"
|
||||||
|
AcrylicGlowColor="#3498db"
|
||||||
|
CornerRadius="18"
|
||||||
|
HorizontalOptions="End"
|
||||||
|
LightThemeBackgroundColor="#2980b9"
|
||||||
|
MaterialTheme="Acrylic"
|
||||||
|
VerticalOptions="End">
|
||||||
|
<StackLayout Orientation="Horizontal">
|
||||||
|
<Label
|
||||||
|
FontFamily="{StaticResource MaterialFontFamily}"
|
||||||
|
FontSize="40"
|
||||||
|
Text="{x:Static models:MaterialIconFont.PlusCircle}"
|
||||||
|
TextColor="White" />
|
||||||
|
<Label
|
||||||
|
Margin="15,0,0,3"
|
||||||
|
FontFamily="{StaticResource ShabnameBold}"
|
||||||
|
Text="افزودن مخاطبــ"
|
||||||
|
TextColor="White"
|
||||||
|
VerticalOptions="Center" />
|
||||||
|
</StackLayout>
|
||||||
|
<materialFrame:MaterialFrame.GestureRecognizers>
|
||||||
|
<TapGestureRecognizer Tapped="AddNewContact_OnTapped" />
|
||||||
|
</materialFrame:MaterialFrame.GestureRecognizers>
|
||||||
|
</materialFrame:MaterialFrame>
|
||||||
|
</Grid>
|
||||||
|
</RefreshView.Content>
|
||||||
|
</RefreshView>
|
||||||
|
</Grid>
|
||||||
|
</views:TabViewItem>
|
||||||
|
|
||||||
|
<views:TabViewItem FontFamily="{StaticResource ShabnameBold}" Text="رزومه">
|
||||||
|
<Grid>
|
||||||
|
<RefreshView
|
||||||
|
Command="{Binding ResomeRefreshCommand}"
|
||||||
|
IsRefreshing="{Binding IsResomeRefreshing}"
|
||||||
|
RefreshColor="{StaticResource PrimaryColor}">
|
||||||
|
<RefreshView.Content>
|
||||||
|
<Grid FlowDirection="RightToLeft" RowDefinitions="4*,Auto,8*">
|
||||||
|
|
||||||
|
<Frame
|
||||||
|
Margin="8"
|
||||||
|
Padding="0"
|
||||||
|
CornerRadius="5">
|
||||||
|
<CarouselView
|
||||||
|
x:Name="carouselView"
|
||||||
|
Margin="0"
|
||||||
|
IndicatorView="indicatorView"
|
||||||
|
ItemsSource="{Binding Images}">
|
||||||
|
<CarouselView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Frame Padding="0">
|
||||||
|
<forms:CachedImage Aspect="AspectFill" Source="{Binding .}" />
|
||||||
|
</Frame>
|
||||||
|
</DataTemplate>
|
||||||
|
</CarouselView.ItemTemplate>
|
||||||
|
</CarouselView>
|
||||||
|
</Frame>
|
||||||
|
|
||||||
|
<IndicatorView
|
||||||
|
x:Name="indicatorView"
|
||||||
|
Grid.Row="1"
|
||||||
|
Margin="0,-8,0,0"
|
||||||
|
HorizontalOptions="Center"
|
||||||
|
IndicatorColor="LightGray"
|
||||||
|
IndicatorsShape="Circle"
|
||||||
|
SelectedIndicatorColor="#F70000"
|
||||||
|
VerticalOptions="StartAndExpand" />
|
||||||
|
<materialFrame:MaterialFrame
|
||||||
|
Grid.Row="2"
|
||||||
|
Margin="10,0,10,10"
|
||||||
|
Padding="10">
|
||||||
|
|
||||||
|
<ScrollView>
|
||||||
|
<StackLayout>
|
||||||
|
<Label
|
||||||
|
Margin="0,10"
|
||||||
|
FontFamily="{StaticResource ShabnameBold}"
|
||||||
|
FontSize="Medium"
|
||||||
|
HorizontalOptions="Center"
|
||||||
|
Text="{Binding Title}"
|
||||||
|
TextColor="#222" />
|
||||||
|
<Label Text="{Binding Text}" TextColor="#222" />
|
||||||
|
</StackLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</materialFrame:MaterialFrame>
|
||||||
|
</Grid>
|
||||||
|
</RefreshView.Content>
|
||||||
|
</RefreshView>
|
||||||
|
</Grid>
|
||||||
|
</views:TabViewItem>
|
||||||
|
|
||||||
|
<views:TabViewItem FontFamily="{StaticResource ShabnameBold}" Text="فعالیتـ ها">
|
||||||
|
<Grid>
|
||||||
|
<RefreshView
|
||||||
|
Command="{Binding ActivitiesRefreshCommand}"
|
||||||
|
IsRefreshing="{Binding IsActivityRefreshing}"
|
||||||
|
RefreshColor="{StaticResource PrimaryColor}">
|
||||||
|
<Grid FlowDirection="RightToLeft">
|
||||||
|
|
||||||
|
<CollectionView ItemsSource="{Binding PageDto.Activities}">
|
||||||
|
<CollectionView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid>
|
||||||
|
<controllers:PostItemTemplate />
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</CollectionView.ItemTemplate>
|
||||||
|
</CollectionView>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</RefreshView>
|
||||||
|
</Grid>
|
||||||
|
</views:TabViewItem>
|
||||||
|
|
||||||
|
<views:TabViewItem FontFamily="{StaticResource ShabnameBold}" Text="اطلاعیه">
|
||||||
|
<Grid>
|
||||||
|
<RefreshView
|
||||||
|
Command="{Binding NotificationsRefreshCommand}"
|
||||||
|
IsRefreshing="{Binding IsNotificationRefreshing}"
|
||||||
|
RefreshColor="{StaticResource PrimaryColor}">
|
||||||
|
<Grid FlowDirection="RightToLeft">
|
||||||
|
|
||||||
|
<CollectionView ItemsSource="{Binding PageDto.Notifications}">
|
||||||
|
<CollectionView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid>
|
||||||
|
|
||||||
|
<materialFrame:MaterialFrame
|
||||||
|
Margin="10,10"
|
||||||
|
Padding="12,8"
|
||||||
|
LightThemeBackgroundColor="#f9f9f9">
|
||||||
|
<Grid ColumnDefinitions="Auto,*">
|
||||||
|
<Label
|
||||||
|
Margin="0,0,0,5"
|
||||||
|
FontFamily="{StaticResource MaterialFontFamily}"
|
||||||
|
FontSize="45"
|
||||||
|
HorizontalTextAlignment="Center"
|
||||||
|
Text="{x:Static models:MaterialIconFont.BellCircle}"
|
||||||
|
TextColor="#3498db"
|
||||||
|
VerticalOptions="Center"
|
||||||
|
VerticalTextAlignment="Center" />
|
||||||
|
<StackLayout Grid.Column="1" VerticalOptions="Center">
|
||||||
|
<Grid ColumnDefinitions="*,Auto">
|
||||||
|
<StackLayout Orientation="Horizontal">
|
||||||
|
<Label Text="{Binding Title}" TextColor="#222" />
|
||||||
|
</StackLayout>
|
||||||
|
<StackLayout
|
||||||
|
Grid.Column="1"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
VerticalOptions="Center">
|
||||||
|
<Label
|
||||||
|
FontSize="Caption"
|
||||||
|
Text="{Binding CreateAt}"
|
||||||
|
TextColor="#222" />
|
||||||
|
</StackLayout>
|
||||||
|
</Grid>
|
||||||
|
<StackLayout Orientation="Horizontal">
|
||||||
|
<Label Text="{Binding Text}" TextColor="#222" />
|
||||||
|
</StackLayout>
|
||||||
|
</StackLayout>
|
||||||
|
</Grid>
|
||||||
|
<materialFrame:MaterialFrame.GestureRecognizers>
|
||||||
|
<TapGestureRecognizer Tapped="Notification_OnTapped" />
|
||||||
|
</materialFrame:MaterialFrame.GestureRecognizers>
|
||||||
|
</materialFrame:MaterialFrame>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</CollectionView.ItemTemplate>
|
||||||
|
</CollectionView>
|
||||||
|
</Grid>
|
||||||
|
</RefreshView>
|
||||||
|
</Grid>
|
||||||
|
</views:TabViewItem>
|
||||||
|
|
||||||
|
|
||||||
|
</views:TabView>
|
||||||
|
</Grid>
|
||||||
</ContentPage>
|
</ContentPage>
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<ContentPage
|
||||||
|
x:Class="iElection.Views.TestPage"
|
||||||
|
xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
xmlns:forms="clr-namespace:MediaManager.Forms;assembly=MediaManager.Forms"
|
||||||
|
xmlns:prism="http://prismlibrary.com"
|
||||||
|
xmlns:videoPlayer="clr-namespace:Octane.Xamarin.Forms.VideoPlayer;assembly=Octane.Xamarin.Forms.VideoPlayer"
|
||||||
|
xmlns:views="http://xamarin.com/schemas/2020/toolkit"
|
||||||
|
prism:ViewModelLocator.AutowireViewModel="True">
|
||||||
|
<StackLayout>
|
||||||
|
|
||||||
|
<Frame x:Name="browserFrame" Padding="0" />
|
||||||
|
<forms:VideoView
|
||||||
|
x:Name="video"
|
||||||
|
AutoPlay="False"
|
||||||
|
HeightRequest="300"
|
||||||
|
ShowControls="True"
|
||||||
|
Source="http://94.183.8.213/api/v1/Download/ActivityClip/20"
|
||||||
|
WidthRequest="250" />
|
||||||
|
<Button Clicked="Button_OnClicked" Text="play" />
|
||||||
|
</StackLayout>
|
||||||
|
</ContentPage>
|
|
@ -0,0 +1,43 @@
|
||||||
|
using System;
|
||||||
|
using MediaManager;
|
||||||
|
using Xamarin.CommunityToolkit.Core;
|
||||||
|
using Xamarin.Essentials;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace iElection.Views
|
||||||
|
{
|
||||||
|
public partial class TestPage : ContentPage
|
||||||
|
{
|
||||||
|
public TestPage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
string htmlText = @"<video controls><source src=""http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"" type=""video/mp4""></video>";
|
||||||
|
var browser = new WebView();
|
||||||
|
browser.HeightRequest = 500;
|
||||||
|
browser.WidthRequest = 200;
|
||||||
|
var html = new HtmlWebViewSource
|
||||||
|
{
|
||||||
|
Html = htmlText
|
||||||
|
};
|
||||||
|
browser.Source = html;
|
||||||
|
browserFrame.Content = browser;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_OnClicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Permissions.RequestAsync<Permissions.StorageRead>();
|
||||||
|
Permissions.RequestAsync<Permissions.StorageWrite>();
|
||||||
|
Permissions.RequestAsync<Permissions.Media>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MediaElement_OnSeekCompleted(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MediaElement_OnMediaFailed(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -10,9 +10,8 @@
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
<Color x:Key="PrimaryColor">#182339</Color>
|
<Color x:Key="PrimaryColor">#182339</Color>
|
||||||
<Color x:Key="PrimaryDarkColor">#6044AE</Color>
|
<Color x:Key="PrimaryDarkColor">#0c1424</Color>
|
||||||
<Color x:Key="PrimaryDarkenColor">#432E7D</Color>
|
<Color x:Key="PrimaryLighterColor">#37486b</Color>
|
||||||
<Color x:Key="PrimaryLighterColor">#A98BFF</Color>
|
|
||||||
<Color x:Key="PrimaryLight">#B6C2E2</Color>
|
<Color x:Key="PrimaryLight">#B6C2E2</Color>
|
||||||
|
|
||||||
<Color x:Key="PrimaryGradient">#e83f94</Color>
|
<Color x:Key="PrimaryGradient">#e83f94</Color>
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
<PackageReference Include="Octane.Xam.VideoPlayer" Version="3.1.0" />
|
||||||
|
<PackageReference Include="Plugin.MediaManager.Forms" Version="1.0.8" />
|
||||||
<PackageReference Include="Prism.Unity.Forms" Version="8.0.0.1909" />
|
<PackageReference Include="Prism.Unity.Forms" Version="8.0.0.1909" />
|
||||||
<PackageReference Include="PropertyChanged.Fody" Version="3.3.3" />
|
<PackageReference Include="PropertyChanged.Fody" Version="3.3.3" />
|
||||||
<PackageReference Include="Refit" Version="6.0.38" />
|
<PackageReference Include="Refit" Version="6.0.38" />
|
||||||
|
@ -31,6 +33,9 @@
|
||||||
<EmbeddedResource Update="Views\AddContactPage.xaml">
|
<EmbeddedResource Update="Views\AddContactPage.xaml">
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Update="Views\Controllers\PostItemTemplate.xaml">
|
||||||
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Update="Views\LoginPage.xaml">
|
<EmbeddedResource Update="Views\LoginPage.xaml">
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
@ -52,6 +57,9 @@
|
||||||
<EmbeddedResource Update="Views\SignUpPage.xaml">
|
<EmbeddedResource Update="Views\SignUpPage.xaml">
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Update="Views\TestPage.xaml">
|
||||||
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Update="Views\Themes\BaseTheme.xaml">
|
<EmbeddedResource Update="Views\Themes\BaseTheme.xaml">
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
@ -60,10 +68,6 @@
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Views\Controllers\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Update="AppResource.Designer.cs">
|
<Compile Update="AppResource.Designer.cs">
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
|
|
Loading…
Reference in New Issue