Merge pull request 'feat/createBottomMenu - add bottom menu' (#1) from feat/createBottomMenu into main

Reviewed-on: #1
main
Yohann BREUIL 2 years ago
commit 85b32fc966

@ -3,13 +3,39 @@
x:Class="AppleMusicApp.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:AppleMusicApp"
xmlns:pages="clr-namespace:AppleMusicApp.Pages"
Shell.FlyoutBehavior="Disabled">
<ShellContent
Title="Home"
ContentTemplate="{DataTemplate local:MainPage}"
Route="MainPage" />
<TabBar>
<ShellContent
Icon="icon_listen"
Title="Listen"
ContentTemplate="{DataTemplate pages:UnknowPage}"
Route="UnknowPage" />
</Shell>
<ShellContent
Icon="icon_explore"
Title="Explore"
ContentTemplate="{DataTemplate pages:UnknowPage}"
Route="UnknowPage" />
<ShellContent
Icon="icon_radio"
Title="Radio"
ContentTemplate="{DataTemplate pages:UnknowPage}"
Route="UnknowPage"/>
<ShellContent
x:Name="LibraryTab"
Icon="icon_library"
Title="Library"
ContentTemplate="{DataTemplate pages:LibraryPage}"
Route="LibraryPage" />
<ShellContent
Icon="icon_search"
Title="Listen"
ContentTemplate="{DataTemplate pages:UnknowPage}"
Route="UnknowPage" />
</TabBar>
</Shell>

@ -5,6 +5,7 @@ public partial class AppShell : Shell
public AppShell()
{
InitializeComponent();
CurrentItem = LibraryTab;
}
}

@ -33,6 +33,9 @@
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
@ -42,8 +45,14 @@
<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\icon_explore.png" BaseSize="35,35" />
<MauiImage Update="Resources\Images\icon_library.png" BaseSize="35,35" />
<MauiImage Update="Resources\Images\icon_listen.png" BaseSize="35,35" />
<MauiImage Update="Resources\Images\icon_radio.png" BaseSize="35,35" />
<MauiImage Update="Resources\Images\icon_search.png" BaseSize="35,35" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
@ -55,4 +64,21 @@
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<None Remove="Views\" />
<None Remove="Resources\Images\icon-search.png" />
<None Remove="Resources\Images\icon_listen.png" />
<None Remove="Resources\Images\icon_explore.png" />
<None Remove="Resources\Images\icon_radio.png" />
<None Remove="Pages\" />
</ItemGroup>
<ItemGroup>
<Folder Include="Views\" />
<Folder Include="Pages\" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\Images\icon_listen.png" />
<BundleResource Include="Resources\Images\icon_explore.png" />
<BundleResource Include="Resources\Images\icon_radio.png" />
</ItemGroup>
</Project>

@ -1,42 +0,0 @@
<?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"
x:Class="AppleMusicApp.MainPage">
<ScrollView>
<VerticalStackLayout
Spacing="25"
Padding="30,0"
VerticalOptions="Center">
<Image
Source="dotnet_bot.png"
SemanticProperties.Description="Cute dot net bot waving hi to you!"
HeightRequest="200"
HorizontalOptions="Center" />
<Label
Text="Hello, World!"
SemanticProperties.HeadingLevel="Level1"
FontSize="32"
HorizontalOptions="Center" />
<Label
Text="Welcome to .NET Multi-platform App UI"
SemanticProperties.HeadingLevel="Level2"
SemanticProperties.Description="Welcome to dot net Multi platform App U I"
FontSize="18"
HorizontalOptions="Center" />
<Button
x:Name="CounterBtn"
Text="Click me"
SemanticProperties.Hint="Counts the number of times you click"
Clicked="OnCounterClicked"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -1,25 +0,0 @@
namespace AppleMusicApp;
public partial class MainPage : ContentPage
{
int count = 0;
public MainPage()
{
InitializeComponent();
}
private void OnCounterClicked(object sender, EventArgs e)
{
count++;
if (count == 1)
CounterBtn.Text = $"Clicked {count} time";
else
CounterBtn.Text = $"Clicked {count} times";
SemanticScreenReader.Announce(CounterBtn.Text);
}
}

@ -0,0 +1,12 @@
<?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"
x:Class="AppleMusicApp.Pages.LibraryPage"
Title="LibraryPage">
<VerticalStackLayout>
<Label
Text="Welcome to .NET MAUI!"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ContentPage>

@ -0,0 +1,9 @@
namespace AppleMusicApp.Pages;
public partial class LibraryPage : ContentPage
{
public LibraryPage()
{
InitializeComponent();
}
}

@ -0,0 +1,13 @@
<?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"
x:Class="AppleMusicApp.Pages.UnknowPage"
Title="UnknowPage">
<VerticalStackLayout>
<Label
Text="Unknow page"
TextColor="DarkRed"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ContentPage>

@ -0,0 +1,9 @@
namespace AppleMusicApp.Pages;
public partial class UnknowPage : ContentPage
{
public UnknowPage()
{
InitializeComponent();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Loading…
Cancel
Save