Skip to content

Commit

Permalink
Merge v.next into main (#1225)
Browse files Browse the repository at this point in the history
Co-authored-by: Andy Weis <[email protected]>
Co-authored-by: William Bohrmann <[email protected]>
Co-authored-by: Zack Allen <[email protected]>
Co-authored-by: Morten Nielsen <[email protected]>
Co-authored-by: William Bohrmann <[email protected]>
Co-authored-by: Preeti <[email protected]>
  • Loading branch information
7 people authored Apr 19, 2023
1 parent 85adf66 commit 4d12ac4
Show file tree
Hide file tree
Showing 801 changed files with 2,838 additions and 908 deletions.
11 changes: 11 additions & 0 deletions src/MAUI/Maui.Samples/ApiKeyPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="ArcGIS.ApiKeyPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:arcgisruntime="clr-namespace:ArcGIS"
Title="API Key">
<Grid>
<arcgisruntime:ApiKeyView />
</Grid>
</ContentPage>
9 changes: 9 additions & 0 deletions src/MAUI/Maui.Samples/ApiKeyPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace ArcGIS;

public partial class ApiKeyPage : ContentPage
{
public ApiKeyPage()
{
InitializeComponent();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="ArcGIS.ApiKeyPrompt"
<ContentView
x:Class="ArcGIS.ApiKeyView"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Title="Manage API key">
<ContentPage.Content>
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<ContentView.Content>
<StackLayout Orientation="Vertical">
<Label x:Name="Instructions" Margin="5">
<Label.FormattedText>
Expand Down Expand Up @@ -44,5 +43,5 @@
</StackLayout>
<Label x:Name="Status" Margin="5,0,0,0" />
</StackLayout>
</ContentPage.Content>
</ContentPage>
</ContentView.Content>
</ContentView>
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
namespace ArcGIS
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class ApiKeyPrompt : ContentPage
public partial class ApiKeyView : ContentView
{
public ApiKeyPrompt()
public ApiKeyView()
{
InitializeComponent();
Initialize();
Expand Down
10 changes: 5 additions & 5 deletions src/MAUI/Maui.Samples/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:ArcGISRuntime.Samples.Maui"
x:Class="ArcGIS.Samples.Maui.App">
<?xml version="1.0" encoding="UTF-8" ?>
<Application
x:Class="ArcGIS.Samples.Maui.App"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
Expand Down
2 changes: 1 addition & 1 deletion src/MAUI/Maui.Samples/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public App()
{
InitializeComponent();

MainPage = new NavigationPage(new CategoryListPage() { });
MainPage = new AppShell();
Current = this;
}
}
15 changes: 15 additions & 0 deletions src/MAUI/Maui.Samples/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="ArcGIS.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Shell.TabBarIsVisible="False">
<Shell.FlyoutHeader>
<Label
Margin="0,5"
FontAttributes="Bold"
HorizontalTextAlignment="Center"
Text="Categories"
VerticalTextAlignment="Center" />
</Shell.FlyoutHeader>
</Shell>
64 changes: 64 additions & 0 deletions src/MAUI/Maui.Samples/AppShell.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
using ArcGIS.Samples.Managers;
using ArcGIS.Samples.Shared.Managers;
using ArcGIS.Samples.Shared.Models;

namespace ArcGIS;

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

Initialize();
}

private void Initialize()
{
this.Appearing += FirstLoaded;

SampleManager.Current.Initialize();

var samplesCategories = SampleManager.Current.FullTree.Items.OfType<SearchableTreeNode>().ToList();
var allSamples = SampleManager.Current.AllSamples.ToList();

List<FlyoutItem> flyoutItems = new List<FlyoutItem>();

foreach (var category in samplesCategories)
{
FlyoutItem flyoutItem = new FlyoutItem();
flyoutItem.Title = category.Name;

ShellContent shellContent = new ShellContent();
//shellContent.Title = category.Name;
shellContent.Content = new CategoryPage(category);
shellContent.Route = $"{nameof(CategoryPage)}_{category.Name}";

flyoutItem.Items.Add(shellContent);

this.Items.Add(flyoutItem);
}
}

#region Check API Key
private void FirstLoaded(object sender, EventArgs e)
{
this.Appearing -= FirstLoaded;

_ = CheckApiKey();
}

private async Task CheckApiKey()
{
// Attempt to load a locally stored API key.
await ApiKeyManager.TrySetLocalKey();

// Check that the current API key is valid.
ApiKeyStatus status = await ApiKeyManager.CheckKeyValidity();
if (status != ApiKeyStatus.Valid)
{
await Navigation.PushAsync(new ApiKeyPage(), true);
}
}
#endregion
}
64 changes: 52 additions & 12 deletions src/MAUI/Maui.Samples/ArcGIS.Samples.Maui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
<None Remove="Samples\MapView\FilterByTimeExtent\**" />
</ItemGroup>

<!-- Exclude some samples on mac catalyst -->
<ItemGroup Condition="$(TargetFramework.StartsWith('net7.0-maccatalyst')) == true">
<!-- Exclude Indoor Positioning on desktop platforms -->
<ItemGroup Condition="$(TargetFramework.StartsWith('net7.0-maccatalyst')) or $(TargetFramework.StartsWith('net7.0-windows'))">
<AndroidResource Remove="Samples\Location\IndoorPositioning\**" />
<Compile Remove="Samples\Location\IndoorPositioning\**" />
<EmbeddedResource Remove="Samples\Location\IndoorPositioning\**" />
Expand All @@ -82,35 +82,40 @@
<ItemGroup>
<None Remove="Resources\SettingsPage\*.md" />
<EmbeddedResource Include="Resources\SettingsPage\*.md" />
<Content Include="Samples\**\*.md" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'" />
<Content Include="Samples\**\*.jpg" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'" />
<BundleResource Include="Samples\**\*.md" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'iOS'" />
<AndroidAsset Include="Samples\**\*.jpg" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'" />
<AndroidAsset Include="Samples\**\*.md" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'" />
</ItemGroup>

<!-- Resource outputs for description and source code viewing -->
<ItemGroup>
<EmbeddedResource Include="Samples\**\*.md" />
<EmbeddedResource Include="Samples\**\*.jpg" />
<None Remove="Samples\**\*.md" />
<MauiAsset Include="Samples\**\*.md" />
<MauiImage Include="Samples\**\*.jpg" />
<EmbeddedResource Include="Samples\**\*.cs" />
<EmbeddedResource Include="Helpers\**\*.cs" />
<EmbeddedResource Include="SyntaxHighlighting\highlight.js" />
</ItemGroup>

<ItemGroup>
<MauiImage Include="Resources\Thumbnails\placeholder_android.jpg" />
<None Remove="Resources\Icons\*.svg" />
<MauiImage Include="Resources\Icons\*.svg" />
</ItemGroup>

<ItemGroup>
<None Remove="Resources\Fonts\calcite-ui-icons-24.ttf" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Helpers\SampleTreeViewBuilder.cs" />
</ItemGroup>
<ItemGroup>
<MauiImage Include="Resources\Thumbnails\placeholder_ios.jpg" />
<MauiImage Include="Resources\Thumbnails\placeholder_maccatalyst.jpg" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\PictureMarkerSymbols\pin_blue.png" />
<EmbeddedResource Include="Resources\PictureMarkerSymbols\pin_star_blue.png" />
</ItemGroup>
<ItemGroup>
<MauiAsset Include="Resources\Thumbnails\placeholder_windows.jpg" />
<MauiAsset Include="SyntaxHighlighting\github-markdown.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</MauiAsset>
Expand All @@ -128,10 +133,13 @@
</MauiAsset>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Esri.ArcGISRuntime.Hydrography" Version="200.0.0" />
<PackageReference Include="Esri.ArcGISRuntime.Maui" Version="200.0.0" />
<PackageReference Include="Esri.ArcGISRuntime.Toolkit.Maui" Version="200.0.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="5.0.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.1.0" />
<PackageReference Include="Esri.ArcGISRuntime.Hydrography" Version="200.1.0" />
<PackageReference Include="Esri.ArcGISRuntime.Maui" Version="200.1.0" />
<PackageReference Include="Esri.ArcGISRuntime.Toolkit.Maui" Version="200.1.0" />
<PackageReference Include="Markdig" Version="0.30.4" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
</ItemGroup>

<!-- WinUIEx is used to workaround the lack of a WebAuthenticationBroker for WinUI. https://github.com/microsoft/WindowsAppSDK/issues/441 -->
Expand All @@ -145,6 +153,38 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<Compile Update="ApiKeyView.xaml.cs">
<DependentUpon>ApiKeyView.xaml</DependentUpon>
</Compile>
<Compile Update="AppShell.xaml.cs">
<DependentUpon>AppShell.xaml</DependentUpon>
</Compile>
<Compile Update="ScreenshotView.xaml.cs">
<DependentUpon>ScreenshotView.xaml</DependentUpon>
</Compile>
<Compile Update="SettingsPage.xaml.cs">
<DependentUpon>SettingsPage.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<MauiXaml Update="ApiKeyPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="AppShell.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="CategoryPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ScreenshotView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="SearchPopup.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="SettingsPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiFont Update="Resources\Fonts\calcite-ui-icons-24.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</MauiFont>
Expand Down
44 changes: 0 additions & 44 deletions src/MAUI/Maui.Samples/CategoryListPage.xaml

This file was deleted.

Loading

0 comments on commit 4d12ac4

Please sign in to comment.