async void OnItemSelected(object sender, EventArgs args)
        {
            var layout = (BindableObject)sender;
            var item   = (Item)layout.BindingContext;

            //await Navigation.PushAsync(new ItemDetailPage(new ItemDetailViewModel(item)));

            TheMedia.IsVisible     = true;
            TheMedia.HeightRequest = height > width ? this.Height / 3 : this.Height;

            if (Device.RuntimePlatform == Device.iOS)
            {
                if (Device.Idiom == TargetIdiom.Phone)
                {
                    TheMedia.Source = item.MediumQualityURL;
                }
                else
                {
                    TheMedia.Source = item.LowQualityURL;
                }
            }
            else
            {
                if (Device.Idiom == TargetIdiom.Phone)
                {
                    TheMedia.Source = item.LowQualityURL;
                }
                else
                {
                    TheMedia.Source = item.MediumQualityURL;
                }
            }
            TheMedia.Play();
        }
Exemplo n.º 2
0
        async void immediateEmojiButton_click(object sender, RoutedEventArgs e)
        {
            var text = ((Button)sender).Content.ToString();

            var connection = await GetDeviceAsync();

            var stream = await _engine.SayText(text);

            TheMedia.SetSource(stream, stream.ContentType);
            var task = connection?.PlayAnimationSequenceAsync(stream.Markers);

            TheMedia.Play();
        }
Exemplo n.º 3
0
        async void OnPlayClicked(object sender, RoutedEventArgs e)
        {
            var text = TheTextBox.Text;

            TheTextBox.SelectAll();

            var stream = await _engine.SayText(text);

            foreach (var mark in stream.Markers)
            {
                Debug.WriteLine($"{mark.Text} @ {mark.Time.Milliseconds}ms");
            }

            TheMedia.SetSource(stream, stream.ContentType);
            TheMedia.Play();
        }
Exemplo n.º 4
0
        async void enterButton_Click(object sender, RoutedEventArgs e)
        {
            var text = result.Text;

            if (text.StartsWith(">"))
            {
                _comPort = text.Substring(1);
                _connection?.Close();
                _connection = null;
            }

            result.SelectAll();

            var connection = await GetDeviceAsync();

            var stream = await _engine.SayText(text);

            TheMedia.SetSource(stream, stream.ContentType);
            var task = connection?.PlayAnimationSequenceAsync(stream.Markers);

            TheMedia.Play();
        }