Skip to content

Commit 6fa02d3

Browse files
Merge branch 'main' into feature/stephenquan/math-ar
2 parents 5cf47de + e5fdb09 commit 6fa02d3

34 files changed

+1644
-1242
lines changed

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363

6464
- name: Publish Benchmarks
6565
if: runner.os == 'Windows'
66-
uses: actions/upload-artifact@v4
66+
uses: actions/upload-artifact@v5
6767
with:
6868
name: Benchmarks
6969
path: |

.github/workflows/dotnet-build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ jobs:
246246
shell: pwsh
247247

248248
- name: Upload Package List
249-
uses: actions/upload-artifact@v4
249+
uses: actions/upload-artifact@v5
250250
if: ${{ runner.os == 'Windows' }}
251251
with:
252252
name: nuget-list
@@ -256,7 +256,7 @@ jobs:
256256
257257
- name: Publish Packages
258258
if: ${{ runner.os == 'Windows' }}
259-
uses: actions/upload-artifact@v4
259+
uses: actions/upload-artifact@v5
260260
with:
261261
name: packages
262262
path: ${{ github.workspace }}/nuget/
@@ -276,13 +276,13 @@ jobs:
276276
dotnet-quality: 'ga'
277277

278278
- name: Download NuGet List
279-
uses: actions/download-artifact@v5
279+
uses: actions/download-artifact@v6
280280
with:
281281
name: nuget-list
282282
path: ./
283283

284284
- name: Download Package List
285-
uses: actions/download-artifact@v5
285+
uses: actions/download-artifact@v6
286286
with:
287287
name: packages
288288
path: ./packages
@@ -328,7 +328,7 @@ jobs:
328328
--verbosity Information
329329
330330
- name: Publish Packages
331-
uses: actions/upload-artifact@v4
331+
uses: actions/upload-artifact@v5
332332
with:
333333
name: signed-packages
334334
if-no-files-found: error
@@ -348,7 +348,7 @@ jobs:
348348
dotnet-quality: 'ga'
349349

350350
- name: Download signed packages
351-
uses: actions/download-artifact@v5
351+
uses: actions/download-artifact@v6
352352
with:
353353
name: signed-packages
354354
path: ./packages
@@ -376,7 +376,7 @@ jobs:
376376
dotnet-quality: 'ga'
377377

378378
- name: Download signed packages
379-
uses: actions/download-artifact@v5
379+
uses: actions/download-artifact@v6
380380
with:
381381
name: signed-packages
382382
path: ./packages

Directory.Build.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
<NuGetAuditMode>all</NuGetAuditMode>
1717

1818
<!-- MAUI Specific -->
19-
<MauiPackageVersion>9.0.111</MauiPackageVersion>
20-
<NextMauiPackageVersion>10.0.0</NextMauiPackageVersion>
19+
<MauiPackageVersion>9.0.120</MauiPackageVersion>
2120
<MauiStrictXamlCompilation>true</MauiStrictXamlCompilation>
2221
<SkipValidateMauiImplicitPackageReferences>true</SkipValidateMauiImplicitPackageReferences>
2322
<MauiEnableXamlCBindingWithSourceCompilation>true</MauiEnableXamlCBindingWithSourceCompilation>

azure-pipelines.yml

Lines changed: 0 additions & 520 deletions
This file was deleted.

samples/CommunityToolkit.Maui.Sample/Pages/Views/CameraView/CameraViewPage.xaml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@
5757
<Button Clicked="ZoomIn" Text="Zoom +" Grid.Column="2"/>
5858
</Grid>
5959

60-
<Grid Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="3" BackgroundColor="#80CCCCCC">
60+
<Grid Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="5" BackgroundColor="#80CCCCCC">
6161

6262
<FlexLayout Margin="5" JustifyContent="SpaceBetween" Wrap="Wrap">
6363

6464
<Picker
6565
Title="Cameras"
6666
ItemsSource="{Binding Cameras}"
67-
ItemDisplayBinding="{Binding Name}"
67+
ItemDisplayBinding="{Binding Name, x:DataType={x:Null}}"
6868
SelectedItem="{Binding SelectedCamera}" />
6969

