Skip to content

Commit e6a0f03

Browse files
authored
Update .NET 8
* Started to work on the .NET 8 update * Safe areas and README * Update README.md
1 parent 452a559 commit e6a0f03

28 files changed

+1392
-1302
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -337,4 +337,6 @@ ASALocalRun/
337337
.localhistory/
338338

339339
# BeatPulse healthcheck temp database
340-
healthchecksdb
340+
healthchecksdb
341+
342+
.DS_Store

Images/CallingApp.mp4

601 KB
Binary file not shown.

Images/android_callingapp.mp4

442 KB
Binary file not shown.

Images/android_callingapp.webp

1.39 MB
Binary file not shown.

Images/ios_callingapp.mp4

638 KB
Binary file not shown.

Images/ios_callingapp.webp

1.85 MB
Binary file not shown.

README.md

+18-29
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,33 @@
11
# Calling App
2+
23
**.NET MAUI** implementation of [majority wallet & calling](https://dribbble.com/shots/14796428-majority-wallet-calling) design by [Hampus Öhman](https://dribbble.com/HampusOhman).
34

5+
https://github.com/RadekVyM/Calling-App/assets/65116078/6b37ddb6-90eb-4f86-98f3-875208f54535
6+
7+
This project demonstrates how to create .NET MAUI apps with custom graphics effects and many animations.
8+
49
## Original design
10+
511
[![Dribbble Design](./Images/original.gif)](https://dribbble.com/shots/14796428-majority-wallet-calling)
612

7-
## My .NET MAUI implementation
13+
## Installation
814

9-
<p align="center">
10-
<img src="./Images/callingapp.png" data-canonical-src="./Images/callingapp.png" width="500" />
11-
</p>
15+
First, make sure you have your Visual Studio and .NET 8 environment set up for .NET MAUI development. If not, follow the [setup instructions](https://learn.microsoft.com/dotnet/maui/get-started/installation). Then make sure you have your [Android](https://learn.microsoft.com/dotnet/maui/get-started/first-app?pivots=devices-android) or [iOS](https://learn.microsoft.com/dotnet/maui/get-started/first-app?pivots=devices-ios) platform set up for deployment of the application.
1216

13-
The application was built using only .NET MAUI APIs.
17+
Once everything is set up, you can clone the repo and run the application via Visual Studio or Visual Studio Code.
1418

15-
### Supported platforms
16-
These are all the platforms I tested the app on:
19+
Here are some resources to learn more about .NET MAUI:
1720

18-
- Android
19-
- iOS
20-
- Windows
21+
- [Official website](https://dotnet.microsoft.com/apps/maui)
22+
- [Microsoft Learn](https://learn.microsoft.com/dotnet/maui/what-is-maui)
23+
- [.NET MAUI GitHub repository](https://github.com/dotnet/maui)
2124

22-
<p align="center">
23-
<img src="./Images/android_callingapp_calling.gif" data-canonical-src="./Images/android_callingapp_calling.gif" width="200">
24-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
25-
<img src="./Images/android_callingapp_call.gif" data-canonical-src="./Images/android_callingapp_call.gif" width="200">
26-
</p>
25+
## Features
2726

28-
<p align="center">
29-
<img src="./Images/ios_callingapp_home.png" data-canonical-src="./Images/iphone_gadget_store_home.png" width="200">
30-
<img src="./Images/ios_callingapp_calling.png" data-canonical-src="./Images/iphone_gadget_store_menu.png" width="200">
31-
<img src="./Images/ios_callingapp_call.png" data-canonical-src="./Images/iphone_gadget_store_detail.png" width="200">
32-
</p>
27+
Only .NET MAUI APIs and my [SimpleToolkit](https://github.com/RadekVyM/SimpleToolkit) library were used to create this sample.
3328

3429
<p align="center">
35-
<img src="./Images/windows_callingapp.gif" data-canonical-src="./Images/windows_callingapp.gif" width="500">
30+
<img src="./Images/android_callingapp.webp" width="222">
31+
&nbsp;&nbsp;
32+
<img src="./Images/ios_callingapp.webp" width="228">
3633
</p>
37-
38-
### Features
39-
40-
- `GraphicsView`
41-
- Animations
42-
- Use of the new .NET MAUI APIs and controls
43-
44-
[![snppts](https://camo.githubusercontent.com/cd35f0ca9d14d9c9a7c4f35e9321fc32fa6369570292080e6c44fe8522768139/68747470733a2f2f7777772e736e707074732e6465762f696d672f736e707074732d62616467652e6a7067)](https://snppts.dev/)
+8-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
57
</PropertyGroup>
68

7-
</Project>
9+
<ItemGroup>
10+
<Folder Include="Models/" />
11+
</ItemGroup>
12+
13+
</Project>

src/CallingApp.Core/Models/Person.cs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace CallingApp.Core.Models;
2+
3+
public class Person
4+
{
5+
public required string Image { get; set; }
6+
public required string Name { get; set; }
7+
}

src/CallingApp.Core/Person.cs

-8
This file was deleted.

src/CallingApp.Core/RelayCommand.cs

+29-33
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,39 @@
1-
using System;
2-
using System.Windows.Input;
1+
using System.Windows.Input;
32

4-
namespace CallingApp.Core
5-
{
6-
public class RelayCommand : ICommand
7-
{
8-
private Action<object> parametredAction;
9-
private Action action;
10-
private Predicate<object> canExecute;
3+
namespace CallingApp.Core;
114

12-
public event EventHandler CanExecuteChanged;
5+
public class RelayCommand : ICommand
6+
{
7+
private readonly Action<object?>? parameteredAction;
8+
private readonly Action? action;
9+
private readonly Predicate<object?>? canExecute;
1310

14-
public RelayCommand(Action action, Predicate<object> canExecute)
15-
{
16-
this.action = action;
17-
this.canExecute = canExecute;
18-
}
11+
public event EventHandler? CanExecuteChanged;
1912

20-
public RelayCommand(Action<object> parametredAction, Predicate<object> canExecute)
21-
{
22-
this.parametredAction = parametredAction;
23-
this.canExecute = canExecute;
24-
}
13+
public RelayCommand(Action action, Predicate<object?>? canExecute)
14+
{
15+
this.action = action;
16+
this.canExecute = canExecute;
17+
}
2518

26-
public RelayCommand(Action action) : this(action, null) { }
19+
public RelayCommand(Action<object?> parameteredAction, Predicate<object?>? canExecute)
20+
{
21+
this.parameteredAction = parameteredAction;
22+
this.canExecute = canExecute;
23+
}
2724

28-
public RelayCommand(Action<object> parametredAction) : this(parametredAction, null) { }
25+
public RelayCommand(Action action) : this(action, null) { }
2926

30-
public bool CanExecute(object parameter)
31-
{
32-
return canExecute == null ? true : canExecute(parameter);
33-
}
27+
public RelayCommand(Action<object?> parameteredAction) : this(parameteredAction, null) { }
3428

35-
public void Execute(object parameter)
36-
{
37-
parametredAction?.Invoke(parameter);
38-
action?.Invoke();
39-
}
29+
public bool CanExecute(object? parameter) =>
30+
canExecute is null || canExecute(parameter);
4031

41-
public void OnCanExecuteChanged() => CanExecuteChanged?.Invoke(this, EventArgs.Empty);
32+
public void Execute(object? parameter)
33+
{
34+
parameteredAction?.Invoke(parameter);
35+
action?.Invoke();
4236
}
43-
}
37+
38+
public void OnCanExecuteChanged() => CanExecuteChanged?.Invoke(this, EventArgs.Empty);
39+
}
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,20 @@
1-
using System;
2-
using System.ComponentModel;
3-
using System.Threading.Tasks;
1+
using System.ComponentModel;
42

5-
namespace CallingApp.Core
6-
{
7-
public class BasePageViewModel : IBasePageViewModel, INotifyPropertyChanged
8-
{
9-
public event PropertyChangedEventHandler PropertyChanged;
10-
11-
protected void OnPropertyChanged(string propertyName)
12-
{
13-
try
14-
{
15-
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
16-
}
17-
catch (Exception exception)
18-
{
19-
System.Diagnostics.Debug.WriteLine(exception.Message);
20-
}
21-
}
3+
namespace CallingApp.Core.ViewModels;
224

23-
public async virtual Task OnPageDisappearing()
24-
{
25-
await Task.CompletedTask;
26-
}
5+
public class BasePageViewModel : IBasePageViewModel, INotifyPropertyChanged
6+
{
7+
public event PropertyChangedEventHandler? PropertyChanged;
278

28-
public async virtual Task OnPageCreated(params object[] parameters)
9+
protected void OnPropertyChanged(string propertyName)
10+
{
11+
try
2912
{
30-
await Task.CompletedTask;
13+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
3114
}
32-
33-
public async virtual Task OnPageAppearing()
15+
catch (Exception exception)
3416
{
35-
await Task.CompletedTask;
17+
System.Diagnostics.Debug.WriteLine(exception.Message);
3618
}
3719
}
38-
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
using System.ComponentModel;
2-
using System.Threading.Tasks;
32

4-
namespace CallingApp.Core
3+
namespace CallingApp.Core.ViewModels;
4+
5+
public interface IBasePageViewModel : INotifyPropertyChanged
56
{
6-
public interface IBasePageViewModel : INotifyPropertyChanged
7-
{
8-
Task OnPageDisappearing();
9-
Task OnPageAppearing();
10-
Task OnPageCreated(params object[] parameters);
11-
}
12-
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1-
using System.Collections.Generic;
2-
using System.Windows.Input;
1+
using System.Windows.Input;
2+
using CallingApp.Core.Models;
33

4-
namespace CallingApp.Core
4+
namespace CallingApp.Core.ViewModels;
5+
6+
public class MainPageViewModel : BasePageViewModel
57
{
6-
public class MainPageViewModel : BasePageViewModel
7-
{
8-
Person person;
8+
Person? person;
99

10-
public Person CurrentPerson
10+
public Person? CurrentPerson
11+
{
12+
get => person;
13+
set
1114
{
12-
get => person;
13-
set
14-
{
15-
person = value;
16-
OnPropertyChanged(nameof(CurrentPerson));
17-
}
15+
person = value;
16+
OnPropertyChanged(nameof(CurrentPerson));
1817
}
19-
public IList<Person> People => new List<Person> { new Person { Image = "vianey.jpg", Name = "Vianey" }, new Person { Image = "rick.jpg", Name = "Rick" } };
20-
public IList<string> Images => new List<string> { "mailchimp.jpg", "acnestudios.jpg", "wholefoods.jpg" };
18+
}
19+
public IList<Person> People => [new Person { Image = "vianey.jpg", Name = "Vianey" }, new Person { Image = "rick.jpg", Name = "Rick" }];
20+
public IList<string> Images => ["mailchimp.jpg", "acnestudios.jpg", "wholefoods.jpg"];
2121

22-
public ICommand CallPersonCommand { get; private set; }
22+
public ICommand CallPersonCommand { get; private init; }
2323

24-
public MainPageViewModel()
25-
{
26-
CallPersonCommand = new RelayCommand(parameter => CurrentPerson = parameter as Person);
27-
}
24+
public MainPageViewModel()
25+
{
26+
CallPersonCommand = new RelayCommand(parameter => CurrentPerson = parameter as Person);
2827
}
29-
}
28+
}

src/CallingApp.Maui/CallingApp.Maui.csproj

+13-17
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
5-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
66
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
77
<!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
88
<OutputType>Exe</OutputType>
@@ -22,14 +22,18 @@
2222
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
2323
<ApplicationVersion>1</ApplicationVersion>
2424

25-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
26-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
25+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
26+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
2727
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
2828
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
2929
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
3030
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
3131
</PropertyGroup>
3232

33+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-ios|AnyCPU'">
34+
<CreatePackage>false</CreatePackage>
35+
</PropertyGroup>
36+
3337
<ItemGroup>
3438
<!-- App Icon -->
3539
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#222326" />
@@ -64,18 +68,10 @@
6468
</ItemGroup>
6569

6670
<ItemGroup>
67-
<MauiXaml Update="Views\Controls\AvatarView.xaml">
68-
<Generator>MSBuild:Compile</Generator>
69-
</MauiXaml>
70-
<MauiXaml Update="Views\Controls\CallView.xaml">
71-
<Generator>MSBuild:Compile</Generator>
72-
</MauiXaml>
73-
<MauiXaml Update="Views\Controls\HangUpView.xaml">
74-
<Generator>MSBuild:Compile</Generator>
75-
</MauiXaml>
76-
<MauiXaml Update="Views\Pages\MainPage.xaml">
77-
<Generator>MSBuild:Compile</Generator>
78-
</MauiXaml>
71+
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
72+
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
73+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
74+
<PackageReference Include="SimpleToolkit.Core" Version="5.0.0" />
7975
</ItemGroup>
8076

81-
</Project>
77+
</Project>

0 commit comments

Comments
 (0)