-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayerPage.xaml
146 lines (140 loc) · 9.42 KB
/
PlayerPage.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<Page
x:Class="RadioParadisePlayer.PlayerPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:RadioParadisePlayer"
xmlns:localHelpers="using:RadioParadisePlayer.Helpers"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Page.Resources>
<localHelpers:BoolToVisibilityConverter x:Key="BoolToVisibilityConverterKey" />
<localHelpers:NotBoolToVisibilityConverter x:Key="NotBoolToVisibilityConverterKey" />
<Style x:Key="NakedButtonStyle" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<ContentPresenter />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Page.Resources>
<Grid RowDefinitions="*,Auto">
<Grid Background="Black" Grid.RowSpan="2" Visibility="{x:Bind Player.SlideshowEnabled, Mode=OneWay, Converter={StaticResource NotBoolToVisibilityConverterKey}}">
<Image Source="ms-appx:///Assets/logo_1400x1400.png" HorizontalAlignment="Left" Stretch="Uniform" />
</Grid>
<Image x:Name="imgSlideshowOne" Stretch="UniformToFill" Source="{x:Bind BitmapImageSlideshowOne}" Grid.RowSpan="2"
Visibility="{x:Bind Player.SlideshowEnabled, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverterKey} }">
<Image.OpacityTransition>
<ScalarTransition Duration="00:00:03" />
</Image.OpacityTransition>
</Image>
<Image x:Name="imgSlideshowTwo" Opacity="0" Stretch="UniformToFill" Source="{x:Bind BitmapImageSlideshowTwo}" Grid.RowSpan="2"
Visibility="{x:Bind Player.SlideshowEnabled, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverterKey} }">
<Image.OpacityTransition>
<ScalarTransition Duration="00:00:03" />
</Image.OpacityTransition>
</Image>
<ProgressRing x:Name="progressRing" Grid.RowSpan="2"
IsActive="{x:Bind Player.IsLoading, Mode=OneWay}" />
<StackPanel Grid.Row="1" Orientation="Vertical" Visibility="{x:Bind Player.IsPlaying, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverterKey} }"
Padding="12, 12, 12, 12" Background="{ThemeResource CustomAcrylicBrush}" x:Name="spPlayerInfo">
<Grid ColumnDefinitions="*,24" Height="24" HorizontalAlignment="Stretch" ColumnSpacing="16">
<ProgressBar HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="0" Foreground="White"
Value="{x:Bind Player.CurrentSongProgress, Mode=OneWay}"
Maximum="{x:Bind Player.CurrentSong.Duration, Mode=OneWay}" />
<Button Grid.Column="1" HorizontalAlignment="Right" Height="24" Width="24"
BorderThickness="0" BorderBrush="Transparent" Padding="4,4,4,4"
Foreground="White" Background="Transparent"
x:Name="toggleInfo" Click="ToggleButton_Click">
<Button.Content>
<FontIcon Glyph="" FontSize="11" Foreground="White" />
</Button.Content>
</Button>
</Grid>
<Grid x:Name="gridInfo" ColumnDefinitions="96,*,24" Grid.RowDefinitions="32,24,*" ColumnSpacing="16" Height="96">
<Grid.Transitions>
<EdgeUIThemeTransition Edge="Bottom" />
</Grid.Transitions>
<Button Grid.Column="0" Grid.Row="0" Grid.RowSpan="3" Style="{StaticResource NakedButtonStyle}" >
<Button.Content>
<Image x:Name="imgCoverArt" Stretch="UniformToFill" Source="{x:Bind BitmapImageCoverArt}" />
</Button.Content>
<Button.Flyout>
<Flyout>
<Flyout.FlyoutPresenterStyle>
<Style TargetType="FlyoutPresenter">
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
</Flyout.FlyoutPresenterStyle>
<Image x:Name="imgCoverArtBig" Stretch="UniformToFill" Source="{x:Bind BitmapImageCoverArt}" />
</Flyout>
</Button.Flyout>
</Button>
<StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal" Spacing="16">
<TextBlock Text="{x:Bind Player.CurrentSong.Title, Mode=OneWay}" FontSize="24" Foreground="White" />
<Button BorderThickness="0" BorderBrush="Transparent" Padding="4,4,4,4"
Foreground="White" Background="Transparent" VerticalAlignment="Top">
<Button.Content>
<FontIcon Glyph="" Foreground="White" FontSize="20"/>
</Button.Content>
<Button.Flyout>
<Flyout Opening="Flyout_Opening">
<Flyout.FlyoutPresenterStyle>
<Style TargetType="FlyoutPresenter">
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
<Setter Property="Background" Value="{StaticResource CustomAcrylicBrush}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
</Flyout.FlyoutPresenterStyle>
<Grid>
<ProgressRing x:Name="progressRingSongInfo" IsActive="{x:Bind Player.SongInfo.IsLoading, Mode=OneWay}" />
<Grid ColumnDefinitions="*"
Visibility="{x:Bind Player.SongInfo.IsLoading, Mode=OneWay, Converter={StaticResource NotBoolToVisibilityConverterKey}}">
<StackPanel Grid.Column="0" Orientation="Vertical" Spacing="8">
<TextBlock Style="{ThemeResource SubheaderTextBlockStyle}" Text="{x:Bind Player.CurrentSong.Title, Mode=OneWay}" />
<Rectangle Height="2" Stretch="Fill" StrokeThickness="2" Stroke="{ThemeResource AccentFillColorDefaultBrush}" />
<TextBlock Style="{ThemeResource BaseTextBlockStyle}" Text="{x:Bind Player.SongInfo.SongLyrics, Mode=OneWay}" />
</StackPanel>
</Grid>
</Grid>
</Flyout>
</Button.Flyout>
</Button>
</StackPanel>
<TextBlock Text="{x:Bind Player.CurrentSong.Artist, Mode=OneWay}" Grid.Column="1" Grid.Row="1" FontSize="18" Foreground="White" />
<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="2">
<TextBlock Text="{x:Bind Player.CurrentSong.Album, Mode=OneWay}" FontSize="18" Foreground="White" />
<TextBlock Text=" (" FontSize="18" Foreground="White" />
<TextBlock Text="{x:Bind Player.CurrentSong.Year, Mode=OneWay}" FontSize="18" Foreground="White" />
<TextBlock Text=")" FontSize="18" Foreground="White" />
</StackPanel>
<Button Grid.Column="3" Grid.Row="2"
BorderThickness="0" BorderBrush="Transparent" Padding="4,4,4,4"
Foreground="White" Background="Transparent">
<Button.Content>
<FontIcon Glyph="" Foreground="White" FontSize="12"/>
</Button.Content>
<Button.Flyout>
<Flyout>
<StackPanel Orientation="Horizontal" RequestedTheme="Default" Spacing="8">
<TextBlock VerticalAlignment="Center">Quiet</TextBlock>
<Slider Orientation="Horizontal" Grid.Column="2" Grid.Row="0" Grid.RowSpan="3"
IsThumbToolTipEnabled="False" Width="100"
Value="{x:Bind Player.Volume, Mode=TwoWay}"
Minimum="0" Maximum="1" SmallChange="0.1" LargeChange="0.2" StepFrequency="0.02">
</Slider>
<TextBlock VerticalAlignment="Center">Loud</TextBlock>
</StackPanel>
</Flyout>
</Button.Flyout>
</Button>
</Grid>
</StackPanel>
</Grid>
</Page>