Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace all StackLayout with Grid or Horizontal-/VerticalStackLayout #468

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions 8.0/Animations/Animations/Pages/EasingEditorPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@



<ScrollView Grid.Row="2">
<StackLayout Spacing="0">
<ScrollView Grid.Row="2">
<VerticalStackLayout Spacing="0">
<FlexLayout HorizontalOptions="Center" AlignItems="Center"
BackgroundColor="#1d1d1d">
<BoxView FlexLayout.Grow="1" />
Expand Down Expand Up @@ -90,8 +90,8 @@
</TableSection>
</TableView>

</StackLayout>
</VerticalStackLayout>
</ScrollView>
</Grid>
</Grid>
</ContentPage.Content>
</ContentPage>
4 changes: 2 additions & 2 deletions 8.0/Animations/Animations/Pages/EasingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
x:Class="Animations.EasingsPage">

<ScrollView>
<StackLayout Margin="15" Spacing="30">
<VerticalStackLayout Margin="15" Spacing="30">
<Label Text="Easing functions specify the rate of change of a parameter over time.&lt;br&gt;&lt;br&gt;Explore the easing functions below. Double-tap to visit the easing editor for more options."
TextType="Html"
/>
Expand Down Expand Up @@ -220,6 +220,6 @@
Stroke="{StaticResource InOutGradient}"/>
</controls:EasingCard>
</FlexLayout>
</StackLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
110 changes: 55 additions & 55 deletions 8.0/Apps/BugSweeper/BugSweeper/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -1,105 +1,105 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:BugSweeper"
x:Class="BugSweeper.MainPage"
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:BugSweeper"
x:Class="BugSweeper.MainPage"
Title="Bug Sweeper">
<Grid RowDefinitions="Auto,*">
<VerticalStackLayout>
<Label Text="Tap to flag/unflag a potential bug."
<Label Text="Tap to flag/unflag a potential bug."
HorizontalTextAlignment="Center" />
<Label Text="Double-tap if you're sure it's not a bug."
Margin="0,10,0,0"
VerticalOptions="Center"
<Label Text="Double-tap if you're sure it's not a bug."
Margin="0,10,0,0"
VerticalOptions="Center"
HorizontalTextAlignment="Center" />
<Label Text="The first double-tap is always safe!"
Margin="0,10,0,0"
VerticalOptions="Center"
<Label Text="The first double-tap is always safe!"
Margin="0,10,0,0"
VerticalOptions="Center"
HorizontalTextAlignment="Center" />
<Label Margin="0,10,0,0"
<Label Margin="0,10,0,0"
HorizontalTextAlignment="Center">
<Label.FormattedText>
<FormattedString>
<Span Text="{Binding FlaggedTileCount, StringFormat='Flagged {0} '}"
<Span Text="{Binding FlaggedTileCount, StringFormat='Flagged {0} '}"
BindingContext="{x:Reference board}" />
<Span Text="{Binding BugCount, StringFormat=' out of {0} bugs.'}"
<Span Text="{Binding BugCount, StringFormat=' out of {0} bugs.'}"
BindingContext="{x:Reference board}" />
</FormattedString>
</Label.FormattedText>
</Label>
<Label x:Name="timeLabel"
Text="0:00"
Margin="0,10,0,0"
<Label x:Name="timeLabel"
Text="0:00"
Margin="0,10,0,0"
HorizontalTextAlignment="Center" />
</VerticalStackLayout>

<!-- Single-cell Grid for Board and overlays. -->
<Grid Grid.Row="1"
<Grid Grid.Row="1"
SizeChanged="OnBoardGridSizeChanged">
<local:Board x:Name="board" />
<StackLayout x:Name="congratulationsText"
Orientation="Horizontal"
HorizontalOptions="Center">
<Label Text="C"
<HorizontalStackLayout
x:Name="congratulationsText"
HorizontalOptions="Center">
<Label Text="C"
TextColor="Red" />
<Label Text="O"
<Label Text="O"
TextColor="Red" />
<Label Text="N"
<Label Text="N"
TextColor="Red" />
<Label Text="G"
<Label Text="G"
TextColor="Red" />
<Label Text="R"
<Label Text="R"
TextColor="Red" />
<Label Text="A"
<Label Text="A"
TextColor="Red" />
<Label Text="T"
<Label Text="T"
TextColor="Red" />
<Label Text="U"
<Label Text="U"
TextColor="Red" />
<Label Text="L"
<Label Text="L"
TextColor="Red" />
<Label Text="A"
<Label Text="A"
TextColor="Red" />
<Label Text="T"
<Label Text="T"
TextColor="Red" />
<Label Text="I"
<Label Text="I"
TextColor="Red" />
<Label Text="O"
<Label Text="O"
TextColor="Red" />
<Label Text="N"
<Label Text="N"
TextColor="Red" />
<Label Text="S"
<Label Text="S"
TextColor="Red" />
<Label Text="!"
<Label Text="!"
TextColor="Red" />
</StackLayout>
<HorizontalStackLayout x:Name="consolationText"
</HorizontalStackLayout>
<HorizontalStackLayout x:Name="consolationText"
HorizontalOptions="Center">
<Label Text="T"
<Label Text="T"
TextColor="Red" />
<Label Text="O"
<Label Text="O"
TextColor="Red" />
<Label Text="O"
<Label Text="O"
TextColor="Red" />
<Label Text=" "
<Label Text=" "
TextColor="Red" />
<Label Text="B"
<Label Text="B"
TextColor="Red" />
<Label Text="A"
<Label Text="A"
TextColor="Red" />
<Label Text="D"
<Label Text="D"
TextColor="Red" />
<Label Text="!"
<Label Text="!"
TextColor="Red" />
</HorizontalStackLayout>
<Button x:Name="playAgainButton"
Text=" Play Another Game? "
HorizontalOptions="Center"
VerticalOptions="Center"
Clicked="OnplayAgainButtonClicked"
BorderColor="Black"
BorderWidth="2"
BackgroundColor="White"
<Button x:Name="playAgainButton"
Text=" Play Another Game? "
HorizontalOptions="Center"
VerticalOptions="Center"
Clicked="OnplayAgainButtonClicked"
BorderColor="Black"
BorderWidth="2"
BackgroundColor="White"
TextColor="Black" />
</Grid>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@

