Skip to content

Commit

Permalink
🚀 [Code] Updated the functionalities to .NET 8 c6
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmonettelli committed Mar 18, 2024
1 parent 61b61c9 commit 3a396e7
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 38 deletions.
4 changes: 2 additions & 2 deletions Mitawi/Mitawi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
<PackageReference Include="FFImageLoadingCompat.Maui" Version="0.1.1" />
<PackageReference Include="FFImageLoadingCompat.Transformations" Version="0.1.1" />
<PackageReference Include="HorusStudio.Maui.Skeleton" Version="2.0.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.7" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.7" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.10" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.10" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="OnScreenSizeMarkup.Maui" Version="3.0.18" />
</ItemGroup>
Expand Down
13 changes: 8 additions & 5 deletions Mitawi/ViewModels/HomeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ private async Task FullUpdate()
}

[RelayCommand]
private void SelectedHourly(Hourly hourly)
private async Task SelectedHourly(Hourly hourly)
{
if (hourly is not null)
{
IsAnimationSkeleton = true;

Task.Delay(1000).ContinueWith((t) =>
MyHourly = hourly;

await Task.Delay(1000).ContinueWith((t) =>
{
IsAnimationSkeleton = false;
});

MyHourly = hourly;
}
}

Expand Down Expand Up @@ -82,7 +82,10 @@ private async Task WeatherDataFlow()
// Get current time schedule
MyHourly = Hourlies.ElementAt(0);

IsLoading = false;
await Task.Delay(600).ContinueWith((t) =>
{
IsLoading = false;
});
}

}
58 changes: 28 additions & 30 deletions Mitawi/Views/HomePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@
<ScrollView
x:Name="scrollForecast24Hours"
Padding="16,0"
Orientation="Horizontal"
Style="{StaticResource vsm_orientation_scrollForecast24Hours}">

<mct:UniformItemsLayout
Expand Down Expand Up @@ -419,42 +418,41 @@
</ScrollView>
<!--#endregion-->

<BoxView
Grid.Row="0"
Grid.RowSpan="5"
Margin="-16,0,-16,-8"
<!--#region Loading-->
<Border
x:Name="borderLoading"
HorizontalOptions="FillAndExpand"
IsEnabled="{Binding IsLoading}"
IsVisible="{Binding IsLoading}">
<BoxView.Background>
IsVisible="{Binding IsLoading}"
StrokeThickness="0"
Style="{StaticResource vsm_orientation_borderLoading}"
VerticalOptions="FillAndExpand">
<Border.Background>
<LinearGradientBrush EndPoint="0,1">
<GradientStop Offset="0" Color="{StaticResource col_prim}" />
<GradientStop Offset="0.5" Color="{StaticResource col_sec}" />
</LinearGradientBrush>
</BoxView.Background>
</BoxView>

<VerticalStackLayout
Grid.Row="0"
Grid.RowSpan="5"
Margin="-16,0,-16,-8"
HorizontalOptions="Center"
IsEnabled="{Binding IsLoading}"
IsVisible="{Binding IsLoading}"
Spacing="10"
VerticalOptions="Center">
</Border.Background>

<ActivityIndicator
HeightRequest="50"
IsRunning="{Binding IsLoading}"
WidthRequest="50"
Color="White" />
<VerticalStackLayout
HorizontalOptions="Center"
Spacing="10"
VerticalOptions="Center">

<Label
HorizontalTextAlignment="Center"
Style="{StaticResource TxtSubtitle1_1}"
Text="Loading"
TextColor="White" />
</VerticalStackLayout>
<ActivityIndicator
HeightRequest="50"
IsRunning="{Binding IsLoading}"
WidthRequest="50"
Color="White" />

<Label
HorizontalTextAlignment="Center"
Style="{StaticResource TxtSubtitle1_1}"
Text="Loading"
TextColor="White" />
</VerticalStackLayout>
</Border>
<!--#endregion-->
</Grid>
<!--#endregion-->
</ContentPage.Content>
Expand Down
1 change: 1 addition & 0 deletions Mitawi/Views/HomePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ private void HomePage_Orientation(object sender, EventArgs e)
VisualStateManager.GoToState(stackTodayAnd7Days, visualStateOrientation);
VisualStateManager.GoToState(scrollForecast24Hours, visualStateOrientation);
VisualStateManager.GoToState(uniformItemsLayoutForecast24Hours, visualStateOrientation);
VisualStateManager.GoToState(borderLoading, visualStateOrientation);
}

private void SelectedWeather_Tapped(object sender, TappedEventArgs e)
Expand Down
29 changes: 28 additions & 1 deletion Mitawi/Views/Orientations/HomePageOrientation.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<!-- 3 -->
<RowDefinition Height="6" />
<!-- 4 -->
<RowDefinition Height="{OnIdiom Phone=132, Tablet=132}" />
<RowDefinition Height="Auto" />
</RowDefinitionCollection>
</Setter.Value>
</Setter>
Expand All @@ -54,6 +54,32 @@
</Style>


<Style
x:Key="vsm_orientation_borderLoading"
TargetType="Border">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="OrientationStates">
<VisualState x:Name="Portrait">
<VisualState.Setters>
<Setter Property="Grid.Row" Value="0" />
<Setter Property="Grid.RowSpan" Value="5" />
<Setter Property="Margin" Value="-16,0,-16,-8" />
</VisualState.Setters>
</VisualState>

<VisualState x:Name="Landscape">
<VisualState.Setters>
<Setter Property="Grid.Column" Value="0" />
<Setter Property="Grid.ColumnSpan" Value="2" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>


<Style
x:Key="vsm_orientation_topLayerLower1"
TargetType="Border">
Expand Down Expand Up @@ -370,6 +396,7 @@
<VisualState x:Name="Portrait">
<VisualState.Setters>
<Setter Property="MaxRows" Value="1" />
<Setter Property="HeightRequest" Value="{OnIdiom Phone=132, Tablet=132}" />
</VisualState.Setters>
</VisualState>

Expand Down

0 comments on commit 3a396e7

Please sign in to comment.