Skip to content

Commit

Permalink
Merge branch 'feature/docs' into 'main'
Browse files Browse the repository at this point in the history
Feature/docs

See merge request bnotech/matomo/matomo.maui!1
  • Loading branch information
bnoffer committed Feb 26, 2024
2 parents 99e9578 + caaadb7 commit a6a2108
Show file tree
Hide file tree
Showing 39 changed files with 3,829 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "docs/shared"]
path = docs/shared
url = git@github.com:bfn-tech/bfn-tech.github.io.git
9 changes: 9 additions & 0 deletions Matomo.Maui.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample", "Sample", "{84FA4430-CA33-4436-98E6-E421058A0973}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Matomo.Maui.Sample", "Sample\Matomo.Maui.Sample\Matomo.Maui.Sample.csproj", "{F33C9D2B-FDF0-469A-9704-0154B9B87E3B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -20,6 +24,10 @@ Global
{160D13D6-14DC-4030-9504-4E29EAD09749}.Debug|Any CPU.Build.0 = Debug|Any CPU
{160D13D6-14DC-4030-9504-4E29EAD09749}.Release|Any CPU.ActiveCfg = Release|Any CPU
{160D13D6-14DC-4030-9504-4E29EAD09749}.Release|Any CPU.Build.0 = Release|Any CPU
{F33C9D2B-FDF0-469A-9704-0154B9B87E3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F33C9D2B-FDF0-469A-9704-0154B9B87E3B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F33C9D2B-FDF0-469A-9704-0154B9B87E3B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F33C9D2B-FDF0-469A-9704-0154B9B87E3B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -31,5 +39,6 @@ Global
{F98A6817-2895-47D3-9FC3-E93BB5747555} = {199F81EB-3FE7-451F-BD77-41E680A31F0B}
{EBD1EEA9-0CB1-42E1-B01E-17FEB3B1E2C0} = {F98A6817-2895-47D3-9FC3-E93BB5747555}
{C7882A5C-EE2F-4B30-AE11-530F33F4CF2A} = {F98A6817-2895-47D3-9FC3-E93BB5747555}
{F33C9D2B-FDF0-469A-9704-0154B9B87E3B} = {84FA4430-CA33-4436-98E6-E421058A0973}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ This library provides [Matomo](https://matomo.org) Tracking for .NET MAUI Apps.

This library is published for .NET 6.0 and .NET 7.0, please use the v. 6.x and v. 7.x versions accordingly.

## Documentation

You can find a reference documentation [here](https://bfn-tech.github.io/Matomo.Maui/html/index.html).

And a sample project in the `Sample/` folder.

## Credit

This work is based on the work done at [zauberzeug/xamarin.piwik](https://github.com/zauberzeug/xamarin.piwik)
Expand Down
15 changes: 15 additions & 0 deletions Sample/Matomo.Maui.Sample/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Matomo.Maui.Sample"
x:Class="Matomo.Maui.Sample.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

12 changes: 12 additions & 0 deletions Sample/Matomo.Maui.Sample/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Matomo.Maui.Sample;

public partial class App : Application
{
public App()
{
InitializeComponent();

MainPage = new AppShell();
}
}

15 changes: 15 additions & 0 deletions Sample/Matomo.Maui.Sample/AppShell.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="Matomo.Maui.Sample.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Matomo.Maui.Sample"
Shell.FlyoutBehavior="Disabled">

<ShellContent
Title="Home"
ContentTemplate="{DataTemplate local:MainPage}"
Route="MainPage" />

</Shell>

10 changes: 10 additions & 0 deletions Sample/Matomo.Maui.Sample/AppShell.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Matomo.Maui.Sample;

public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
}
}

42 changes: 42 additions & 0 deletions Sample/Matomo.Maui.Sample/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Matomo.Maui.Sample.MainPage">

<ScrollView>
<VerticalStackLayout
Spacing="25"
Padding="30,0"
VerticalOptions="Center">

<Image
Source="dotnet_bot.png"
SemanticProperties.Description="Cute dot net bot waving hi to you!"
HeightRequest="200"
HorizontalOptions="Center" />

<Label
Text="Hello, World!"
SemanticProperties.HeadingLevel="Level1"
FontSize="32"
HorizontalOptions="Center" />

<Label
Text="Welcome to .NET Multi-platform App UI"
SemanticProperties.HeadingLevel="Level2"
SemanticProperties.Description="Welcome to dot net Multi platform App U I"
FontSize="18"
HorizontalOptions="Center" />

<Button
x:Name="CounterBtn"
Text="Click me"
SemanticProperties.Hint="Counts the number of times you click"
Clicked="OnCounterClicked"
HorizontalOptions="Center" />

</VerticalStackLayout>
</ScrollView>

</ContentPage>

25 changes: 25 additions & 0 deletions Sample/Matomo.Maui.Sample/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace Matomo.Maui.Sample;

public partial class MainPage : ContentPage
{
int count = 0;

public MainPage()
{
InitializeComponent();
}

private void OnCounterClicked(object sender, EventArgs e)
{
count++;

if (count == 1)
CounterBtn.Text = $"Clicked {count} time";
else
CounterBtn.Text = $"Clicked {count} times";

SemanticScreenReader.Announce(CounterBtn.Text);
}
}


55 changes: 55 additions & 0 deletions Sample/Matomo.Maui.Sample/Matomo.Maui.Sample.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
<RootNamespace>Matomo.Maui.Sample</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

<!-- Display name -->
<ApplicationTitle>Matomo.Maui.Sample</ApplicationTitle>

<!-- App Identifier -->
<ApplicationId>com.companyname.matomo.maui.sample</ApplicationId>
<ApplicationIdGuid>849984bc-4055-45f7-ac4f-9e2e6a68a67f</ApplicationIdGuid>

<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />

<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />

<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
</ItemGroup>

</Project>
25 changes: 25 additions & 0 deletions Sample/Matomo.Maui.Sample/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Microsoft.Extensions.Logging;

namespace Matomo.Maui.Sample;

public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});

#if DEBUG
builder.Logging.AddDebug();
#endif

return builder.Build();
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
11 changes: 11 additions & 0 deletions Sample/Matomo.Maui.Sample/Platforms/Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Android.App;
using Android.Content.PM;
using Android.OS;

namespace Matomo.Maui.Sample;

[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
}

16 changes: 16 additions & 0 deletions Sample/Matomo.Maui.Sample/Platforms/Android/MainApplication.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Android.App;
using Android.Runtime;

namespace Matomo.Maui.Sample;

[Application]
public class MainApplication : MauiApplication
{
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
: base(handle, ownership)
{
}

protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#512BD4</color>
<color name="colorPrimaryDark">#2B0B98</color>
<color name="colorAccent">#2B0B98</color>
</resources>

10 changes: 10 additions & 0 deletions Sample/Matomo.Maui.Sample/Platforms/MacCatalyst/AppDelegate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Foundation;

namespace Matomo.Maui.Sample;

[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

30 changes: 30 additions & 0 deletions Sample/Matomo.Maui.Sample/Platforms/MacCatalyst/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
</dict>
</plist>
16 changes: 16 additions & 0 deletions Sample/Matomo.Maui.Sample/Platforms/MacCatalyst/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using ObjCRuntime;
using UIKit;

namespace Matomo.Maui.Sample;

public class Program
{
// This is the main entry point of the application.
static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, typeof(AppDelegate));
}
}

17 changes: 17 additions & 0 deletions Sample/Matomo.Maui.Sample/Platforms/Tizen/Main.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using Microsoft.Maui;
using Microsoft.Maui.Hosting;

namespace Matomo.Maui.Sample;

class Program : MauiApplication
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();

static void Main(string[] args)
{
var app = new Program();
app.Run(args);
}
}

15 changes: 15 additions & 0 deletions Sample/Matomo.Maui.Sample/Platforms/Tizen/tizen-manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="maui-application-id-placeholder" version="0.0.0" api-version="7" xmlns="http://tizen.org/ns/packages">
<profile name="common" />
<ui-application appid="maui-application-id-placeholder" exec="Matomo.Maui.Sample.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single">
<label>maui-application-title-placeholder</label>
<icon>maui-appicon-placeholder</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
</ui-application>
<shortcut-list />
<privileges>
<privilege>http://tizen.org/privilege/internet</privilege>
</privileges>
<dependencies />
<provides-appdefined-privileges />
</manifest>
9 changes: 9 additions & 0 deletions Sample/Matomo.Maui.Sample/Platforms/Windows/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<maui:MauiWinUIApplication
x:Class="Matomo.Maui.Sample.WinUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:maui="using:Microsoft.Maui"
xmlns:local="using:Matomo.Maui.Sample.WinUI">

</maui:MauiWinUIApplication>

Loading

0 comments on commit a6a2108

Please sign in to comment.