Skip to content

Commit

Permalink
🚀 [Code] Updated the functionalities to .NET 8 c4
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmonettelli committed Mar 9, 2024
1 parent 089d34e commit 018c019
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Mitawi/Views/WelcomePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,50 +16,63 @@
</Grid.Background>

<Label
x:Name="lblPhrase1"
Grid.Row="1"
FontFamily="Roboto#500"
FontSize="28"
HorizontalTextAlignment="Center"
IsVisible="False"
Text="Discover The"
TextColor="White" />

<Label
x:Name="lblPhrase2"
Grid.Row="2"
FontFamily="Roboto#500"
FontSize="28"
HorizontalTextAlignment="Center"
IsVisible="False"
Text="Weather In Your City"
TextColor="White" />

<Image
x:Name="imgWeather"
Grid.Row="3"
Margin="20,0"
IsVisible="False"
Source="weather.png" />

<Label
x:Name="lblPhrase3"
Grid.Row="4"
FontFamily="Roboto#400"
FontSize="16"
HorizontalTextAlignment="Center"
IsVisible="False"
Text="Get to know your weather maps and"
TextColor="White" />

<Label
x:Name="lblPhrase4"
Grid.Row="5"
FontFamily="Roboto#400"
FontSize="16"
HorizontalTextAlignment="Center"
IsVisible="False"
Text="radar precipitation forcast"
TextColor="White" />

<Button
x:Name="btnGetStarted"
Grid.Row="7"
BackgroundColor="White"
Command="{Binding NextPageCommand}"
CornerRadius="16"
FontFamily="Roboto#700"
FontSize="18"
HeightRequest="50"
IsEnabled="False"
IsVisible="False"
Text="GET STARTED"
TextColor="{StaticResource col_sec}"
WidthRequest="255" />
Expand Down
40 changes: 40 additions & 0 deletions Mitawi/Views/WelcomePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,46 @@ protected override async void OnAppearing()
base.OnAppearing();

await CheckAndRequestLocationPermission();

RunWelcomeAnimation();
}

private void RunWelcomeAnimation()
{
btnGetStarted.IsEnabled = false;

lblPhrase1.IsVisible = true;
lblPhrase2.IsVisible = true;
imgWeather.IsVisible = true;
lblPhrase3.IsVisible = true;
lblPhrase4.IsVisible = true;
btnGetStarted.IsVisible = true;

lblPhrase1.Opacity = 0;
lblPhrase2.Opacity = 0;
imgWeather.Opacity = 0;
lblPhrase3.Opacity = 0;
lblPhrase4.Opacity = 0;
btnGetStarted.Opacity = 0;

new Animation
{
{ 0, 0.2, new Animation(v => lblPhrase1.Opacity = v, 0, 1, Easing.CubicInOut) },
{ 0.1, 0.3, new Animation(v => lblPhrase2.Opacity = v, 0, 1, Easing.CubicInOut) },
{ 0.3, 0.5, new Animation(v => imgWeather.Opacity = v, 0, 1, Easing.CubicInOut) },
{ 0.3, 0.5, new Animation(v => imgWeather.Scale = v, 0, 1, Easing.SpringOut) },
{ 0.5, 0.7, new Animation(v => lblPhrase3.Opacity = v, 0, 1, Easing.CubicInOut) },
{ 0.6, 0.8, new Animation(v => lblPhrase4.Opacity = v, 0, 1, Easing.CubicInOut) },
{ 0.8, 1, new Animation(v=>
{
btnGetStarted.Opacity = v;
btnGetStarted.Scale = v;
},0,1,Easing.BounceOut,finished: ()=>
{
btnGetStarted.IsEnabled = true;
})
}
}.Commit(owner: this, name: "WelcomeAnimation", length: 3500);
}

private static async Task<PermissionStatus> CheckAndRequestLocationPermission()
Expand Down

0 comments on commit 018c019

Please sign in to comment.