Initial commit
5
.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
/.vs
|
||||||
|
/MobileApp1/bin
|
||||||
|
/MobileApp1/obj
|
||||||
|
/MobileApp1.Android/bin
|
||||||
|
/MobileApp1.Android/obj
|
19
MobileApp1.Android/Assets/AboutAssets.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Any raw assets you want to be deployed with your application can be placed in
|
||||||
|
this directory (and child directories) and given a Build Action of "AndroidAsset".
|
||||||
|
|
||||||
|
These files will be deployed with your package and will be accessible using Android's
|
||||||
|
AssetManager, like this:
|
||||||
|
|
||||||
|
public class ReadAsset : Activity
|
||||||
|
{
|
||||||
|
protected override void OnCreate (Bundle bundle)
|
||||||
|
{
|
||||||
|
base.OnCreate (bundle);
|
||||||
|
|
||||||
|
InputStream input = Assets.Open ("my_asset.txt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Additionally, some Android functions will automatically load asset files:
|
||||||
|
|
||||||
|
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
|
31
MobileApp1.Android/MainActivity.cs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
using Android.App;
|
||||||
|
using Android.Content.PM;
|
||||||
|
using Android.OS;
|
||||||
|
using Android.Runtime;
|
||||||
|
|
||||||
|
namespace MobileApp1.Droid
|
||||||
|
{
|
||||||
|
[Activity(Label = "MobileApp1", Icon = "@mipmap/icon", Theme = "@style/MainTheme.Splash", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )]
|
||||||
|
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
||||||
|
{
|
||||||
|
protected override void OnCreate(Bundle savedInstanceState)
|
||||||
|
{
|
||||||
|
SetTheme(Resource.Style.MainTheme);
|
||||||
|
|
||||||
|
base.OnCreate(savedInstanceState);
|
||||||
|
|
||||||
|
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
|
||||||
|
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
|
||||||
|
|
||||||
|
LoadApplication(new App());
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
|
||||||
|
{
|
||||||
|
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
|
|
||||||
|
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
102
MobileApp1.Android/MobileApp1.Android.csproj
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{9CBD2897-B626-4DCC-A1F9-67FE20A25514}</ProjectGuid>
|
||||||
|
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<TemplateGuid>{6968b3a4-1835-46a3-ac5c-1ae33b475983}</TemplateGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<RootNamespace>MobileApp1.Droid</RootNamespace>
|
||||||
|
<AssemblyName>MobileApp1.Android</AssemblyName>
|
||||||
|
<Deterministic>True</Deterministic>
|
||||||
|
<AndroidApplication>True</AndroidApplication>
|
||||||
|
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
||||||
|
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||||
|
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||||
|
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||||
|
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||||
|
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
|
||||||
|
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
|
||||||
|
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
|
||||||
|
<AndroidUseAapt2>true</AndroidUseAapt2>
|
||||||
|
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
|
||||||
|
<NuGetPackageImportStamp>
|
||||||
|
</NuGetPackageImportStamp>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>portable</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<AndroidLinkMode>None</AndroidLinkMode>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>portable</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release</OutputPath>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<AndroidManagedSymbols>true</AndroidManagedSymbols>
|
||||||
|
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Mono.Android" />
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Numerics" />
|
||||||
|
<Reference Include="System.Numerics.Vectors" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
|
||||||
|
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="MainActivity.cs" />
|
||||||
|
<Compile Include="Resources\Resource.designer.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Resources\AboutResources.txt" />
|
||||||
|
<None Include="Assets\AboutAssets.txt" />
|
||||||
|
<None Include="Properties\AndroidManifest.xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<AndroidResource Include="Resources\drawable\splash_logo.png" />
|
||||||
|
<AndroidResource Include="Resources\values\styles.xml" />
|
||||||
|
<AndroidResource Include="Resources\values\colors.xml" />
|
||||||
|
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon.xml" />
|
||||||
|
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon_round.xml" />
|
||||||
|
<AndroidResource Include="Resources\mipmap-hdpi\icon.png" />
|
||||||
|
<AndroidResource Include="Resources\mipmap-hdpi\launcher_foreground.png" />
|
||||||
|
<AndroidResource Include="Resources\mipmap-mdpi\icon.png" />
|
||||||
|
<AndroidResource Include="Resources\mipmap-mdpi\launcher_foreground.png" />
|
||||||
|
<AndroidResource Include="Resources\mipmap-xhdpi\icon.png" />
|
||||||
|
<AndroidResource Include="Resources\mipmap-xhdpi\launcher_foreground.png" />
|
||||||
|
<AndroidResource Include="Resources\mipmap-xxhdpi\icon.png" />
|
||||||
|
<AndroidResource Include="Resources\mipmap-xxhdpi\launcher_foreground.png" />
|
||||||
|
<AndroidResource Include="Resources\mipmap-xxxhdpi\icon.png" />
|
||||||
|
<AndroidResource Include="Resources\mipmap-xxxhdpi\launcher_foreground.png" />
|
||||||
|
<AndroidResource Include="Resources\drawable\icon_about.png" />
|
||||||
|
<AndroidResource Include="Resources\drawable\icon_feed.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\MobileApp1\MobileApp1.csproj">
|
||||||
|
<Project>{0ABAE853-DFE0-405E-B6B1-FBE0ECC5FC98}</Project>
|
||||||
|
<Name>MobileApp1</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<AndroidResource Include="Resources\drawable\company_logo.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<AndroidResource Include="Resources\drawable\splash_screen.xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||||
|
</Project>
|
10
MobileApp1.Android/MobileApp1.Android.csproj.user
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<SelectedDevice>pixel_3_r_11_0_-_api_30</SelectedDevice>
|
||||||
|
<ActiveDebugProfile>pixel_3_r_11_0_-_api_30</ActiveDebugProfile>
|
||||||
|
<DefaultDevice>pixel_3_r_11_0_-_api_30</DefaultDevice>
|
||||||
|
<ProjectView>ProjectFiles</ProjectView>
|
||||||
|
<AndroidDesignerPreferredTheme>MainTheme</AndroidDesignerPreferredTheme>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
6
MobileApp1.Android/Properties/AndroidManifest.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.mobileapp1">
|
||||||
|
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
|
||||||
|
<application android:label="MobileApp1.Android" android:theme="@style/MainTheme"></application>
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
</manifest>
|
30
MobileApp1.Android/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using Android.App;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("MobileApp1.Android")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("MobileApp1.Android")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
|
|
||||||
|
// Add some common permissions, these can be removed if not needed
|
||||||
|
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
|
||||||
|
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
|
50
MobileApp1.Android/Resources/AboutResources.txt
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
Images, layout descriptions, binary blobs and string dictionaries can be included
|
||||||
|
in your application as resource files. Various Android APIs are designed to
|
||||||
|
operate on the resource IDs instead of dealing with images, strings or binary blobs
|
||||||
|
directly.
|
||||||
|
|
||||||
|
For example, a sample Android app that contains a user interface layout (main.xml),
|
||||||
|
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
|
||||||
|
would keep its resources in the "Resources" directory of the application:
|
||||||
|
|
||||||
|
Resources/
|
||||||
|
drawable-hdpi/
|
||||||
|
icon.png
|
||||||
|
|
||||||
|
drawable-ldpi/
|
||||||
|
icon.png
|
||||||
|
|
||||||
|
drawable-mdpi/
|
||||||
|
icon.png
|
||||||
|
|
||||||
|
layout/
|
||||||
|
main.xml
|
||||||
|
|
||||||
|
values/
|
||||||
|
strings.xml
|
||||||
|
|
||||||
|
In order to get the build system to recognize Android resources, set the build action to
|
||||||
|
"AndroidResource". The native Android APIs do not operate directly with filenames, but
|
||||||
|
instead operate on resource IDs. When you compile an Android application that uses resources,
|
||||||
|
the build system will package the resources for distribution and generate a class called
|
||||||
|
"Resource" that contains the tokens for each one of the resources included. For example,
|
||||||
|
for the above Resources layout, this is what the Resource class would expose:
|
||||||
|
|
||||||
|
public class Resource {
|
||||||
|
public class drawable {
|
||||||
|
public const int icon = 0x123;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class layout {
|
||||||
|
public const int main = 0x456;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class strings {
|
||||||
|
public const int first_string = 0xabc;
|
||||||
|
public const int second_string = 0xbcd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
|
||||||
|
to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
|
||||||
|
string in the dictionary file values/strings.xml.
|
19534
MobileApp1.Android/Resources/Resource.designer.cs
generated
Normal file
BIN
MobileApp1.Android/Resources/drawable/company_logo.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
MobileApp1.Android/Resources/drawable/icon_about.png
Normal file
After Width: | Height: | Size: 518 B |
BIN
MobileApp1.Android/Resources/drawable/icon_feed.png
Normal file
After Width: | Height: | Size: 415 B |
BIN
MobileApp1.Android/Resources/drawable/splash_logo.png
Normal file
After Width: | Height: | Size: 12 KiB |
9
MobileApp1.Android/Resources/drawable/splash_screen.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<color android:color="@android:color/white"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<bitmap android:src="@drawable/splash_logo" android:tileMode="disabled" android:gravity="center" android:layout_gravity="center" />
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
5
MobileApp1.Android/Resources/mipmap-anydpi-v26/icon.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@color/launcher_background" />
|
||||||
|
<foreground android:drawable="@mipmap/launcher_foreground" />
|
||||||
|
</adaptive-icon>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@color/launcher_background" />
|
||||||
|
<foreground android:drawable="@mipmap/launcher_foreground" />
|
||||||
|
</adaptive-icon>
|
BIN
MobileApp1.Android/Resources/mipmap-hdpi/icon.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
MobileApp1.Android/Resources/mipmap-hdpi/launcher_foreground.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
MobileApp1.Android/Resources/mipmap-mdpi/icon.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
MobileApp1.Android/Resources/mipmap-mdpi/launcher_foreground.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
MobileApp1.Android/Resources/mipmap-xhdpi/icon.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 3.4 KiB |
BIN
MobileApp1.Android/Resources/mipmap-xxhdpi/icon.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 5.4 KiB |
BIN
MobileApp1.Android/Resources/mipmap-xxxhdpi/icon.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 7.7 KiB |
7
MobileApp1.Android/Resources/values/colors.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="launcher_background">#FFFFFF</color>
|
||||||
|
<color name="colorPrimary">#3F51B5</color>
|
||||||
|
<color name="colorPrimaryDark">#303F9F</color>
|
||||||
|
<color name="colorAccent">#FF4081</color>
|
||||||
|
</resources>
|
12
MobileApp1.Android/Resources/values/styles.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<resources>
|
||||||
|
<style name="MainTheme.Base" parent="Theme.AppCompat.Light"></style>
|
||||||
|
<style name="MainTheme" parent="MainTheme.Base"></style>
|
||||||
|
<style name="MainTheme.Splash" parent ="Theme.AppCompat.Light.NoActionBar">
|
||||||
|
<item name="android:windowBackground">@drawable/splash_screen</item>
|
||||||
|
<item name="android:windowNoTitle">true</item>
|
||||||
|
<item name="android:windowFullscreen">true</item>
|
||||||
|
<item name="android:windowContentOverlay">@null</item>
|
||||||
|
<item name="android:windowActionBar">true</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
63
MobileApp1.sln
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 16
|
||||||
|
VisualStudioVersion = 16.0.31321.278
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MobileApp1.Android", "MobileApp1.Android\MobileApp1.Android.csproj", "{9CBD2897-B626-4DCC-A1F9-67FE20A25514}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MobileApp1", "MobileApp1\MobileApp1.csproj", "{91032C48-9E9B-49CE-8D52-6A41B28E29F1}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Debug|iPhone = Debug|iPhone
|
||||||
|
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
Release|iPhone = Release|iPhone
|
||||||
|
Release|iPhoneSimulator = Release|iPhoneSimulator
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Debug|iPhone.Deploy.0 = Debug|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Release|iPhone.Build.0 = Release|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Release|iPhone.Deploy.0 = Release|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||||
|
{9CBD2897-B626-4DCC-A1F9-67FE20A25514}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Debug|iPhone.Deploy.0 = Debug|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Release|iPhone.Build.0 = Release|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Release|iPhone.Deploy.0 = Release|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||||
|
{91032C48-9E9B-49CE-8D52-6A41B28E29F1}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {D9B7D97A-1D39-4519-9B53-5B22BC38F065}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
59
MobileApp1/App.xaml
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<Application xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
x:Class="MobileApp1.App">
|
||||||
|
<Application.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<Color x:Key="Primary">#4865A9</Color>
|
||||||
|
<Color x:Key="Info">#47A5DE</Color>
|
||||||
|
<Color x:Key="Secondary">#5576C3</Color>
|
||||||
|
<Color x:Key="Danger">#F33C0C</Color>
|
||||||
|
<Color x:Key="Warning">#F3B70C</Color>
|
||||||
|
<Color x:Key="Muted">#B6B6B6</Color>
|
||||||
|
<Color x:Key="Light">#B6B6B6</Color>
|
||||||
|
<Color x:Key="White">#FFFFFF</Color>
|
||||||
|
<!-- -->
|
||||||
|
<Style TargetType="ActivityIndicator">
|
||||||
|
<Setter Property="Color" Value="{StaticResource Info}"></Setter>
|
||||||
|
<Setter Property="HorizontalOptions" Value="Center"></Setter>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="Button">
|
||||||
|
<Setter Property="HorizontalOptions" Value="Fill"></Setter>
|
||||||
|
<Setter Property="TextColor" Value="{StaticResource White}"></Setter>
|
||||||
|
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||||
|
<VisualStateGroupList>
|
||||||
|
<VisualStateGroup x:Name="CommonStates">
|
||||||
|
<VisualState x:Name="Normal">
|
||||||
|
<VisualState.Setters>
|
||||||
|
<Setter Property="BackgroundColor" Value="{StaticResource Primary}" />
|
||||||
|
</VisualState.Setters>
|
||||||
|
</VisualState>
|
||||||
|
<VisualState x:Name="Disabled">
|
||||||
|
<VisualState.Setters>
|
||||||
|
<Setter Property="BackgroundColor" Value="{StaticResource Muted}" />
|
||||||
|
</VisualState.Setters>
|
||||||
|
</VisualState>
|
||||||
|
<VisualState x:Name="Pressed">
|
||||||
|
<VisualState.Setters>
|
||||||
|
<Setter Property="BackgroundColor" Value="{StaticResource Secondary}" />
|
||||||
|
</VisualState.Setters>
|
||||||
|
</VisualState>
|
||||||
|
</VisualStateGroup>
|
||||||
|
</VisualStateGroupList>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="CarouselView">
|
||||||
|
<Setter Property="IsBounceEnabled" Value="False"></Setter>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="Entry">
|
||||||
|
<Setter Property="HorizontalOptions" Value="Fill"></Setter>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="IndicatorView">
|
||||||
|
<Setter Property="HorizontalOptions" Value="Center"></Setter>
|
||||||
|
<Setter Property="IndicatorColor" Value="{StaticResource Muted}"></Setter>
|
||||||
|
<Setter Property="MaximumVisible" Value="6"></Setter>
|
||||||
|
<Setter Property="SelectedIndicatorColor" Value="{StaticResource Secondary}"></Setter>
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</Application.Resources>
|
||||||
|
</Application>
|
47
MobileApp1/App.xaml.cs
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
using MobileApp1.Services;
|
||||||
|
using MobileApp1.Views;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace MobileApp1
|
||||||
|
{
|
||||||
|
public partial class App : Application
|
||||||
|
{
|
||||||
|
private ICorporationService corporationService = null;
|
||||||
|
|
||||||
|
|
||||||
|
public App()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
//DependencyService.Register<MockDataStore>();
|
||||||
|
|
||||||
|
//MainPage = new AppShell();
|
||||||
|
|
||||||
|
MainPage = new NavigationPage(new LoginPage());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnStart()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnSleep()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnResume()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ICorporationService CorporationService
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (corporationService == null) corporationService = new CorporationMockService();
|
||||||
|
|
||||||
|
return corporationService;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
3
MobileApp1/AssemblyInfo.cs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
using Xamarin.Forms.Xaml;
|
||||||
|
|
||||||
|
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
|
9
MobileApp1/Classes/ServiceResult.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
namespace MobileApp1
|
||||||
|
{
|
||||||
|
public class ServiceResult
|
||||||
|
{
|
||||||
|
public bool IsSuccess { get; set; }
|
||||||
|
public string Message { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
74
MobileApp1/Helpers/ContentPageHelper.cs
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace MobileApp1.Views
|
||||||
|
{
|
||||||
|
public class ContentPageHelper
|
||||||
|
{
|
||||||
|
|
||||||
|
public static App GetApp(ContentPage view)
|
||||||
|
{
|
||||||
|
if (view == null) return null;
|
||||||
|
|
||||||
|
Element item = view.Parent;
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
if (item == null) break;
|
||||||
|
if (item is App) break;
|
||||||
|
|
||||||
|
item = item.Parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (item as App);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Application GetApplication(ContentPage view)
|
||||||
|
{
|
||||||
|
if (view == null) return null;
|
||||||
|
|
||||||
|
Element item = view.Parent;
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
if (item == null) break;
|
||||||
|
if (item is Application) break;
|
||||||
|
|
||||||
|
item = item.Parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (item as Application);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetMainPage(ContentPage view, Page page)
|
||||||
|
{
|
||||||
|
if (view == null) return;
|
||||||
|
if (view.Parent == null) return;
|
||||||
|
if (page == null) return;
|
||||||
|
|
||||||
|
Application rs = GetApplication(view);
|
||||||
|
if (rs == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//rs.MainPage = new NavigationPage(new PasswordResetPage());
|
||||||
|
rs.MainPage = page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async void PushMainPageNavigation(ContentPage view, Page page)
|
||||||
|
{
|
||||||
|
if (view == null) return;
|
||||||
|
if (view.Parent == null) return;
|
||||||
|
if (page == null) return;
|
||||||
|
|
||||||
|
Application rs = GetApplication(view);
|
||||||
|
if (rs == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await rs?.MainPage.Navigation.PushAsync(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
119
MobileApp1/Helpers/ContentViewHelper.cs
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
using System;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace MobileApp1.Views
|
||||||
|
{
|
||||||
|
public class ContentViewHelper
|
||||||
|
{
|
||||||
|
|
||||||
|
public static ContentPage GetContentPage(ContentView view)
|
||||||
|
{
|
||||||
|
if (view == null) return null;
|
||||||
|
|
||||||
|
Element item = view.Parent;
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
if (item == null) break;
|
||||||
|
if (item is ContentPage) break;
|
||||||
|
|
||||||
|
item = item.Parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (item as ContentPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static T GetContentPage<T>(ContentView view)
|
||||||
|
{
|
||||||
|
if (view == null) return default(T);
|
||||||
|
|
||||||
|
Element item = view.Parent;
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
if (item == null) break;
|
||||||
|
if (item is T) break;
|
||||||
|
|
||||||
|
item = item.Parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return (T)Convert.ChangeType(item, typeof(T));
|
||||||
|
}
|
||||||
|
catch (InvalidCastException)
|
||||||
|
{
|
||||||
|
return default(T);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static App GetApp(ContentView view)
|
||||||
|
{
|
||||||
|
if (view == null) return null;
|
||||||
|
|
||||||
|
Element item = view.Parent;
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
if (item == null) break;
|
||||||
|
if (item is App) break;
|
||||||
|
|
||||||
|
item = item.Parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (item as App);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Application GetApplication(ContentView view)
|
||||||
|
{
|
||||||
|
if (view == null) return null;
|
||||||
|
|
||||||
|
Element item = view.Parent;
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
if (item == null) break;
|
||||||
|
if (item is Application) break;
|
||||||
|
|
||||||
|
item = item.Parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (item as Application);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetMainPage(ContentView view, Page page)
|
||||||
|
{
|
||||||
|
if (view == null) return;
|
||||||
|
if (view.Parent == null) return;
|
||||||
|
if (page == null) return;
|
||||||
|
|
||||||
|
Application rs = GetApplication(view);
|
||||||
|
if (rs == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Device.BeginInvokeOnMainThread(() =>
|
||||||
|
{
|
||||||
|
//rs.MainPage = new NavigationPage(new PasswordResetPage());
|
||||||
|
rs.MainPage = page;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async void PushMainPageNavigation(ContentView view, Page page)
|
||||||
|
{
|
||||||
|
if (view == null) return;
|
||||||
|
if (view.Parent == null) return;
|
||||||
|
if (page == null) return;
|
||||||
|
|
||||||
|
Application rs = GetApplication(view);
|
||||||
|
if (rs == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await rs?.MainPage.Navigation.PushAsync(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
64
MobileApp1/MobileApp1.csproj
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
|
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="AppShell.xaml.cs" />
|
||||||
|
<Compile Remove="Helpers\ThreadHelper.cs" />
|
||||||
|
<Compile Remove="Services\IDataStore.cs" />
|
||||||
|
<Compile Remove="Services\MockDataStore.cs" />
|
||||||
|
<Compile Remove="Views\ItemDetailPage.xaml.cs" />
|
||||||
|
<Compile Remove="Views\ItemsPage.xaml.cs" />
|
||||||
|
<Compile Remove="Views\LoginPage1.xaml.cs" />
|
||||||
|
<Compile Remove="Views\NewItemPage.xaml.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Remove="AppShell.xaml" />
|
||||||
|
<EmbeddedResource Remove="Views\ItemDetailPage.xaml" />
|
||||||
|
<EmbeddedResource Remove="Views\ItemsPage.xaml" />
|
||||||
|
<EmbeddedResource Remove="Views\LoginPage1.xaml" />
|
||||||
|
<EmbeddedResource Remove="Views\NewItemPage.xaml" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
|
||||||
|
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Update="Views\Content\LoadingIndicatorView.xaml.cs">
|
||||||
|
<DependentUpon>LoadingIndicatorView.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Update="Views\Content\CompanyHeaderView.xaml.cs">
|
||||||
|
<DependentUpon>CompanyHeaderView.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Update="Views\PasswordResetPage.xaml.cs">
|
||||||
|
<DependentUpon>PasswordResetPage.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Update="Views\Content\Login\AboutView.xaml.cs">
|
||||||
|
<DependentUpon>AboutView.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Update="Views\Content\Login\PasswordResetView.xaml.cs">
|
||||||
|
<DependentUpon>PasswordResetView.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Update="Views\LoginPage.xaml.cs">
|
||||||
|
<DependentUpon>LoginPage.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Update="Views\Content\Login\LoginView.xaml.cs">
|
||||||
|
<DependentUpon>LoginView.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Update="Views\LoginPage.xaml">
|
||||||
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Update="Views\Content\Login\LoginView.xaml">
|
||||||
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
6
MobileApp1/MobileApp1.csproj.user
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ShowAllFiles>false</ShowAllFiles>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
61
MobileApp1/Services/CorporationMockService.cs
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
namespace MobileApp1.Services
|
||||||
|
{
|
||||||
|
public class CorporationMockService : ICorporationService
|
||||||
|
{
|
||||||
|
public CorporationMockService()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public string DisplayName { get; set; } = "";
|
||||||
|
|
||||||
|
public bool IsLoggedIn { get; set; } = false;
|
||||||
|
|
||||||
|
public string AuthToken { get; set; } = "";
|
||||||
|
|
||||||
|
|
||||||
|
public ServiceResult Login(string username, string password)
|
||||||
|
{
|
||||||
|
System.Threading.Thread.Sleep(6000);
|
||||||
|
|
||||||
|
this.DisplayName = username;
|
||||||
|
this.IsLoggedIn = true;
|
||||||
|
|
||||||
|
return new ServiceResult()
|
||||||
|
{
|
||||||
|
IsSuccess = true,
|
||||||
|
Message = "Logged In"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public ServiceResult Logout()
|
||||||
|
{
|
||||||
|
System.Threading.Thread.Sleep(6000);
|
||||||
|
|
||||||
|
this.DisplayName = string.Empty;
|
||||||
|
this.IsLoggedIn = false;
|
||||||
|
|
||||||
|
return new ServiceResult()
|
||||||
|
{
|
||||||
|
IsSuccess = true,
|
||||||
|
Message = "Logged Out"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public ServiceResult RequestPasswordReset(string username)
|
||||||
|
{
|
||||||
|
System.Threading.Thread.Sleep(6000);
|
||||||
|
|
||||||
|
this.DisplayName = string.Empty;
|
||||||
|
this.IsLoggedIn = false;
|
||||||
|
|
||||||
|
return new ServiceResult()
|
||||||
|
{
|
||||||
|
IsSuccess = true,
|
||||||
|
Message = "Password Reset Requested"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
55
MobileApp1/Services/CorporationService.cs
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
namespace MobileApp1.Services
|
||||||
|
{
|
||||||
|
public class CorporationService : ICorporationService
|
||||||
|
{
|
||||||
|
public CorporationService()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public string DisplayName { get; set; } = "";
|
||||||
|
|
||||||
|
public bool IsLoggedIn { get; set; } = false;
|
||||||
|
|
||||||
|
public string AuthToken { get; set; } = "";
|
||||||
|
|
||||||
|
|
||||||
|
public ServiceResult Login(string username, string password)
|
||||||
|
{
|
||||||
|
this.DisplayName = username;
|
||||||
|
this.IsLoggedIn = true;
|
||||||
|
|
||||||
|
return new ServiceResult()
|
||||||
|
{
|
||||||
|
IsSuccess = true,
|
||||||
|
Message = "Logged In"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public ServiceResult Logout()
|
||||||
|
{
|
||||||
|
this.DisplayName = string.Empty;
|
||||||
|
this.IsLoggedIn = false;
|
||||||
|
|
||||||
|
return new ServiceResult()
|
||||||
|
{
|
||||||
|
IsSuccess = true,
|
||||||
|
Message = "Logged Out"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public ServiceResult RequestPasswordReset(string username)
|
||||||
|
{
|
||||||
|
this.DisplayName = string.Empty;
|
||||||
|
this.IsLoggedIn = false;
|
||||||
|
|
||||||
|
return new ServiceResult()
|
||||||
|
{
|
||||||
|
IsSuccess = true,
|
||||||
|
Message = "Password Reset Requested"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
19
MobileApp1/Services/ICorporationService.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
namespace MobileApp1.Services
|
||||||
|
{
|
||||||
|
public interface ICorporationService
|
||||||
|
{
|
||||||
|
string DisplayName { get; set; }
|
||||||
|
|
||||||
|
bool IsLoggedIn { get; set; }
|
||||||
|
|
||||||
|
string AuthToken { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
ServiceResult Login(string username, string password);
|
||||||
|
|
||||||
|
ServiceResult Logout();
|
||||||
|
|
||||||
|
ServiceResult RequestPasswordReset(string username);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
15
MobileApp1/Views/Content/CompanyHeaderView.xaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
x:Class="MobileApp1.Views.CompanyHeaderView">
|
||||||
|
<ContentView.Content>
|
||||||
|
<!--<Label
|
||||||
|
Text="XYZ Corporation"
|
||||||
|
FontAttributes="Bold"
|
||||||
|
FontSize="Large"
|
||||||
|
HorizontalOptions="Center"
|
||||||
|
Padding="0, 40, 0, 40" />-->
|
||||||
|
<Image Source="company_logo.png" WidthRequest="{OnPlatform iOS=240, Android=240}" HorizontalOptions="Center" Margin="0, 20, 0, 40" />
|
||||||
|
|
||||||
|
</ContentView.Content>
|
||||||
|
</ContentView>
|
16
MobileApp1/Views/Content/CompanyHeaderView.xaml.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
using Xamarin.Forms.Xaml;
|
||||||
|
|
||||||
|
namespace MobileApp1.Views
|
||||||
|
{
|
||||||
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||||
|
public partial class CompanyHeaderView : ContentView
|
||||||
|
{
|
||||||
|
public CompanyHeaderView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
11
MobileApp1/Views/Content/LoadingIndicatorView.xaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
x:Class="MobileApp1.Views.LoadingIndicatorView">
|
||||||
|
<ContentView.Content>
|
||||||
|
<StackLayout>
|
||||||
|
<ActivityIndicator x:Name="activityIndicator1" Margin="0, 0, 0, 0" />
|
||||||
|
<Label x:Name="label1" Text="" HorizontalTextAlignment="Center" Margin="0, 10, 0, 0" TextColor="{StaticResource Danger}" />
|
||||||
|
</StackLayout>
|
||||||
|
</ContentView.Content>
|
||||||
|
</ContentView>
|
47
MobileApp1/Views/Content/LoadingIndicatorView.xaml.cs
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
using Xamarin.Forms;
|
||||||
|
using Xamarin.Forms.Xaml;
|
||||||
|
|
||||||
|
namespace MobileApp1.Views
|
||||||
|
{
|
||||||
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||||
|
public partial class LoadingIndicatorView : ContentView
|
||||||
|
{
|
||||||
|
public LoadingIndicatorView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public string Message
|
||||||
|
{
|
||||||
|
get => label1.Text;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
Device.BeginInvokeOnMainThread(() =>
|
||||||
|
{
|
||||||
|
label1.Text = value;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsRunning
|
||||||
|
{
|
||||||
|
get => activityIndicator1.IsRunning;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
Device.BeginInvokeOnMainThread(() =>
|
||||||
|
{
|
||||||
|
activityIndicator1.IsVisible = value;
|
||||||
|
activityIndicator1.IsRunning = value;
|
||||||
|
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
label1.Text = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
27
MobileApp1/Views/Content/Login/AboutView.xaml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
x:Class="MobileApp1.Views.AboutView">
|
||||||
|
<ContentView.Content>
|
||||||
|
<StackLayout HorizontalOptions="Fill">
|
||||||
|
<ScrollView>
|
||||||
|
<StackLayout>
|
||||||
|
<Label Text="More information about stuff." Margin="0, 0, 0, 20" FontSize="Body" />
|
||||||
|
|
||||||
|
<Label Text="This app" FontSize="Body" />
|
||||||
|
<Label Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam." />
|
||||||
|
<Label Text="" Margin="0, 0, 0, 10" x:Name="label1" />
|
||||||
|
|
||||||
|
<Label Text="This corporation" FontSize="Body" />
|
||||||
|
<Label Text="Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero." Margin="0, 0, 0, 10" />
|
||||||
|
|
||||||
|
<Label Text="Legal stuff" FontSize="Body" />
|
||||||
|
<Label Text="Sed dignissim lacinia nunc. Curabitur tortor. Pellentesque nibh. Aenean quam. In scelerisque sem at dolor. Maecenas mattis. Sed convallis tristique sem. Proin ut ligula vel nunc egestas porttitor. Morbi lectus risus, iaculis vel, suscipit quis, luctus non, massa. Fusce ac turpis quis ligula lacinia aliquet. Mauris ipsum. Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos." />
|
||||||
|
<Label Text="Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. Suspendisse in justo eu magna luctus suscipit. Sed lectus." />
|
||||||
|
<Label Text="Integer euismod lacus luctus magna. Quisque cursus, metus vitae pharetra auctor, sem massa mattis sem, at interdum magna augue eget diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Morbi lacinia molestie dui. Praesent blandit dolor. Sed non quam. In vel mi sit amet augue congue elementum. Morbi in ipsum sit amet pede facilisis laoreet. Donec lacus nunc, viverra nec, blandit vel, egestas et, augue. Vestibulum tincidunt malesuada tellus. Ut ultrices ultrices enim. Curabitur sit amet mauris. Morbi in dui quis est pulvinar ullamcorper." Margin="0, 0, 0, 10" />
|
||||||
|
|
||||||
|
</StackLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</StackLayout>
|
||||||
|
</ContentView.Content>
|
||||||
|
</ContentView>
|
18
MobileApp1/Views/Content/Login/AboutView.xaml.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
using Xamarin.Forms.Xaml;
|
||||||
|
|
||||||
|
namespace MobileApp1.Views
|
||||||
|
{
|
||||||
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||||
|
public partial class AboutView : ContentView
|
||||||
|
{
|
||||||
|
public AboutView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
label1.Text = "Version " + Assembly.GetAssembly(typeof(App))?.GetName()?.Version.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
24
MobileApp1/Views/Content/Login/LoginView.xaml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ContentView 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.LoginView">
|
||||||
|
<ContentView.Content>
|
||||||
|
<StackLayout HorizontalOptions="Fill">
|
||||||
|
<ScrollView>
|
||||||
|
<StackLayout>
|
||||||
|
<Label Text="Welcome to XYZ. Log in to your account." Margin="0, 0, 0, 20" FontSize="Body" />
|
||||||
|
|
||||||
|
<Label Text="Enter your User ID" />
|
||||||
|
<Entry x:Name="textbox1" IsSpellCheckEnabled="False" IsTextPredictionEnabled="False" MaxLength="128"></Entry>
|
||||||
|
<Label Text="Enter your Password" />
|
||||||
|
<Entry x:Name="textbox2" IsSpellCheckEnabled="False" IsTextPredictionEnabled="False" MaxLength="32" IsPassword="True"></Entry>
|
||||||
|
<Button x:Name="button1" Margin="0, 20, 0, 0" Text="Log In To My Account" Clicked="button1_Clicked"></Button>
|
||||||
|
|
||||||
|
<views:LoadingIndicatorView x:Name="loadingIndicatorView1" Margin="0, 20, 0, 0" />
|
||||||
|
|
||||||
|
</StackLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</StackLayout>
|
||||||
|
</ContentView.Content>
|
||||||
|
</ContentView>
|
86
MobileApp1/Views/Content/Login/LoginView.xaml.cs
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
using MobileApp1.Services;
|
||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
using Xamarin.Forms.Xaml;
|
||||||
|
|
||||||
|
namespace MobileApp1.Views
|
||||||
|
{
|
||||||
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||||
|
public partial class LoginView : ContentView
|
||||||
|
{
|
||||||
|
protected bool isBusy = false;
|
||||||
|
|
||||||
|
|
||||||
|
public LoginView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool IsBusy
|
||||||
|
{
|
||||||
|
get => isBusy;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
isBusy = value;
|
||||||
|
|
||||||
|
LoginPage cp = ContentViewHelper.GetContentPage<LoginPage>(this);
|
||||||
|
if (cp != null)
|
||||||
|
{
|
||||||
|
cp.IsBusy = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
Device.BeginInvokeOnMainThread(() =>
|
||||||
|
{
|
||||||
|
loadingIndicatorView1.IsRunning = value;
|
||||||
|
textbox1.IsEnabled = textbox2.IsEnabled = !value;
|
||||||
|
button1.IsEnabled = !value;
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void button1_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
await Task.Run(() =>
|
||||||
|
{
|
||||||
|
if (this.Parent == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ContentPage cp = ContentViewHelper.GetContentPage(this);
|
||||||
|
if (cp == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
App ap = ContentViewHelper.GetApp(this);
|
||||||
|
if (ap == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.IsBusy = true;
|
||||||
|
|
||||||
|
ServiceResult result = ap.CorporationService.Login(textbox1.Text, textbox2.Text);
|
||||||
|
|
||||||
|
loadingIndicatorView1.Message = result.Message;
|
||||||
|
|
||||||
|
this.IsBusy = false;
|
||||||
|
|
||||||
|
//ContentViewHelper.SetMainPage(this, new AppShell());
|
||||||
|
|
||||||
|
//await cp.DisplayAlert("Clicked", "Login", "OK");
|
||||||
|
|
||||||
|
|
||||||
|
if (result.IsSuccess)
|
||||||
|
{
|
||||||
|
//SetErrorMessage(string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
22
MobileApp1/Views/Content/Login/PasswordResetView.xaml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ContentView 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.PasswordResetView">
|
||||||
|
<ContentView.Content>
|
||||||
|
<StackLayout HorizontalOptions="Fill">
|
||||||
|
<ScrollView>
|
||||||
|
<StackLayout>
|
||||||
|
<Label Text="Forgotten your password? Reset your account." Margin="0, 0, 0, 20" FontSize="Body" />
|
||||||
|
|
||||||
|
<Label Text="Enter your User ID" />
|
||||||
|
<Entry x:Name="textbox1" IsSpellCheckEnabled="False" IsTextPredictionEnabled="False" MaxLength="128"></Entry>
|
||||||
|
<Button x:Name="button1" Margin="0, 20, 0, 0" Text="Request Password Reset" Clicked="button1_Clicked"></Button>
|
||||||
|
|
||||||
|
<views:LoadingIndicatorView x:Name="loadingIndicatorView1" Margin="0, 20, 0, 0" />
|
||||||
|
|
||||||
|
</StackLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</StackLayout>
|
||||||
|
</ContentView.Content>
|
||||||
|
</ContentView>
|
89
MobileApp1/Views/Content/Login/PasswordResetView.xaml.cs
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
using MobileApp1.Services;
|
||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
using Xamarin.Forms.Xaml;
|
||||||
|
|
||||||
|
namespace MobileApp1.Views
|
||||||
|
{
|
||||||
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||||
|
public partial class PasswordResetView : ContentView
|
||||||
|
{
|
||||||
|
protected bool isBusy = false;
|
||||||
|
|
||||||
|
|
||||||
|
public PasswordResetView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool IsBusy
|
||||||
|
{
|
||||||
|
get => isBusy;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
isBusy = value;
|
||||||
|
|
||||||
|
LoginPage cp = ContentViewHelper.GetContentPage<LoginPage>(this);
|
||||||
|
if (cp != null)
|
||||||
|
{
|
||||||
|
cp.IsBusy = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
Device.BeginInvokeOnMainThread(() =>
|
||||||
|
{
|
||||||
|
loadingIndicatorView1.IsRunning = value;
|
||||||
|
textbox1.IsEnabled = !value;
|
||||||
|
button1.IsEnabled = !value;
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void button1_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
await Task.Run(() =>
|
||||||
|
{
|
||||||
|
if (this.Parent == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ContentPage cp = ContentViewHelper.GetContentPage(this);
|
||||||
|
if (cp == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
App ap = ContentViewHelper.GetApp(this);
|
||||||
|
if (ap == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.IsBusy = true;
|
||||||
|
|
||||||
|
ServiceResult result = ap.CorporationService.RequestPasswordReset(textbox1.Text);
|
||||||
|
|
||||||
|
loadingIndicatorView1.Message = result.Message;
|
||||||
|
|
||||||
|
this.IsBusy = false;
|
||||||
|
|
||||||
|
//ContentViewHelper.SetMainPage(this, new AppShell());
|
||||||
|
|
||||||
|
//await cp.DisplayAlert("Clicked", "Login", "OK");
|
||||||
|
|
||||||
|
|
||||||
|
if (result.IsSuccess)
|
||||||
|
{
|
||||||
|
// //await ContentViewHelper.GetApplication(this)?.MainPage.Navigation.PushAsync(new PasswordResetPage());
|
||||||
|
// //ContentViewHelper.GetApplication(this).MainPage = new NavigationPage(new PasswordResetPage());
|
||||||
|
|
||||||
|
ContentViewHelper.SetMainPage(this, new PasswordResetPage());
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
31
MobileApp1/Views/LoginPage.xaml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?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:Selector="clr-namespace:MobileApp1.Models" xmlns:views="clr-namespace:MobileApp1.Views"
|
||||||
|
x:Class="MobileApp1.Views.LoginPage"
|
||||||
|
NavigationPage.HasNavigationBar="False">
|
||||||
|
<ContentPage.Content>
|
||||||
|
<StackLayout Margin="20">
|
||||||
|
<views:CompanyHeaderView />
|
||||||
|
|
||||||
|
<CarouselView IndicatorView="indicatorView1" x:Name="carouselView1" Margin="0, 0, 0, 10">
|
||||||
|
<CarouselView.ItemsSource>
|
||||||
|
<x:Array Type="{x:Type ContentView}">
|
||||||
|
<views:LoginView />
|
||||||
|
<views:PasswordResetView />
|
||||||
|
<views:AboutView />
|
||||||
|
</x:Array>
|
||||||
|
</CarouselView.ItemsSource>
|
||||||
|
<CarouselView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<ContentView Content="{Binding .}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</CarouselView.ItemTemplate>
|
||||||
|
</CarouselView>
|
||||||
|
|
||||||
|
<IndicatorView
|
||||||
|
x:Name="indicatorView1"
|
||||||
|
MaximumVisible="6"
|
||||||
|
Margin="0, 0, 0, 20" />
|
||||||
|
</StackLayout>
|
||||||
|
</ContentPage.Content>
|
||||||
|
</ContentPage>
|
43
MobileApp1/Views/LoginPage.xaml.cs
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
using Xamarin.Forms;
|
||||||
|
using Xamarin.Forms.Xaml;
|
||||||
|
|
||||||
|
namespace MobileApp1.Views
|
||||||
|
{
|
||||||
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||||
|
public partial class LoginPage : ContentPage
|
||||||
|
{
|
||||||
|
protected bool isBusy = false;
|
||||||
|
//public int PageIndex { get; set; } = 0;
|
||||||
|
|
||||||
|
public LoginPage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
//indicatorView1.ItemsSource = new List<ContentView>() {
|
||||||
|
// new LandingLoginView(),
|
||||||
|
// new LandingRecoveryView(),
|
||||||
|
// new LandingAboutView()
|
||||||
|
//};
|
||||||
|
//indicatorView1.templ
|
||||||
|
|
||||||
|
indicatorView1.Position = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsBusy
|
||||||
|
{
|
||||||
|
get => isBusy;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
isBusy = value;
|
||||||
|
|
||||||
|
Device.BeginInvokeOnMainThread(() =>
|
||||||
|
{
|
||||||
|
carouselView1.IsSwipeEnabled = !value;
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
25
MobileApp1/Views/PasswordResetPage.xaml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?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.PasswordResetPage"
|
||||||
|
xmlns:views="clr-namespace:MobileApp1.Views"
|
||||||
|
Title="Reset Password">
|
||||||
|
<ContentPage.Content>
|
||||||
|
<StackLayout Margin="20">
|
||||||
|
<views:CompanyHeaderView />
|
||||||
|
|
||||||
|
<StackLayout HorizontalOptions="Fill">
|
||||||
|
<ScrollView>
|
||||||
|
<StackLayout>
|
||||||
|
<Label Text="Your password reset request has been sent." Margin="0, 0, 0, 20" FontSize="Body" />
|
||||||
|
|
||||||
|
<Label Text="Check your e-mails for your password reset message." FontSize="Body" />
|
||||||
|
<Button HorizontalOptions="Fill" Margin="0, 20, 0, 0" Text="Log In To My Account" Clicked="button1_Clicked"></Button>
|
||||||
|
|
||||||
|
</StackLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</StackLayout>
|
||||||
|
|
||||||
|
</StackLayout>
|
||||||
|
</ContentPage.Content>
|
||||||
|
</ContentPage>
|
19
MobileApp1/Views/PasswordResetPage.xaml.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace MobileApp1.Views
|
||||||
|
{
|
||||||
|
public partial class PasswordResetPage : ContentPage
|
||||||
|
{
|
||||||
|
public PasswordResetPage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ContentPageHelper.SetMainPage(this, new LoginPage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
1025
Resources/graphics.svg
Normal file
After Width: | Height: | Size: 92 KiB |
BIN
Resources/large-2.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
Resources/large.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
Resources/login.png
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
Resources/login_1.png
Normal file
After Width: | Height: | Size: 75 KiB |