Skip to content

Commit

Permalink
Merge branch 'master' into v9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Aug 2, 2024
2 parents edb3bdf + d9d9cd9 commit 1127769
Show file tree
Hide file tree
Showing 60 changed files with 2,011 additions and 173 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
dotnet-version: '8.0.201'

- name: Add .NET Workloads
run: dotnet workload install maui
run: dotnet workload install maui macos

- name: Build
run: dotnet build Build.slnf /restore -m -property:Configuration=Release -property:PublicRelease=true
Expand Down
62 changes: 59 additions & 3 deletions Acr.UserDialogs.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Build.slnf = Build.slnf
icon.png = icon.png
readme.md = readme.md
src\Directory.build.props = src\Directory.build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sample", "sample", "{C88D14B5-E775-4EE0-91A4-FD321B18415F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample", "sample\Sample\Sample.csproj", "{15294F23-E346-4DD3-A0EA-FDAB8F73B9A9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Acr.UserDialogs.Maui", "src\Acr.UserDialogs.Maui\Acr.UserDialogs.Maui.csproj", "{D45ECD34-ED85-4F09-914F-0D2A566C39C3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
Expand Down Expand Up @@ -175,12 +176,67 @@ Global
{15294F23-E346-4DD3-A0EA-FDAB8F73B9A9}.Release|x86.ActiveCfg = Release|Any CPU
{15294F23-E346-4DD3-A0EA-FDAB8F73B9A9}.Release|x86.Build.0 = Release|Any CPU
{15294F23-E346-4DD3-A0EA-FDAB8F73B9A9}.Release|x86.Deploy.0 = Release|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Ad-Hoc|Mixed Platforms.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Ad-Hoc|Mixed Platforms.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.AppStore|ARM.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.AppStore|ARM.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.AppStore|iPhone.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.AppStore|Mixed Platforms.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.AppStore|Mixed Platforms.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.AppStore|x64.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.AppStore|x64.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.AppStore|x86.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.AppStore|x86.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Debug|ARM.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Debug|ARM.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Debug|iPhone.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Debug|x64.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Debug|x64.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Debug|x86.ActiveCfg = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Debug|x86.Build.0 = Debug|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Release|Any CPU.Build.0 = Release|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Release|ARM.ActiveCfg = Release|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Release|ARM.Build.0 = Release|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Release|iPhone.ActiveCfg = Release|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Release|iPhone.Build.0 = Release|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Release|x64.ActiveCfg = Release|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Release|x64.Build.0 = Release|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Release|x86.ActiveCfg = Release|Any CPU
{D45ECD34-ED85-4F09-914F-0D2A566C39C3}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{15294F23-E346-4DD3-A0EA-FDAB8F73B9A9} = {C88D14B5-E775-4EE0-91A4-FD321B18415F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {17CCE1B1-75B2-4B32-8BCA-DF55666927A4}
Expand Down
13 changes: 7 additions & 6 deletions Build.slnf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"solution": {
"path": "Acr.UserDialogs.sln",
"projects": [
"src\\Acr.UserDialogs\\Acr.UserDialogs.csproj"
]
}
"solution": {
"path": "Acr.UserDialogs.sln",
"projects": [
"src\\Acr.UserDialogs\\Acr.UserDialogs.csproj",
"src\\Acr.UserDialogs.Maui\\Acr.UserDialogs.Maui.csproj"
]
}
}
20 changes: 9 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,22 @@ A cross platform library that allows you to call for standard user dialogs from

## Support Platforms

v7.x Supports
* iOS 8+
* Android
* Universal Windows Platform (Win10/UWP)
* NET Standard 2.0

v8.x Supports ONLY .NET 6 target
* .NET for Android (major target 12)
* .NET for iOS
* .NET for MacCatalyst

v9.x Supports ONLY .NET 8 target
* .NET for Android
* .NET for iOS
* .NET for MacCatalyst

## Setup

### MAUI Users
Install Acr.UserDialogs.Maui from NuGet

In your MauiProgram.cs, add the following

```csharp

```

To use, simply reference the nuget package in each of your platform projects. If you are getting issues with System.Drawing.Color, please make sure you are using the latest version of Xamarin

#### iOS and Windows
Expand Down
4 changes: 2 additions & 2 deletions sample/Sample/App.xaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?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:Sample"
x:Class="Sample.App">
xmlns:local="clr-namespace:Samples"
x:Class="Samples.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
Expand Down
13 changes: 5 additions & 8 deletions sample/Sample/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
using Samples;
namespace Samples;

namespace Sample
public partial class App : Application
{
public partial class App : Application
public App()
{
public App()
{
InitializeComponent();
this.InitializeComponent();

this.MainPage = new MainPage();
}
this.MainPage = new MainPage();
}
}
11 changes: 4 additions & 7 deletions sample/Sample/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Acr.UserDialogs;
using Microsoft.Maui.LifecycleEvents;

namespace Sample;

Expand All @@ -11,18 +10,16 @@ public static MauiApp CreateMauiApp()
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseUserDialogs()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
})
.ConfigureLifecycleEvents(events =>
{
#if ANDROID
events.AddAndroid(android => android.OnApplicationCreate(app => UserDialogs.Init(app)));
#endif
});

#if ANDROID
Acr.UserDialogs.UserDialogs.Init(() => Platform.CurrentActivity);
#endif
return builder.Build();
}
}
2 changes: 1 addition & 1 deletion sample/Sample/Pages/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:samples="clr-namespace:Samples;"
xmlns:samples="clr-namespace:Samples"
x:Class="Samples.MainPage"
Title="ACR UserDialogs">
<TabbedPage.Children>
Expand Down
7 changes: 5 additions & 2 deletions sample/Sample/Pages/ProgressPage.xaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<?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"
xmlns:local="clr-namespace:Samples.ViewModels"
x:DataType="local:ProgressViewModel"
x:Class="Samples.ProgressPage"
Title="Progress">
<ContentPage.Content>
<ListView ItemsSource="{Binding Commands}">
<ListView.ItemTemplate>
<DataTemplate>
<TextCell Text="{Binding Text}" Command="{Binding Command}" />
<DataTemplate x:DataType="local:CommandViewModel">
<TextCell Text="{Binding Text}"
Command="{Binding Command}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Expand Down
6 changes: 4 additions & 2 deletions sample/Sample/Pages/SettingsPage.xaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?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"
xmlns:local="clr-namespace:Samples.ViewModels"
x:DataType="local:SettingsViewModel"
x:Class="Samples.SettingsPage"
Title="Settings/Themes">
<ContentPage.Content>
<StackLayout>
<VerticalStackLayout>
<Button Text="Load Standard Theme" Command="{Binding StandardSettings}" />
<Button Text="Load Funny Theme" Command="{Binding LoadAbnormalSettings}" />
</StackLayout>
</VerticalStackLayout>
</ContentPage.Content>
</ContentPage>
7 changes: 5 additions & 2 deletions sample/Sample/Pages/SpecificCasesPage.xaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<?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"
xmlns:local="clr-namespace:Samples.ViewModels"
x:DataType="local:SpecificCasesViewModel"
x:Class="Samples.SpecificCasesPage"
Title="Specific Cases">
<ContentPage.Content>
<CollectionView ItemsSource="{Binding Commands}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Button Text="{Binding Text}" Command="{Binding Command}" />
<DataTemplate x:DataType="local:CommandViewModel">
<Button Text="{Binding Text}"
Command="{Binding Command}" />
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
Expand Down
16 changes: 10 additions & 6 deletions sample/Sample/Pages/StandardPage.xaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
<?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"
xmlns:local="clr-namespace:Samples.ViewModels"
x:DataType="local:StandardViewModel"
x:Class="Samples.StandardPage"
Title="Standard Dialogs">
<ContentPage.Content>
<StackLayout>
<StackLayout Orientation="Horizontal">
<VerticalStackLayout>
<HorizontalStackLayout>
<Switch IsToggled="{Binding AutoCancel}" />
<Label Text="Cancel After 3 Seconds" />
</StackLayout>
</HorizontalStackLayout>

