Skip to content

Commit 2412784

Browse files
authored
Merge pull request #20 from joshspicer/dev
1.4 beta into master
2 parents 399c830 + cf83ba8 commit 2412784

35 files changed

+1885
-1338
lines changed

PiholeDashboard.Android/PiholeDashboard.Android.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,22 @@
5353
<Reference Include="System.Xml" />
5454
</ItemGroup>
5555
<ItemGroup>
56-
<PackageReference Include="Xamarin.Forms" Version="4.5.0.356" />
57-
<PackageReference Include="Xamarin.Essentials" Version="1.3.1" />
56+
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1080" />
57+
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
5858
<PackageReference Include="Newtonsoft.Json">
5959
<Version>12.0.3</Version>
6060
</PackageReference>
6161
<PackageReference Include="Microsoft.AppCenter">
62-
<Version>3.1.0</Version>
62+
<Version>3.2.2</Version>
6363
</PackageReference>
6464
<PackageReference Include="Microsoft.AppCenter.Crashes">
65-
<Version>3.1.0</Version>
65+
<Version>3.2.2</Version>
6666
</PackageReference>
6767
<PackageReference Include="Microsoft.AppCenter.Analytics">
68-
<Version>3.1.0</Version>
68+
<Version>3.2.2</Version>
6969
</PackageReference>
7070
<PackageReference Include="System.Text.Json">
71-
<Version>4.7.1</Version>
71+
<Version>4.7.2</Version>
7272
</PackageReference>
7373
<PackageReference Include="ZXing.Net.Mobile.Forms">
7474
<Version>2.4.1</Version>

PiholeDashboard.Android/Resources/Resource.designer.cs

Lines changed: 998 additions & 976 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PiholeDashboard.iOS/AppDelegate.cs

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,65 @@
44

55
using Foundation;
66
using UIKit;
7+
using Xamarin.Forms;
78

