+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- xmlns:local="clr-namespace:Tizen.Wearable.CircularUI.Forms"
- x:Class="Tizen.Wearable.CircularUI.Forms.EmbeddingControls">
- <ContentView.Resources>
- <ResourceDictionary>
- <local:ProgressToBoundTextConverter x:Key="progressToBound"/>
- <local:MillisecondToTextConverter x:Key="millisecondToText"/>
- </ResourceDictionary>
- </ContentView.Resources>
- <ContentView.Content>
- <AbsoluteLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
- <StackLayout AbsoluteLayout.LayoutBounds="0, 0, 1, 1" AbsoluteLayout.LayoutFlags="All">
- <StackLayout VerticalOptions="FillAndExpand"></StackLayout>
- <StackLayout Margin="20" VerticalOptions="End" HorizontalOptions="FillAndExpand" BackgroundColor="#50000000">
- <AbsoluteLayout HorizontalOptions="FillAndExpand" HeightRequest="23" BackgroundColor="#80000000">
- <BoxView Color="#4286f4" AbsoluteLayout.LayoutBounds="{Binding Progress, Converter={StaticResource progressToBound}}" AbsoluteLayout.LayoutFlags="SizeProportional"></BoxView>
- <Label Margin="80, 0, 0, 0" Text="{Binding Position, Converter={StaticResource millisecondToText}}" FontSize="Micro" HorizontalTextAlignment="Start" AbsoluteLayout.LayoutBounds="0, 0, 1, 1" AbsoluteLayout.LayoutFlags="All" />
- <Label Margin="0, 0, 80, 0" Text="{Binding Duration, Converter={StaticResource millisecondToText}}" FontSize="Micro" HorizontalTextAlignment="End" AbsoluteLayout.LayoutBounds="0, 0, 1, 1" AbsoluteLayout.LayoutFlags="All" />
- </AbsoluteLayout>
- </StackLayout>
- </StackLayout>
- <Image x:Name="PlayImage" AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0.5, 0.5, 0.25, 0.25" IsVisible="False">
- <Image.GestureRecognizers>
- <TapGestureRecognizer Command="{Binding StartCommand}"/>
- </Image.GestureRecognizers>
- </Image>
- <Image x:Name="PauseImage" AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0.5, 0.5, 0.25, 0.25" IsVisible="False">
- <Image.GestureRecognizers>
- <TapGestureRecognizer Command="{Binding StartCommand}"/>
- </Image.GestureRecognizers>
- </Image>
- <Label FontSize="Large"
- HorizontalTextAlignment="Center"
- Text="{Binding BufferingProgress, StringFormat='{}{0:0%}'}"
- TextColor="#eeeeeeee"
- AbsoluteLayout.LayoutFlags="All"
- AbsoluteLayout.LayoutBounds="0.5, 0.5, .25, .25"
- IsVisible="{Binding IsBuffering}"/>
- </AbsoluteLayout>
- </ContentView.Content>
-</ContentView>
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using System;
-using System.Threading.Tasks;
-using Xamarin.Forms;
-using Xamarin.Forms.Xaml;
-
-namespace Tizen.Wearable.CircularUI.Forms
-{
- /// <summary>
- /// A built-in media controls.
- /// </summary>
- [XamlCompilation(XamlCompilationOptions.Compile)]
- partial class EmbeddingControls : ContentView
- {
- /// <summary>
- /// Internal use only, initializes a new instance of the EmbeddingControls.
- /// </summary>
- public EmbeddingControls()
- {
- InitializeComponent();
- PlayImage.Source = ImageSource.FromResource("XSF.Resources.img_button_play.png", GetType().Assembly);
- PauseImage.Source = ImageSource.FromResource("XSF.Resources.img_button_pause.png", GetType().Assembly);
- }
-
- protected override void OnBindingContextChanged()
- {
- base.OnBindingContextChanged();
- if (BindingContext is MediaPlayer player)
- {
- player.PlaybackPaused += OnPlaybackStateChanged;
- player.PlaybackStarted += OnPlaybackStateChanged;
- player.PlaybackStopped += OnPlaybackStateChanged;
- }
- }
-
- async void OnPlaybackStateChanged(object sender, EventArgs e)
- {
- if (BindingContext is MediaPlayer player)
- {
- if (player.State == PlaybackState.Playing)
- {
- var unused = PlayImage.FadeTo(0, 100);
- await PlayImage.ScaleTo(3.0, 300);
- PlayImage.IsVisible = false;
- PlayImage.Scale = 1.0;
-
- PauseImage.IsVisible = true;
- unused = PauseImage.FadeTo(1, 50);
- }
- else
- {
- var unused = PauseImage.FadeTo(0, 100);
- await PauseImage.ScaleTo(3.0, 300);
- PauseImage.IsVisible = false;
- PauseImage.Scale = 1.0;
-
- PlayImage.IsVisible = true;
- unused = PlayImage.FadeTo(1, 50);
- }
- }
- }
- }
-}
\ No newline at end of file
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Internals;
+using Xamarin.Forms.Platform.Tizen.Native;
namespace Tizen.Wearable.CircularUI.Forms
{
_impl.AutoStop = true;
_controlsAlwaysVisible = false;
- //_controls = new Lazy<View>(() =>
- //{
- // return new EmbeddingControls
- // {
- // BindingContext = this
- // };
- //});
+ _controls = new Lazy<View>(() =>
+ {
+ return new EmbeddingControls
+ {
+ BindingContext = this
+ };
+ });
}
/// <summary>
</PropertyGroup>
<ItemGroup>
- <Compile Remove="Tizen.Wearable.CircularUI.Forms\EmbeddingControls.xaml.cs" />
- </ItemGroup>
-
- <ItemGroup>
- <EmbeddedResource Remove="Tizen.Wearable.CircularUI.Forms\EmbeddingControls.xaml" />
- </ItemGroup>
-
- <ItemGroup>
- <None Remove="Tizen.Wearable.CircularUI.Forms\EmbeddingControls.xaml" />
- </ItemGroup>
-
- <ItemGroup>
<PackageReference Include="Tizen.NET" Version="6.0.0.14995" />
</ItemGroup>