Permalink
Browse files

Add play, pause and stop buttons.

  • Loading branch information...
ilanolkies committed May 22, 2018
1 parent ef9d408 commit 3fd6485c4b31e01b760c028d91a06ac4756639a5

This file was deleted.

Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -131,6 +131,9 @@
<AndroidResource Include="Resources\drawable-hdpi\icon.png" />
<AndroidResource Include="Resources\drawable-xhdpi\icon.png" />
<AndroidResource Include="Resources\drawable-xxhdpi\icon.png" />
<AndroidResource Include="Resources\drawable\stop.png" />
<AndroidResource Include="Resources\drawable\pause.png" />
<AndroidResource Include="Resources\drawable\play.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="Assets\" />
@@ -1 +1,6 @@
# XamarinRadioStreamingExample
# XamarinRadioStreamingExample


## Resources
- Icons: [FlatIcon](https://www.flaticon.com/packs/music)
- Streaming: [Radio Zonica](http://radiozonica.com.ar)
@@ -1,4 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:StreamingExample" x:Class="StreamingExample.StreamingExamplePage">
<Label Text="My first radio streaming app!" VerticalOptions="Center" HorizontalOptions="Center" />
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<!-- Simple header label -->
<Label Grid.Row="0" Grid.Column="0"
Text="My first radio streaming app!"
VerticalOptions="Center" HorizontalOptions="Center"
FontSize="Large"
Margin="10" />

<!-- Use Grid to keep sizing -->
<Grid x:Name="Play"
Grid.Row="1" Grid.Column="0" IsVisible="true"
HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<Image Grid.Row="0" Grid.Column="1"
Source="play.png"
VerticalOptions="Center" HorizontalOptions="Center"
Margin="10">

<!-- Calls function with name described in Tapped when the image is tapped -->
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="Play_tapped" />
</Image.GestureRecognizers>
</Image>
</Grid>

<Grid x:Name="PauseStop"
Grid.Row="1" Grid.Column="0" IsVisible="false"
HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<Image Grid.Row="0" Grid.Column="0"
Source="pause.png"
VerticalOptions="Center" HorizontalOptions="Center"
Margin="10">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="Pause_tapped" />
</Image.GestureRecognizers>
</Image>

<Image Grid.Row="0" Grid.Column="1"
Source="stop.png"
VerticalOptions="Center" HorizontalOptions="Center"
Margin="10">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="Stop_tapped" />
</Image.GestureRecognizers>
</Image>
</Grid>
</Grid>
</ContentPage>
@@ -1,12 +1,34 @@
using Xamarin.Forms;
using System;
using Xamarin.Forms;
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;

namespace StreamingExample
{
public partial class StreamingExamplePage : ContentPage
{
public StreamingExamplePage()
{
InitializeComponent();
InitializeComponent();
On<Xamarin.Forms.PlatformConfiguration.iOS>().SetUseSafeArea(true);
}

// Callbacks to images tapped
private void Play_tapped(object sender, EventArgs e)
{
Play.IsVisible = false;
PauseStop.IsVisible = true;
}

private void Pause_tapped(object sender, EventArgs e)
{
Play.IsVisible = true;
PauseStop.IsVisible = false;
}

private void Stop_tapped(object sender, EventArgs e)
{
Play.IsVisible = true;
PauseStop.IsVisible = false;
}
}
}
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
Binary file not shown.
BIN +13.9 KB iOS/Resources/play.png
Binary file not shown.
BIN +12.1 KB iOS/Resources/stop.png
Binary file not shown.
@@ -120,6 +120,11 @@
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\stop.png" />
<BundleResource Include="Resources\pause.png" />
<BundleResource Include="Resources\play.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<Import Project="..\packages\Xamarin.Forms.2.5.0.121934\build\netstandard1.0\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.5.0.121934\build\netstandard1.0\Xamarin.Forms.targets')" />
</Project>

0 comments on commit 3fd6485

Please sign in to comment.