89
namespace PiholeDashboard.iOS
910
{
11+
1012
// The UIApplicationDelegate for the application. This class is responsible for launching the
1113
// User Interface of the application, as well as listening (and optionally responding) to
1214
// application events from iOS.
1315
[Register("AppDelegate")]
1416
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
1517
{
16-
//
18+
19+
App myApp;
20+
21+
AppDelegate ()
22+
{
23+
Xamarin.Forms.Forms.SetFlags(new string[]
24+
{
25+
"AppTheme_Experimental",
26+
"CollectionView_Experimental",
27+
"RadioButton_Experimental"
28+
});
29+
30+
global::Xamarin.Forms.Forms.Init();
31+
ZXing.Net.Mobile.Forms.iOS.Platform.Init();
32+
33+
myApp = new App();
34+
}
35+
36+
public bool HandleShortcutItem(UIApplicationShortcutItem shortcutItem)
37+
{
38+
var handled = false;
39+
40+
// Anything to process?
41+
if (shortcutItem == null) return false;
42+
43+
// Take action based on the shortcut type
44+
switch (shortcutItem.Type)
45+
{
46+
case ShortcutIdentifier.StopCommand:
47+
MessagingCenter.Send(myApp, "StopCommand");
48+
handled = true;
49+
break;
50+
case ShortcutIdentifier.StartCommand:
51+
MessagingCenter.Send(myApp, "StartCommand");
52+
handled = true;
53+
break;
54+
}
55+
56+
// Return results
57+
return handled;
58+
}
59+
60+
public override void PerformActionForShortcutItem(UIApplication application,
61+
UIApplicationShortcutItem shortcutItem,
62+
UIOperationHandler completionHandler)
63+
=> completionHandler(HandleShortcutItem(shortcutItem));
64+
65+
1766
// This method is invoked when the application has loaded and is ready to run. In this
1867
// method you should instantiate the window, load the UI into it and then make the window
1968
// visible.
@@ -22,11 +71,10 @@ public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsAppli
2271
//
2372
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
2473
{
25-
global::Xamarin.Forms.Forms.SetFlags("CollectionView_Experimental");
26-
global::Xamarin.Forms.Forms.Init();
27-
ZXing.Net.Mobile.Forms.iOS.Platform.Init();
2874

29-
LoadApplication(new App());
75+
// ** Constuctor now handles creation of App().
76+
77+
LoadApplication(this.myApp);
3078

3179
return base.FinishedLaunching(app, options);
3280
}

PiholeDashboard.iOS/Info.plist

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,60 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>UIDeviceFamily</key>
5+
<key></key>
6+
<string></string>
7+
<key>CFBundleIdentifier</key>
8+
<string>com.joshspicer.piholedashboard</string>
9+
<key>CFBundleShortVersionString</key>
10+
<string>1.4</string>
11+
<key>CFBundleVersion</key>
12+
<string>4</string>
13+
<key>UILaunchStoryboardName</key>
14+
<string>LaunchScreen</string>
15+
<key>UIApplicationShortcutItems</key>
616
<array>
7-
<integer>1</integer>
17+
<dict>
18+
<key>UIApplicationShortcutItemType</key>
19+
<string>com.joshspicer.piholedashboard.startcommand</string>
20+
<key>UIApplicationShortcutItemTitle</key>
21+
<string>Enable Pi-Hole</string>
22+
</dict>
23+
<dict>
24+
<key>UIApplicationShortcutItemType</key>
25+
<string>com.joshspicer.piholedashboard.stopcommand</string>
26+
<key>UIApplicationShortcutItemTitle</key>
27+
<string>Disable Pi-Hole</string>
28+
</dict>
829
</array>
930
<key>UISupportedInterfaceOrientations</key>
1031
<array>
1132
<string>UIInterfaceOrientationPortrait</string>
1233
</array>
13-
<key>UISupportedInterfaceOrientations~ipad</key>
14-
<array>
15-
<string>UIInterfaceOrientationPortrait</string>
16-
<string>UIInterfaceOrientationPortraitUpsideDown</string>
17-
<string>UIInterfaceOrientationLandscapeLeft</string>
18-
<string>UIInterfaceOrientationLandscapeRight</string>
19-
</array>
20-
<key>MinimumOSVersion</key>
21-
<string>11.0</string>
22-
<key>CFBundleIdentifier</key>
23-
<string>com.joshspicer.piholedashboard</string>
24-
<key>UILaunchStoryboardName</key>
25-
<string>LaunchScreen</string>
26-
<key>CFBundleName</key>
27-
<string>PiholeDashboard</string>
2834
<key>NSAppTransportSecurity</key>
2935
<dict>
3036
<key>NSAllowsLocalNetworking</key>
3137
<true/>
3238
</dict>
3339
<key>XSAppIconAssets</key>
3440
<string>Assets.xcassets/AppIcon.appiconset</string>
35-
<key>CFBundleShortVersionString</key>
36-
<string>1.3</string>
37-
<key>CFBundleVersion</key>
38-
<string>1</string>
39-
<key>NSCameraUsageDescription</key>
40-
<string>Pi ContrHOLE uses your camera to scan Pi-Hole QR codes during setup</string>
4141
<key>CFBundleDisplayName</key>
4242
<string>Pi ContrHOLE</string>
43+
<key>MinimumOSVersion</key>
44+
<string>11.0</string>
45+
<key>NSCameraUsageDescription</key>
46+
<string>Pi ContrHOLE uses your camera to scan Pi-Hole QR codes during setup</string>
47+
<key>UIDeviceFamily</key>
48+
<array>
49+
<integer>1</integer>
50+
</array>
51+
<key>UISupportedInterfaceOrientations~ipad</key>
52+
<array>
53+
<string>UIInterfaceOrientationPortrait</string>
54+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
55+
<string>UIInterfaceOrientationLandscapeLeft</string>
56+
<string>UIInterfaceOrientationLandscapeRight</string>
57+
</array>
58+
<key>CFBundleName</key>
59+
<string>PiholeDashboard</string>
4360
</dict>
4461
</plist>

PiholeDashboard.iOS/PiholeDashboard.iOS.csproj

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
<None Include="Entitlements.plist" />
7575
<None Include="Info.plist" />
7676
<Compile Include="Properties\AssemblyInfo.cs" />
77+
<Compile Include="ShortcutIdentifier.cs" />
7778
</ItemGroup>
7879
<ItemGroup>
7980
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json">
@@ -139,22 +140,22 @@
139140
<Reference Include="System.Numerics.Vectors" />
140141
</ItemGroup>
141142
<ItemGroup>
142-
<PackageReference Include="Xamarin.Forms" Version="4.5.0.356" />
143-
<PackageReference Include="Xamarin.Essentials" Version="1.3.1" />
143+
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1080" />
144+
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
144145
<PackageReference Include="Newtonsoft.Json">
145146
<Version>12.0.3</Version>
146147
</PackageReference>
147148
<PackageReference Include="Microsoft.AppCenter">
148-
<Version>3.1.0</Version>
149+
<Version>3.2.2</Version>
149150
</PackageReference>
150151
<PackageReference Include="Microsoft.AppCenter.Crashes">
151-
<Version>3.1.0</Version>
152+
<Version>3.2.2</Version>
152153
</PackageReference>
153154
<PackageReference Include="Microsoft.AppCenter.Analytics">
154-
<Version>3.1.0</Version>
155+
<Version>3.2.2</Version>
155156
</PackageReference>
156157
<PackageReference Include="System.Text.Json">
157-
<Version>4.7.1</Version>
158+
<Version>4.7.2</Version>
158159
</PackageReference>
159160
<PackageReference Include="ZXing.Net.Mobile.Forms">
160161
<Version>2.4.1</Version>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
namespace PiholeDashboard.iOS
3+
{
4+
public static class ShortcutIdentifier
5+
{
6+
public const string StopCommand = "com.joshspicer.piholedashboard.stopcommand";
7+
public const string StartCommand = "com.joshspicer.piholedashboard.startcommand";
8+
9+
}
10+
}

PiholeDashboard.ipa

12.4 MB
Binary file not shown.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System;
2+
using System.Globalization;
3+
using Xamarin.Forms;
4+
5+
namespace PiholeDashboard
6+
{
7+
public class ActiveClientNameConverter : IValueConverter
8+
{
9+
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
10+
{
11+
string input = (string)value;
12+
13+
if (!(input is string))
14+
return $"Unknown";
15+
16+
int len = input.Length;
17+
18+
if (len == 0)
19+
{
20+
return $"Unknown";
21+
}
22+
23+
if (!input.Contains("|"))
24+
return input;
25+
26+
var splitVals = input.Split('|');
27+
28+
return $"{splitVals[0]} ({splitVals[1]})";
29+
30+
}
31+
32+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
33+
{
34+
throw new NotImplementedException();
35+
}
36+
}
37+
}
38+

PiholeDashboard/App.xaml

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,64 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Application xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:d="http://xamarin.com/schemas/2014/forms/design" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="PiholeDashboard.App">
2+
<Application
3+
xmlns="http://xamarin.com/schemas/2014/forms"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
5+
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
mc:Ignorable="d"
8+
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
9+
ios:Page.UseSafeArea="true"
10+
x:Class="PiholeDashboard.App">
311
<Application.Resources>
12+
<ResourceDictionary>
13+
<!-- https://coolors.co/003049-d62828-f77f00-fcbf49-eae2b7 -->
14+
<Color x:Key="blue">#003049</Color>
15+
<Color x:Key="lightBlue">#1F96F3</Color>
16+
17+
<Color x:Key="red">#D62828</Color>
18+
<Color x:Key="orange">#F77F00</Color>
19+
<Color x:Key="green">#94A128</Color>
20+
<Color x:Key="yellow">#FCBF49</Color>
21+
<Color x:Key="lemon">#EAE2B7</Color>
22+
23+
<Color x:Key="white">#ffffff</Color>
24+
25+
<Color x:Key="darkColor">#121212</Color>
26+
<Color x:Key="lightColor">LightGray</Color>
27+
28+
<Style ApplyToDerivedTypes="True" TargetType="Label">
29+
<Setter Property="FontFamily" Value="jose"/>
30+
<Setter Property="TextColor"
31+
Value="{AppThemeBinding
32+
Dark={StaticResource lightColor},
33+
Light={StaticResource darkColor}}"/>
34+
</Style>
35+
36+
<Style ApplyToDerivedTypes="True" TargetType="ListView">
37+
<Setter Property="BackgroundColor"
38+
Value="{AppThemeBinding
39+
Dark={StaticResource darkColor},
40+
Light={StaticResource white}}"/>
41+
</Style>
42+
43+
<Style ApplyToDerivedTypes="True" TargetType="Frame">
44+
<Setter Property="BackgroundColor"
45+
Value="{AppThemeBinding
46+
Dark={StaticResource darkColor},
47+
Light={StaticResource lightColor}}"/>
48+
</Style>
49+
50+
<Style TargetType="Button" ApplyToDerivedTypes="True">
51+
<Setter Property="FontFamily" Value="jose" />
52+
<Setter Property="TextColor" Value="White"/>
53+
</Style>
54+
55+
<Style TargetType="RadioButton">
56+
<Setter Property="TextColor"
57+
Value="{AppThemeBinding
58+
Dark={StaticResource lightColor},
59+
Light={StaticResource darkColor}}"/>
60+
</Style>
61+
62+
</ResourceDictionary>
463
</Application.Resources>
564
</Application>

0 commit comments

Comments
 (0)