7070
<Picker
@@ -73,15 +73,28 @@
7373
ItemsSource="{Binding FlashModes}"
7474
SelectedItem="{Binding FlashMode}" />
7575

76-
<Button Command="{Binding CaptureImageCommand, Source={x:Reference Camera}, x:DataType=toolkit:CameraView}"
77-
CommandParameter="{Binding Token}"
78-
Text="Capture Image"/>
7976
<Button Command="{Binding StartCameraPreviewCommand, Source={x:Reference Camera}, x:DataType=toolkit:CameraView}"
8077
CommandParameter="{Binding Token}"
81-
Text="StartCameraPreview" />
78+
Text="Start Camera Preview" />
8279

8380
<Button Command="{Binding StopCameraPreviewCommand, Source={x:Reference Camera}, x:DataType=toolkit:CameraView}"
84-
Text="StopCameraPreview" />
81+
Text="Stop Camera Preview" />
82+
83+
84+
<Button Clicked="StartCameraRecording"
85+
Text="Start Video Recording" />
86+
87+
<Button Clicked="StopCameraRecording"
88+
CommandParameter="{Binding Token}"
89+
Text="Stop Video Recording" />
90+
91+
<Button Clicked="SaveVideo" Text="Save Video Recording" />
92+
93+
<Button Command="{Binding CaptureImageCommand, Source={x:Reference Camera}, x:DataType=toolkit:CameraView}"
94+
CommandParameter="{Binding Token}"
95+
Text="Capture Image"/>
96+
97+
<Button Clicked="SetNightMode" Text="Set Night Mode (Android)" />
8598

8699
</FlexLayout>
87100
</Grid>

samples/CommunityToolkit.Maui.Sample/Pages/Views/CameraView/CameraViewPage.xaml.cs

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
using System.Diagnostics;
22
using CommunityToolkit.Maui.Core;
33
using CommunityToolkit.Maui.Sample.ViewModels.Views;
4+
using CommunityToolkit.Maui.Storage;
45

56
namespace CommunityToolkit.Maui.Sample.Pages.Views;
67

7-
public partial class CameraViewPage : BasePage<CameraViewViewModel>
8+
public sealed partial class CameraViewPage : BasePage<CameraViewViewModel>
89
{
10+
readonly IFileSaver fileSaver;
911
readonly string imagePath;
12+
1013
int pageCount;
14+
Stream videoRecordingStream = Stream.Null;
1115

12-
public CameraViewPage(CameraViewViewModel viewModel, IFileSystem fileSystem) : base(viewModel)
16+
public CameraViewPage(CameraViewViewModel viewModel, IFileSystem fileSystem, IFileSaver fileSaver) : base(viewModel)
1317
{
1418
InitializeComponent();
1519

20+
this.fileSaver = fileSaver;
1621
imagePath = Path.Combine(fileSystem.CacheDirectory, "camera-view-image.jpg");
1722

1823
Camera.MediaCaptured += OnMediaCaptured;
1924

20-
Loaded += (s, e) =>
21-
{
22-
pageCount = Navigation.NavigationStack.Count;
23-
};
25+
Loaded += (s, e) => { pageCount = Navigation.NavigationStack.Count; };
2426
}
2527

2628
protected override async void OnAppearing()
@@ -51,6 +53,7 @@ async void OnImageTapped(object? sender, TappedEventArgs args)
5153
{
5254
return;
5355
}
56+
5457
await Navigation.PushAsync(new ImageViewPage(imagePath));
5558
}
5659

@@ -82,7 +85,6 @@ void OnMediaCaptured(object? sender, MediaCapturedEventArgs e)
8285

8386
debugText.Text = $"Image saved to {imagePath}";
8487
});
85-
8688
}
8789

