From 363ff3e730d1b9c5bc60264a36168830b0da6d6a Mon Sep 17 00:00:00 2001 From: Corentin LEMAIRE Date: Wed, 24 May 2023 09:36:43 +0200 Subject: [PATCH] Fix Navigation Android --- Sources/Linaris/AlbumPage.xaml.cs | 1 + Sources/Linaris/AppShell.xaml | 9 +++-- Sources/Linaris/FooterPage.xaml.cs | 42 ++++++++++---------- Sources/Linaris/Resources/Styles/Styles.xaml | 2 + 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/Sources/Linaris/AlbumPage.xaml.cs b/Sources/Linaris/AlbumPage.xaml.cs index 07381dd..1d01854 100644 --- a/Sources/Linaris/AlbumPage.xaml.cs +++ b/Sources/Linaris/AlbumPage.xaml.cs @@ -1,4 +1,5 @@ using Model; + namespace Linaris; public partial class AlbumPage : ContentPage diff --git a/Sources/Linaris/AppShell.xaml b/Sources/Linaris/AppShell.xaml index 9599db7..a035749 100644 --- a/Sources/Linaris/AppShell.xaml +++ b/Sources/Linaris/AppShell.xaml @@ -5,15 +5,16 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:Linaris" Shell.FlyoutBehavior="Flyout" - Shell.NavBarIsVisible="False" - FlyoutWidth="200"> + Shell.NavBarIsVisible="True" + FlyoutWidth="200" + FlyoutIsPresented="True"> - + + Shell.NavBarIsVisible="True"/> diff --git a/Sources/Linaris/FooterPage.xaml.cs b/Sources/Linaris/FooterPage.xaml.cs index 5a13306..568762f 100644 --- a/Sources/Linaris/FooterPage.xaml.cs +++ b/Sources/Linaris/FooterPage.xaml.cs @@ -4,29 +4,29 @@ namespace Linaris; public partial class FooterPage : ContentView { - WaveOutEvent outputDevice; + /*WaveOutEvent outputDevice; AudioFileReader audioFile; System.Timers.Timer timer; bool changementManuel = true; bool closing = false; - string morceauEnCours; + string morceauEnCours;*/ public FooterPage() { InitializeComponent(); - outputDevice = new WaveOutEvent(); + /*outputDevice = new WaveOutEvent();*/ // (s,a) = convention, s = sender, a = arguments, si appli fermée, on free tout - outputDevice.PlaybackStopped += PlaybackStoppedHandler; + /*outputDevice.PlaybackStopped += PlaybackStoppedHandler; morceauEnCours = Path.Combine(AppContext.BaseDirectory, "Resources", "Musics", "winter.mp3"); audioFile = new AudioFileReader(morceauEnCours); - outputDevice.Init(audioFile); + outputDevice.Init(audioFile);*/ } public void PlayButton_Clicked(object sender, EventArgs e) { - string url = ((FileImageSource)Play.Source).File; + /*string url = ((FileImageSource)Play.Source).File; if (url == "play.png") { outputDevice?.Play(); @@ -40,39 +40,39 @@ public partial class FooterPage : ContentView { outputDevice?.Pause(); Play.Source = "play.png"; - } + }*/ } public void RewindButton_Clicked(Object sender, EventArgs e) { - audioFile.Position = 0; + /*audioFile.Position = 0; outputDevice?.Play(); Play.Source = "pause.png"; Timer_Elapsed(sender, e); timer = new System.Timers.Timer(1000); timer.Elapsed += Timer_Elapsed; - timer.Enabled = true; + timer.Enabled = true;*/ } public void NextButton_Clicked(Object sender, EventArgs e) { - audioFile.Position = audioFile.Length; + /*audioFile.Position = audioFile.Length;*/ } public void StopButton_Clicked(object sender, EventArgs e) { - outputDevice.Stop(); - audioFile.Position = 0; + /*outputDevice.Stop(); + audioFile.Position = 0;*/ } public void Slider_ValueChanged(object sender, ValueChangedEventArgs e) { - outputDevice.Volume = (float)e.NewValue; + /*outputDevice.Volume = (float)e.NewValue;*/ } public void Bar_ValueChanged(object sender, ValueChangedEventArgs e) { - if (changementManuel) + /*if (changementManuel) { double totalSeconds = audioFile.TotalTime.TotalSeconds; double newPosition = e.NewValue * totalSeconds; @@ -82,12 +82,12 @@ public partial class FooterPage : ContentView else { changementManuel = true; - } + }*/ } private void PlaybackStoppedHandler(object sender, StoppedEventArgs e) { - if (closing) + /*if (closing) { outputDevice.Dispose(); audioFile.Dispose(); @@ -95,12 +95,12 @@ public partial class FooterPage : ContentView else { Play.Dispatcher.Dispatch(() => Play.Source = "play.png"); - } + }*/ } private void Timer_Elapsed(object sender, EventArgs e) { - TimeSpan totalTimeSpan = audioFile.TotalTime; + /*TimeSpan totalTimeSpan = audioFile.TotalTime; TimeSpan currentTimeSpan = audioFile.CurrentTime; string totalTimeFormatted = totalTimeSpan.ToString(@"hh\:mm\:ss"); @@ -110,17 +110,17 @@ public partial class FooterPage : ContentView bar.Dispatcher.Dispatch(() => bar.Value = audioFile.CurrentTime.TotalSeconds / audioFile.TotalTime.TotalSeconds); currentTime.Dispatcher.Dispatch(() => currentTime.Text = currentTimeFormatted); - endTime.Dispatcher.Dispatch(() => endTime.Text = totalTimeFormatted); + endTime.Dispatcher.Dispatch(() => endTime.Text = totalTimeFormatted);*/ } private void LoadNewAudioFile(string filePath) { - if (outputDevice.PlaybackState == PlaybackState.Playing) + /*if (outputDevice.PlaybackState == PlaybackState.Playing) { outputDevice.Stop(); } audioFile = new AudioFileReader(filePath); - outputDevice.Init(audioFile); + outputDevice.Init(audioFile);*/ } } \ No newline at end of file diff --git a/Sources/Linaris/Resources/Styles/Styles.xaml b/Sources/Linaris/Resources/Styles/Styles.xaml index 79a0a70..751d7cc 100644 --- a/Sources/Linaris/Resources/Styles/Styles.xaml +++ b/Sources/Linaris/Resources/Styles/Styles.xaml @@ -86,6 +86,7 @@ + @@ -95,6 +96,7 @@ +