-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
3,150 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Droid/Properties/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="Uno.Toolkit.Samples" android:versionCode="1" android:versionName="1.0" android:installLocation="auto"> | ||
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="29" /> | ||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31" /> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<application android:label="Uno.Toolkit.Samples"></application> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...s/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/Content/Controls/SafeAreaSamplePage.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<Page x:Class="Uno.Toolkit.Samples.Content.Controls.SafeAreaSamplePage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="using:Uno.Toolkit.Samples.Content.Controls" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:sample="using:Uno.Toolkit.Samples" | ||
xmlns:utu="using:Uno.Toolkit.UI" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" | ||
mc:Ignorable="d"> | ||
|
||
<sample:SamplePageLayout IsDesignAgnostic="True"> | ||
<sample:SamplePageLayout.DesignAgnosticTemplate> | ||
<DataTemplate> | ||
<StackPanel Margin="0,20" Spacing="20"> | ||
<Button HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
AutomationProperties.AutomationId="SafeArea_Launch_AP_Sample_Button" | ||
Click="LaunchAPSample" | ||
Content="Show Sample using Attached Properties" /> | ||
|
||
<Button HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
AutomationProperties.AutomationId="SafeArea_Launch_Control_Sample_Button" | ||
Click="LaunchControlSample" | ||
Content="Show Sample using SafeArea Control" /> | ||
|
||
<Button HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
AutomationProperties.AutomationId="SafeArea_Launch_SoftInput_Sample_Button" | ||
Click="LaunchSoftInputSample" | ||
Content="Show SoftInput Sample" /> | ||
|
||
</StackPanel> | ||
</DataTemplate> | ||
</sample:SamplePageLayout.DesignAgnosticTemplate> | ||
</sample:SamplePageLayout> | ||
</Page> |
55 changes: 55 additions & 0 deletions
55
...no.Toolkit.Samples/Uno.Toolkit.Samples.Shared/Content/Controls/SafeAreaSamplePage.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Uno.Toolkit.Samples.Entities; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Uno.Toolkit.Samples.Content.NestedSamples; | ||
using Uno.Toolkit.UI; | ||
using Uno.Toolkit.Samples.Helpers; | ||
#if IS_WINUI | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
using Microsoft.UI.Xaml.Controls.Primitives; | ||
using Microsoft.UI.Xaml.Data; | ||
using Microsoft.UI.Xaml.Input; | ||
using Microsoft.UI.Xaml.Media; | ||
using Microsoft.UI.Xaml.Navigation; | ||
#else | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
#endif | ||
|
||
namespace Uno.Toolkit.Samples.Content.Controls | ||
{ | ||
[SamplePage(SampleCategory.Controls, nameof(SafeArea))] | ||
public sealed partial class SafeAreaSamplePage : Page | ||
{ | ||
public SafeAreaSamplePage() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private void LaunchAPSample(object sender, RoutedEventArgs e) | ||
{ | ||
Shell.GetForCurrentView().ShowNestedSample<SafeAreaSamplePage_NestedPage>(clearStack: true); | ||
} | ||
|
||
private void LaunchControlSample(object sender, RoutedEventArgs e) | ||
{ | ||
Shell.GetForCurrentView().ShowNestedSample<SafeArea_Control_NestedPage>(clearStack: true); | ||
} | ||
|
||
private void LaunchSoftInputSample(object sender, RoutedEventArgs e) | ||
{ | ||
Shell.GetForCurrentView().ShowNestedSample<SafeArea_SoftInput_NestedPage>(clearStack: true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
...mples/Uno.Toolkit.Samples.Shared/Content/NestedSamples/SafeAreaSamplePage_NestedPage.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<Page x:Class="Uno.Toolkit.Samples.Content.NestedSamples.SafeAreaSamplePage_NestedPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="using:Uno.Toolkit.Samples.Content.NestedSamples" | ||
xmlns:um="using:Uno.Material" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls" | ||
xmlns:toolkit="using:Uno.UI.Toolkit" | ||
xmlns:utu="using:Uno.Toolkit.UI" | ||
Background="Green" | ||
mc:Ignorable="d"> | ||
<Grid AutomationProperties.AutomationId="WrappingGrid"> | ||
<Border x:Name="MyBorder" | ||
AutomationProperties.AutomationId="MyBorder" | ||
HorizontalAlignment="Stretch" | ||
VerticalAlignment="Stretch" | ||
Background="Red" | ||
BorderBrush="Yellow" | ||
BorderThickness="{Binding RelativeSource={RelativeSource Self}, Path=Padding}"> | ||
<StackPanel HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
Spacing="10"> | ||
<Button AutomationProperties.AutomationId="ExitSampleButton" | ||
Content="Exit Sample" | ||
HorizontalAlignment="Center" | ||
Click="ExitSample"> | ||
<um:ControlExtensions.Icon> | ||
<SymbolIcon Symbol="Cancel"/> | ||
</um:ControlExtensions.Icon> | ||
</Button> | ||
<muxc:RadioButtons HorizontalAlignment="Center" | ||
Header="Inset Mode:"> | ||
<RadioButton x:Name="PaddingMode" | ||
Checked="PaddingChecked" | ||
Content="Padding" | ||
IsChecked="True" /> | ||
<RadioButton x:Name="MarginMode" | ||
Checked="MarginChecked" | ||
Content="Margin" /> | ||
</muxc:RadioButtons> | ||
<TextBlock HorizontalAlignment="Center" | ||
Text="Inset Mask:" /> | ||
<StackPanel HorizontalAlignment="Center" | ||
Orientation="Horizontal"> | ||
<CheckBox x:Name="LeftMask" | ||
Checked="LeftChecked" | ||
Content="Left" | ||
Unchecked="LeftUnchecked" /> | ||
<CheckBox x:Name="TopMask" | ||
Checked="TopChecked" | ||
Content="Top" | ||
Unchecked="TopUnchecked" /> | ||
<CheckBox x:Name="RightMask" | ||
Checked="RightChecked" | ||
Content="Right" | ||
Unchecked="RightUnchecked" /> | ||
<CheckBox x:Name="BottomMask" | ||
Checked="BottomChecked" | ||
Content="Bottom" | ||
Unchecked="BottomUnchecked" /> | ||
</StackPanel> | ||
<Button AutomationProperties.AutomationId="ClearMasks" | ||
HorizontalAlignment="Center" | ||
Click="ClearAllMasks" | ||
Content="Clear Masks" /> | ||
<Button AutomationProperties.AutomationId="SetAllTwenty" | ||
HorizontalAlignment="Center" | ||
Click="AllTwenty" | ||
Content="All 20" /> | ||
<TextBlock HorizontalAlignment="Center" | ||
Text="SafeArea Override:" /> | ||
<Border utu:SafeArea.Insets="SoftInput"> | ||
<StackPanel HorizontalAlignment="Center" | ||
Orientation="Horizontal" | ||
Spacing="10"> | ||
<TextBox x:Name="OverrideInsetLeft" | ||
AutomationProperties.AutomationId="OverrideInsetLeft" | ||
Header="Left" | ||
TextChanged="UpdateInsets" /> | ||
<TextBox x:Name="OverrideInsetTop" | ||
AutomationProperties.AutomationId="OverrideInsetTop" | ||
Header="Top" | ||
TextChanged="UpdateInsets" /> | ||
<TextBox x:Name="OverrideInsetRight" | ||
AutomationProperties.AutomationId="OverrideInsetRight" | ||
Header="Right" | ||
TextChanged="UpdateInsets" /> | ||
<TextBox x:Name="OverrideInsetBottom" | ||
AutomationProperties.AutomationId="OverrideInsetBottom" | ||
Header="Bottom" | ||
TextChanged="UpdateInsets" /> | ||
</StackPanel> | ||
</Border> | ||
</StackPanel> | ||
</Border> | ||
<!--<Border Background="Blue" | ||
Grid.Row="1" | ||
HorizontalAlignment="Stretch" | ||
VerticalAlignment="Stretch" | ||
BorderThickness="30" | ||
BorderBrush="Purple"/>--> | ||
</Grid> | ||
</Page> |
Oops, something went wrong.