8890
void ZoomIn(object? sender, EventArgs e)
@@ -94,4 +96,37 @@ void ZoomOut(object? sender, EventArgs e)
9496
{
9597
Camera.ZoomFactor -= 1.0f;
9698
}
99+
100+
async void SetNightMode(object? sender, EventArgs e)
101+
{
102+
#if ANDROID
103+
await Camera.SetExtensionMode(AndroidX.Camera.Extensions.ExtensionMode.Night);
104+
#else
105+
await Task.CompletedTask;
106+
#endif
107+
}
108+
109+
async void StartCameraRecording(object? sender, EventArgs e)
110+
{
111+
await Camera.StartVideoRecording(CancellationToken.None);
112+
}
113+
114+
async void StopCameraRecording(object? sender, EventArgs e)
115+
{
116+
videoRecordingStream = await Camera.StopVideoRecording(CancellationToken.None);
117+
}
118+
119+
async void SaveVideo(object? sender, EventArgs e)
120+
{
121+
if (videoRecordingStream == Stream.Null)
122+
{
123+
await DisplayAlert("Unable to Save Video", "Stream is null", "OK");
124+
}
125+
else
126+
{
127+
await fileSaver.SaveAsync("recording.mp4", videoRecordingStream);
128+
await videoRecordingStream.DisposeAsync();
129+
videoRecordingStream = Stream.Null;
130+
}
131+
}
97132
}

samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/PopupsPage.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
<Button Text="Updating Popup" Command="{Binding UpdatingPopupCommand}" />
3636

3737
<Button Text="Show Popup content" Command="{Binding ShowPopupContentCommand}" />
38+
39+
<Button Text="Show Popup in a Modal Page in a Custom Navigation Page" Clicked="HandleModalPopupInCustomNavigationPage" />
3840

3941
<Button Text="Custom Positioning Popup" Clicked="HandlePopupPositionButtonClicked" />
4042

samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/PopupsPage.xaml.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ public PopupsPage(PopupsViewModel multiplePopupViewModel, IPopupService popupSer
2020
InitializeComponent();
2121
}
2222

23+
protected override async void OnNavigatedTo(NavigatedToEventArgs args)
24+
{
25+
base.OnNavigatedTo(args);
26+
if (args.WasPreviousPageACommunityToolkitPopupPage())
27+
{
28+
await Toast.Make("Popup Closed").Show();
29+
}
30+
}
31+
2332
async void HandleSimplePopupButtonClicked(object sender, EventArgs e)
2433
{
2534
var queryAttributes = new Dictionary<string, object>
@@ -160,6 +169,29 @@ async void HandleComplexPopupClicked(object? sender, EventArgs e)
160169
// Display Popup Result as a Toast
161170
await Toast.Make($"You entered {popupResult.Result}").Show(CancellationToken.None);
162171
}
172+
}
173+
174+
async void HandleModalPopupInCustomNavigationPage(object? sender, EventArgs eventArgs)
175+
{
176+
var modalPopupPage = new ContentPage
177+
{
178+
Content = new VerticalStackLayout
179+
{
180+
Spacing = 24,
181+
Children =
182+
{
183+
new Button()
184+
.Text("Show Popup")
185+
.Invoke(button => button.Command = new Command(async () => await popupService.ShowPopupAsync<ButtonPopup>(Shell.Current))),
186+
187+
new Button()
188+
.Text("Back")
189+
.Invoke(button => button.Command = new Command(async () => await Navigation.PopModalAsync()))
190+
}
191+
}.Center()
192+
};
163193

194+
var customNavigationPage = new NavigationPage(modalPopupPage);
195+
await Shell.Current.Navigation.PushModalAsync(customNavigationPage, true);
164196
}
165197
}

samples/CommunityToolkit.Maui.Sample/ViewModels/Views/CameraView/CameraViewViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ void UpdateResolutionText()
107107
{
108108
ResolutionText = $"Selected Resolution: {SelectedResolution.Width} x {SelectedResolution.Height}";
109109
}
110-
110+
111111
void HandleAvailableCamerasChanged(object? sender, IReadOnlyList<CameraInfo>? e)
112112
{
113113
OnPropertyChanged(nameof(Cameras));

0 commit comments

Comments
 (0)