Skip to content

Commit 23cfd7d

Browse files
Added more test cases
1 parent 86397f0 commit 23cfd7d

File tree

3 files changed

+859
-0
lines changed

3 files changed

+859
-0
lines changed
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
x:Class="Maui.Controls.Sample.Issues.Issue28986_SafeAreaBorderOrientation"
5+
Title="SafeArea Border Orientation Test">
6+
7+
<!-- Border with SafeAreaEdges property for orientation testing -->
8+
<Border x:Name="TestBorder"
9+
SafeAreaEdges="All"
10+
BackgroundColor="LightBlue"
11+
Stroke="DarkBlue"
12+
StrokeThickness="5">
13+
<ScrollView SafeAreaEdges="None"
14+
x:Name="BorderContent"
15+
AutomationId="BorderContent"
16+
BackgroundColor="White">
17+
<StackLayout Spacing="20"
18+
Padding="20">
19+
<Label Text="SafeArea Border Orientation Test"
20+
FontSize="24"
21+
FontAttributes="Bold"
22+
HorizontalOptions="Center"/>
23+
24+
<Label Text="This test validates safe area behavior during orientation changes."
25+
FontSize="14"
26+
HorizontalOptions="Center"/>
27+
28+
<Label x:Name="CurrentOrientationLabel"
29+
Text="Current Orientation: Portrait"
30+
FontSize="16"
31+
FontAttributes="Bold"
32+
HorizontalOptions="Center"
33+
AutomationId="CurrentOrientation"/>
34+
35+
<Label x:Name="BorderDimensionsLabel"
36+
Text="Border Dimensions: Loading..."
37+
FontSize="16"
38+
FontAttributes="Bold"
39+
HorizontalOptions="Center"
40+
AutomationId="BorderDimensions"/>
41+
42+
<Label x:Name="SafeAreaInsetsLabel"
43+
Text="Safe Area Insets: Loading..."
44+
FontSize="16"
45+
FontAttributes="Bold"
46+
HorizontalOptions="Center"
47+
AutomationId="SafeAreaInsets"/>
48+
49+
<!-- Control panel -->
50+
<Border BackgroundColor="LightGray"
51+
Stroke="Gray"
52+
StrokeThickness="2"
53+
Padding="15">
54+
<VerticalStackLayout Spacing="15">
55+
<Label Text="Orientation Test Controls (Use Test API):"
56+
FontSize="18"
57+
FontAttributes="Bold"
58+
HorizontalOptions="Center"/>
59+
60+
<Label Text="Real Orientation Change:"
61+
FontSize="14"
62+
FontAttributes="Bold"/>
63+
<Label Text="• Portrait→Landscape: App.SetOrientationLandscape()"
64+
FontSize="12"/>
65+
<Label Text="• Landscape→Portrait: App.SetOrientationPortrait()"
66+
FontSize="12"/>
67+
68+
<Button Text="Info: Use SetOrientationLandscape() in Test"
69+
Clicked="OnSimulateOrientationClicked"
70+
AutomationId="SimulateOrientationButton"/>
71+
72+
<Button Text="Info: Use SetOrientationPortrait() in Test"
73+
Clicked="OnResetToPortraitClicked"
74+
AutomationId="ResetToPortraitButton"/>
75+
76+
<Button Text="Toggle Border SafeAreaEdges"
77+
Clicked="OnToggleSafeAreaEdgesClicked"
78+
AutomationId="ToggleSafeAreaEdgesButton"/>
79+
80+
<Label x:Name="TestStatusLabel"
81+
Text="Test Status: Ready - Use real orientation APIs in tests"
82+
FontSize="14"
83+
HorizontalOptions="Center"
84+
AutomationId="TestStatus"/>
85+
</VerticalStackLayout>
86+
</Border>
87+
88+
<!-- Test content for soft input -->
89+
<Border BackgroundColor="LightYellow"
90+
Stroke="Orange"
91+
StrokeThickness="2"
92+
Padding="15">
93+
<VerticalStackLayout Spacing="10">
94+
<Label Text="Soft Input Test (Bottom Edge: SoftInput):"
95+
FontSize="16"
96+
FontAttributes="Bold"/>
97+
98+
<Entry x:Name="TestEntry"
99+
Placeholder="Tap to show keyboard"
100+
AutomationId="TestEntry"/>
101+
102+
<Button Text="Set Bottom Edge to SoftInput"
103+
Clicked="OnSetBottomSoftInputClicked"
104+
AutomationId="SetBottomSoftInputButton"/>
105+
106+
<Button Text="Set Bottom Edge to All"
107+
Clicked="OnSetBottomAllClicked"
108+
AutomationId="SetBottomAllButton"/>
109+
110+
<Label x:Name="KeyboardStatusLabel"
111+
Text="Keyboard Status: Hidden"
112+
FontSize="14"
113+
AutomationId="KeyboardStatus"/>
114+
</VerticalStackLayout>
115+
</Border>
116+
117+
<!-- Sample content to test positioning -->
118+
<StackLayout Spacing="10">
119+
<Label Text="Sample Content for Position Testing"
120+
FontSize="18"
121+
FontAttributes="Bold"/>
122+
<BoxView Color="Red"
123+
HeightRequest="50"
124+
WidthRequest="100"
125+
HorizontalOptions="Start"
126+
AutomationId="TopLeftMarker"/>
127+
<BoxView Color="Green"
128+
HeightRequest="50"
129+
WidthRequest="100"
130+
HorizontalOptions="End"
131+
AutomationId="TopRightMarker"/>
132+
<Label Text="Content Line 1"/>
133+
<Label Text="Content Line 2"/>
134+
<Label Text="Content Line 3"/>
135+
<Label Text="Content Line 4"/>
136+
<Label Text="Content Line 5"/>
137+
<BoxView Color="Blue"
138+
HeightRequest="50"
139+
WidthRequest="100"
140+
HorizontalOptions="Center"
141+
AutomationId="BottomMarker"/>
142+
<Label Text="End of Test Content"
143+
FontSize="18"
144+
FontAttributes="Bold"/>
145+
</StackLayout>
146+
</StackLayout>
147+
</ScrollView>
148+
</Border>
149+
</ContentPage>

0 commit comments

Comments
 (0)