<!-- Main Section -->
<ScrollView>
<VerticalStackLayout>
<Grid>

<!-- Search Box -->
<HorizontalStackLayout
Expand All @@ -147,39 +147,39 @@
</HorizontalStackLayout>

<!-- Actual Content -->
<CollectionView
Margin="15"
ItemsSource="{Binding Favorites}"
ItemTemplate="{StaticResource FavTemplate}">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical"
Span="2"
VerticalItemSpacing="8"
HorizontalItemSpacing="8"/>
</CollectionView.ItemsLayout>
<CollectionView.FooterTemplate>
<DataTemplate>
<Border
HeightRequest="132"
WidthRequest="132"
HorizontalOptions="Start"
Margin="{OnIdiom Phone=15,Default=25}"
Stroke="Transparent"
StrokeThickness="1"
BackgroundColor="{StaticResource Background_Mid}">
<Border.StrokeShape>
<RoundRectangle CornerRadius="60"/>
</Border.StrokeShape>
<ImageButton
BackgroundColor="Transparent"
Source="add_icon.png"
VerticalOptions="Center" HorizontalOptions="Center"/>
</Border>
</DataTemplate>
</CollectionView.FooterTemplate>
</CollectionView>
<CollectionView
Margin="15"
ItemsSource="{Binding Favorites}"
ItemTemplate="{StaticResource FavTemplate}">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical"
Span="2"
VerticalItemSpacing="8"
HorizontalItemSpacing="8"/>
</CollectionView.ItemsLayout>
<CollectionView.FooterTemplate>
<DataTemplate>
<Border
HeightRequest="132"
WidthRequest="132"
HorizontalOptions="Start"
Margin="{OnIdiom Phone=15,Default=25}"
Stroke="Transparent"
StrokeThickness="1"
BackgroundColor="{StaticResource Background_Mid}">
<Border.StrokeShape>
<RoundRectangle CornerRadius="60"/>
</Border.StrokeShape>
<ImageButton
BackgroundColor="Transparent"
Source="add_icon.png"
VerticalOptions="Center" HorizontalOptions="Center"/>
</Border>
</DataTemplate>
</CollectionView.FooterTemplate>
</CollectionView>

</VerticalStackLayout>
</Grid>
</ScrollView>

</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,16 @@

<Grid>
<Label Text="Theme" class="Subhead"/>
<StackLayout
<HorizontalStackLayout
HorizontalOptions="End"
Spacing="12"
Orientation="Horizontal"
RadioButtonGroup.GroupName="AppTheme"
RadioButtonGroup.SelectedValue="{Binding SelectedTheme}">
<StackLayout.Resources>
RadioButtonGroup.GroupName="AppTheme"
RadioButtonGroup.SelectedValue="{Binding SelectedTheme}">
<HorizontalStackLayout.Resources>
<Style TargetType="RadioButton">
<Setter Property="ControlTemplate" Value="{StaticResource ThemeRadioTemplate}"/>
</Style>
</StackLayout.Resources>
</HorizontalStackLayout.Resources>
<RadioButton Value="{x:Static am:AppTheme.Unspecified}"
IsChecked="True"
CheckedChanged="RadioButton_CheckedChanged"
Expand Down Expand Up @@ -287,7 +286,7 @@
</Grid>
</RadioButton.Content>
</RadioButton>
</StackLayout>
</HorizontalStackLayout>
</Grid>

</VerticalStackLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,13 @@
VerticalOptions="Start"
HorizontalOptions="End"/>

<StackLayout HorizontalOptions="Start"
<VerticalStackLayout HorizontalOptions="Start"
Spacing="0"
VerticalOptions="End">
<Label Text="2%" class="LargeTitle"/>
<Label Text="From" class="Subhead"/>
<Label Text="Pond Elementary" class="SubContent"/>
</StackLayout>
</VerticalStackLayout>
</Grid>
</Frame>
</DataTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
BindableLayout.ItemsSource="{Binding Hours}">
<BindableLayout.ItemTemplate>
<DataTemplate>
<StackLayout>
<VerticalStackLayout>
<Label
Text="{Binding DateTime, StringFormat='{0:h tt}'}"
class="Small"
Expand All @@ -30,7 +30,7 @@
Text="{Binding Temperature.Minimum.Value, StringFormat='{0:F0}°'}"
class="Subhead"
HorizontalOptions="Center"/>
</StackLayout>
</VerticalStackLayout>
</DataTemplate>
</BindableLayout.ItemTemplate>
</HorizontalStackLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@
Margin="{Binding Temperature.Minimum.Value, Converter={StaticResource MinTempOffsetConverter}}"
/>
<BoxView class="HRule"/>
<StackLayout
Orientation="Horizontal"
<HorizontalStackLayout
HeightRequest="40"
HorizontalOptions="Center">
<Image
Expand All @@ -72,8 +71,7 @@
Text="13%"
class="SubContent"
VerticalOptions="Center"/>
</StackLayout>

</HorizontalStackLayout>
</VerticalStackLayout>
</DataTemplate>
</BindableLayout.ItemTemplate>
Expand Down
Loading
Loading