This commit is contained in:
Ray committed 2022-09-30 18:06:31 +01:00
1 parent 17e6ca60b1
commit 9bb4888bab
15 files changed
+231 -123

No files matched your search

+1 -1
View File
@@ -25,7 +25,7 @@
</ListView.Footer>-->
<ListView.ItemsSource>
<x:Array Type="{x:Type models:FlyoutPageItem}">
<models:FlyoutPageItem Title="Home" Icon="ic_home" TargetType="{x:Type views:HomePage}" />
<models:FlyoutPageItem Title="Home" Icon="ic_home" TargetType="{x:Type views:WelcomePage}" />
<models:FlyoutPageItem Title="My Folders" Icon="ic_folder" TargetType="{x:Type views:MyFoldersPage}" />
<models:FlyoutPageItem Title="Settings" Icon="ic_settings" TargetType="{x:Type views:SettingsPage}" />
<models:FlyoutPageItem Title="About" Icon="ic_helpcircle" TargetType="{x:Type views:AboutPage}" />
-29
View File
@@ -1,29 +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:views="clr-namespace:MobileApp1.Views"
x:Class="MobileApp1.Views.HomePage"
Title="Home">
<ContentPage.Content>
<ScrollView>
<StackLayout Margin="20">
<views:CompanyHeaderView />
<Label Text="Welcome to XYZ" FontSize="Body" />
<Label x:Name="label1" Text="Hi, John." />
<Label Text="" Margin="0, 0, 0, 10" />
<Label Text="Notices" FontSize="Body" />
<Label x:Name="label2" Text="You have no notices" />
<Label Text="" Margin="0, 0, 0, 10" />
<Label Text="Messages" FontSize="Body" />
<Label x:Name="label3" Text="You have no messages" />
<Label Text="" Margin="0, 0, 0, 10" />
<Button x:Name="button1" Margin="0, 20, 0, 0" Text="Let's Get Started" Clicked="button1_Clicked" ></Button>
</StackLayout>
</ScrollView>
</ContentPage.Content>
</ContentPage>
-25
View File
@@ -1,25 +0,0 @@
using System;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace MobileApp1.Views
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class HomePage : ContentPage
{
public HomePage()
{
InitializeComponent();
}
private async void button1_Clicked(object sender, EventArgs e)
{
await Task.Run(() =>
{
ContentPageHelper.SetDetailPage(this, typeof(MyFoldersPage));
});
}
}
}
+1 -1
View File
@@ -8,7 +8,7 @@
<FlyoutPage.Detail>
<NavigationPage>
<x:Arguments>
<views:HomePage />
<views:WelcomePage />
</x:Arguments>
</NavigationPage>
</FlyoutPage.Detail>
+15 -21
View File
@@ -1,22 +1,16 @@
<?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="MobileApp1.Views.MyFoldersPage"
xmlns:views="clr-namespace:MobileApp1.Views"
Title="My Stuff">
<ContentPage.Content>
<StackLayout Margin="20">
<views:CompanyHeaderView />
<StackLayout HorizontalOptions="Fill">
<ScrollView>
<StackLayout>
<Label x:Name="label1" Text="" Margin="0, 0, 0, 20" FontSize="Body" />
</StackLayout>
</ScrollView>
</StackLayout>
</StackLayout>
</ContentPage.Content>
</ContentPage>
<TabbedPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MobileApp1.Views.MyFoldersPage"
Title="My Folders">
<ContentPage
Title="Folder 1"
IconImageSource="ic_home" />
<ContentPage
Title="Folder 2"
IconImageSource="ic_home" />
<ContentPage
Title="Folder 3"
IconImageSource="ic_home" />
</TabbedPage>
+8 -4
View File
@@ -1,16 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace MobileApp1.Views
{
public partial class MyFoldersPage : ContentPage
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class MyFoldersPage : TabbedPage
{
public MyFoldersPage()
{
InitializeComponent();
label1.Text = Guid.NewGuid().ToString();
}
}
}
+33
View File
@@ -0,0 +1,33 @@
<?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:views="clr-namespace:MobileApp1.Views"
x:Class="MobileApp1.Views.WelcomePage"
Title="Home">
<ContentPage.Content>
<ScrollView>
<StackLayout Margin="20">
<views:CompanyHeaderView />
<StackLayout x:Name="panel1" Margin="0">
<Label Text="Welcome to XYZ" FontSize="Body" />
<Label x:Name="label1" Text="Hi, John." />
<Label Text="" Margin="0, 0, 0, 10" />
<Label Text="Notices" FontSize="Body" />
<Label x:Name="label2" Text="You have no notices" />
<Label Text="" Margin="0, 0, 0, 10" />
<Label Text="Messages" FontSize="Body" />
<Label x:Name="label3" Text="You have no messages" />
<Label Text="" Margin="0, 0, 0, 10" />
<Button x:Name="button1" Margin="0, 20, 0, 0" Text="Let's Get Started" Clicked="button1_Clicked" ></Button>
</StackLayout>
<views:LoadingIndicatorView x:Name="loadingIndicatorView1" Margin="0, 20, 0, 0" />
</StackLayout>
</ScrollView>
</ContentPage.Content>
</ContentPage>
+101
View File
@@ -0,0 +1,101 @@
using System;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace MobileApp1.Views
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class WelcomePage : ContentPage
{
protected bool isBusy = false;
public WelcomePage()
{
InitializeComponent();
}
protected override void OnAppearing()
{
base.OnAppearing();
LoadPage();
}
private bool IsBusy
{
get => isBusy;
set
{
isBusy = value;
//LoginPage cp = (LoginPage)ContentViewHelper.GetParentElement<LoginPage>(this);
//if (cp != null)
//{
// cp.IsBusy = value;
//}
Device.BeginInvokeOnMainThread(() =>
{
loadingIndicatorView1.IsRunning = value;
panel1.IsVisible = !value;
});
}
}
private async void button1_Clicked(object sender, EventArgs e)
{
await Task.Run(() =>
{
ContentPageHelper.SetDetailPage(this, typeof(MyFoldersPage));
});
}
private async void LoadPage()
{
await Task.Run(() =>
{
if (this.Parent == null)
{
return;
}
App ap = ContentPageHelper.GetApp(this);
if (ap == null)
{
return;
}
IsBusy = true;
WelcomePackResult result = ap.CorporationService.RetrieveWelcomePack();
loadingIndicatorView1.Message = result.Message;
IsBusy = false;
//ContentViewHelper.SetMainPage(this, new AppShell());
//await cp.DisplayAlert("Clicked", "Login", "OK");
if (result.IsSuccess)
{
Device.BeginInvokeOnMainThread(() =>
{
label1.Text = string.Format("Hi, {0}.", ap.CorporationService.DisplayName);
label2.Text = string.Format("You have {0} notice{1}", ((result.NoticesCount <= 0) ? "no": result.NoticesCount.ToString()), ((result.NoticesCount == 1) ? "" : "s"));
label3.Text = string.Format("You have {0} message{1}", ((result.MessagesCount <= 0) ? "no": result.MessagesCount.ToString()), ((result.MessagesCount == 1) ? "" : "s"));
});
}
});
}
}
}