<ListView ItemsSource="{Binding Commands}">
<ListView.ItemTemplate>
<DataTemplate>
<TextCell Text="{Binding Text}" Command="{Binding Command}" />
<DataTemplate x:DataType="local:CommandViewModel">
<TextCell Text="{Binding Text}"
Command="{Binding Command}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</VerticalStackLayout>
</ContentPage.Content>
</ContentPage>
2 changes: 2 additions & 0 deletions sample/Sample/Pages/ToastsPage.xaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?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"
xmlns:local="clr-namespace:Samples.ViewModels"
x:DataType="local:ToastsViewModel"
x:Class="Samples.ToastsPage"
Title="Toasts">
<ContentPage.Content>
Expand Down
17 changes: 13 additions & 4 deletions sample/Sample/Platforms/Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
using Android.App;
using Android.Content.PM;
using Android.OS;

namespace Sample
namespace Samples
{
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
[Activity(
Theme = "@style/Maui.SplashTheme",
MainLauncher = true,
ConfigurationChanges =
ConfigChanges.ScreenSize |
ConfigChanges.Orientation |
ConfigChanges.UiMode |
ConfigChanges.ScreenLayout |
ConfigChanges.SmallestScreenSize |
ConfigChanges.Density
)]
public class MainActivity : MauiAppCompatActivity
{
}
}
}
4 changes: 2 additions & 2 deletions sample/Sample/Platforms/Android/MainApplication.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Android.App;
using Android.Runtime;

namespace Sample
namespace Samples
{
[Application]
public class MainApplication : MauiApplication
Expand All @@ -13,4 +13,4 @@ public MainApplication(IntPtr handle, JniHandleOwnership ownership)

protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
}
}
4 changes: 2 additions & 2 deletions sample/Sample/Platforms/MacCatalyst/AppDelegate.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Foundation;

namespace Sample
namespace Samples
{
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
}
}
8 changes: 3 additions & 5 deletions sample/Sample/Platforms/MacCatalyst/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using ObjCRuntime;
using UIKit;

using UIKit;

namespace Sample
namespace Samples
{
public class Program
{
Expand All @@ -14,4 +12,4 @@ static void Main(string[] args)
UIApplication.Main(args, null, typeof(AppDelegate));
}
}
}
}
8 changes: 8 additions & 0 deletions sample/Sample/Platforms/Windows/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<maui:MauiWinUIApplication
x:Class="Samples.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:Samples.WinUI">

</maui:MauiWinUIApplication>
Loading

0 comments on commit 1127769

Please sign in to comment.