Skip to content

Commit

Permalink
GUI - part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
iDiabDev committed Sep 3, 2019
1 parent bdb9767 commit 0b02816
Show file tree
Hide file tree
Showing 42 changed files with 1,725 additions and 660 deletions.
4 changes: 4 additions & 0 deletions eDroplet/eDroplet.Android/FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<Realm />
</Weavers>
28 changes: 28 additions & 0 deletions eDroplet/eDroplet.Android/FodyWeavers.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="Realm" minOccurs="0" maxOccurs="1">
<xs:complexType></xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
22 changes: 20 additions & 2 deletions eDroplet/eDroplet.Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Android.App;
using Acr.UserDialogs;
using Android;
using Android.App;
using Android.Content.PM;
using Android.OS;
using Prism;
Expand All @@ -9,23 +11,39 @@ namespace eDroplet.Droid
[Activity(Label = "eDroplet", Icon = "@mipmap/ic_launcher", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
public static IUserDialogs dialogUI;

protected override void OnCreate(Bundle bundle)
{
UserDialogs.Init(() => this);
dialogUI = UserDialogs.Instance;

TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;

base.OnCreate(bundle);

global::Xamarin.Forms.Forms.Init(this, bundle);
LoadApplication(new App(new AndroidInitializer()));

this.RequestPermissions(new[]
{
Manifest.Permission.AccessCoarseLocation,
Manifest.Permission.BluetoothPrivileged,
Manifest.Permission.BluetoothAdmin,
Manifest.Permission.Bluetooth,
Manifest.Permission.Nfc,
Manifest.Permission.Vibrate
}, 0);

}
}

public class AndroidInitializer : IPlatformInitializer
{
public void RegisterTypes(IContainerRegistry containerRegistry)
{
// Register any platform specific implementations
containerRegistry.RegisterSingleton<IUserDialogs>();
}
}
}
Expand Down
1,817 changes: 1,175 additions & 642 deletions eDroplet/eDroplet.Android/Resources/Resource.designer.cs

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions eDroplet/eDroplet.Android/eDroplet.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Acr.UserDialogs">
<Version>7.0.4</Version>
</PackageReference>
<PackageReference Include="Realm">
<Version>4.1.0</Version>
</PackageReference>
<PackageReference Include="Syncfusion.Xamarin.Buttons">
<Version>17.2.0.47</Version>
</PackageReference>
<PackageReference Include="Syncfusion.Xamarin.SfChart">
<Version>17.2.0.47</Version>
</PackageReference>
<PackageReference Include="Syncfusion.Xamarin.SfNumericUpDown">
<Version>17.2.0.47</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.2.0.709249" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.1" />
Expand Down Expand Up @@ -98,5 +113,53 @@
<ItemGroup>
<AndroidResource Include="Resources\xml\nfc_tech_filter.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\about.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\ble.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\cgm.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\down.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\down_fast.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\down_slow.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\glucometer.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\home.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\nfc.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\pump.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\setup.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\stable.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\up.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\up_fast.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\up_slow.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\xamarin_logo.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>
10 changes: 10 additions & 0 deletions eDroplet/eDroplet.iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using Foundation;
using Prism;
using Prism.Ioc;
using Syncfusion.SfChart.XForms.iOS.Renderers;
using Syncfusion.SfNumericUpDown.XForms.iOS;
using Syncfusion.XForms.iOS.Buttons;
using UIKit;


Expand All @@ -22,6 +25,13 @@ public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsAppli
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();

SfChartRenderer.Init();
SfNumericUpDownRenderer.Init();
SfRadioButtonRenderer.Init();
SfCheckBoxRenderer.Init();
SfButtonRenderer.Init();

LoadApplication(new App(new iOSInitializer()));

return base.FinishedLaunching(app, options);
Expand Down
4 changes: 4 additions & 0 deletions eDroplet/eDroplet.iOS/FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<Realm />
</Weavers>
28 changes: 28 additions & 0 deletions eDroplet/eDroplet.iOS/FodyWeavers.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="Realm" minOccurs="0" maxOccurs="1">
<xs:complexType></xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
Binary file added eDroplet/eDroplet.iOS/Resources/Help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/about.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/battery.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/ble.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/cgm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/down_fast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/down_slow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/glucometer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/nfc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/pump.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/stable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/up_fast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/up_slow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added eDroplet/eDroplet.iOS/Resources/xamarin_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions eDroplet/eDroplet.iOS/eDroplet.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,21 @@
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Acr.UserDialogs">
<Version>7.0.4</Version>
</PackageReference>
<PackageReference Include="Realm">
<Version>4.1.0</Version>
</PackageReference>
<PackageReference Include="Syncfusion.Xamarin.Buttons">
<Version>17.2.0.47</Version>
</PackageReference>
<PackageReference Include="Syncfusion.Xamarin.SfChart">
<Version>17.2.0.47</Version>
</PackageReference>
<PackageReference Include="Syncfusion.Xamarin.SfNumericUpDown">
<Version>17.2.0.47</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.2.0.709249" />
<PackageReference Include="Prism.Unity.Forms" Version="7.2.0.1367" />
</ItemGroup>
Expand All @@ -189,5 +204,62 @@
<Name>eDroplet</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\about.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\ble.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\cgm.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\glucometer.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\home.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\nfc.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\pump.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\setup.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\xamarin_logo.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\add.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\battery.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\down.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\down_fast.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\down_slow.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\Help.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\stable.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\up.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\up_fast.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\up_slow.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
</Project>
36 changes: 30 additions & 6 deletions eDroplet/eDroplet/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,35 +1,59 @@
using Prism;
/*
Copyright 2019 Marek Macner, iDiab.dev LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2019 Marek Macner, iDiab.dev LLC
*/



using Prism;
using Prism.Ioc;
using eDroplet.ViewModels;
using eDroplet.Views;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using Acr.UserDialogs;

[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
namespace eDroplet
{
public partial class App
{
/*
* The Xamarin Forms XAML Previewer in Visual Studio uses System.Activator.CreateInstance.
* This imposes a limitation in which the App class must have a default constructor.
* App(IPlatformInitializer initializer = null) cannot be handled by the Activator.
*/
public App() : this(null) { }

public App(IPlatformInitializer initializer) : base(initializer) { }

protected override async void OnInitialized()
{
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("MTM2NDIwQDMxMzcyZTMyMmUzMEY0K1ZJSUtoaEJCQ1hCU2RBMC9SajJtWVVPNHpQa3VPdFlBWGtWdDFLZTg9");

InitializeComponent();

await NavigationService.NavigateAsync("NavigationPage/MainPage");
}

protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.RegisterInstance<IUserDialogs>(UserDialogs.Instance);

containerRegistry.RegisterForNavigation<NavigationPage>();
containerRegistry.RegisterForNavigation<MainPage, MainPageViewModel>();
containerRegistry.RegisterForNavigation<HomePage, HomePageViewModel>();
containerRegistry.RegisterForNavigation<CgmPage, CgmPageViewModel>();
}
}
}
4 changes: 4 additions & 0 deletions eDroplet/eDroplet/FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<Realm />
</Weavers>
Loading

0 comments on commit 0b02816

Please sign in to comment.