*/
using System;
-using System.Windows.Input;
-using LibTVRefCommonPortable.Utils;
using Xamarin.Forms;
-using System.Threading.Tasks;
namespace TVHome.Controls
{
set { SetValue(StatusProperty, value); }
}
- private Animation SelectedAnimation;
- private Animation[] SelectedAnimationFrames;
-
public MainPanelButton()
{
InitializeComponent();
PropertyChanged += MainPanelButton_PropertyChanged;
}
- private void SetSelecetedAnimation()
- {
- SelectedAnimation = new Animation();
- SelectedAnimationFrames = new Animation[10];
- SelectedAnimationFrames[0] = new Animation((v) =>
- {
- ButtonBlurImage.Opacity = 0.99;
- });
-
- for (int i = 1; i <= 8; i++)
- {
- var index = i;
- SelectedAnimationFrames[i] = new Animation((v) =>
- {
- DebuggingUtils.Dbg("" + index);
- ButtonBlurImage.Source = "home_icon_bg_0" + index + ".png";
- });
- }
-
- SelectedAnimationFrames[9] = new Animation((v) =>
- {
- ButtonBlurImage.Opacity = 0;
- ButtonBgImage.Opacity = 0;
- ButtonTitle.Opacity = 0;
- ButtonBlurImage.Source = "home_icon_bg_01.png";
- });
-
- SelectedAnimation.Add(0.000, 0.001, SelectedAnimationFrames[0]);
- SelectedAnimation.Add(0.111, 0.112, SelectedAnimationFrames[1]);
- SelectedAnimation.Add(0.222, 0.223, SelectedAnimationFrames[2]);
- SelectedAnimation.Add(0.333, 0.334, SelectedAnimationFrames[3]);
- SelectedAnimation.Add(0.444, 0.445, SelectedAnimationFrames[4]);
- SelectedAnimation.Add(0.555, 0.556, SelectedAnimationFrames[5]);
- SelectedAnimation.Add(0.666, 0.667, SelectedAnimationFrames[6]);
- SelectedAnimation.Add(0.777, 0.778, SelectedAnimationFrames[7]);
- SelectedAnimation.Add(0.888, 0.889, SelectedAnimationFrames[8]);
- SelectedAnimation.Add(0.999, 1.000, SelectedAnimationFrames[9]);
- }
-
private void MainPanelButton_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName.CompareTo("Status") == 0)
switch (Status)
{
case "selected":
- SetSelecetedAnimation();
- SelectedAnimation.Commit(ButtonBlurImage, "SelectedAnimation", 16, 300);
+ ButtonBlurImage.Opacity = 0.99;
+ ButtonBlurImage.Animate("ImageChange", v =>
+ {
+ var imageIndex = (int)(1 + 7 * v);
+ ButtonBlurImage.Source = "home_icon_bg_0" + imageIndex + ".png";
+ },
+ length: 200,
+ finished: (d, b) =>
+ {
+ ButtonBlurImage.Opacity = 0;
+ ButtonBgImage.Opacity = 0;
+ ButtonTitle.Opacity = 0;
+ });
break;
case "focused":
ButtonTitle.FadeTo(0.8, 100);
* limitations under the License.
*/
-using System;
-using System.Collections.Generic;
-using System.Windows.Input;
using System.ComponentModel;
using TVHome.Controls;
using LibTVRefCommonPortable.DataModels;
-using TVHome.ViewModels;
using Xamarin.Forms;
-using LibTVRefCommonPortable.Utils;
+using System.Threading.Tasks;
namespace TVHome.Views
{
OnFocusedCommand.Execute("");
isFocused = true;
- var button = PanelButtonStack.Children[1];
+ var button = PanelButtonStack.Children[0];
button.FindByName<Button>("ButtonFocusArea").Focus();
+ await Task.Delay(300);
#pragma warning disable CS4014
this.TranslateTo(0, -140, 300);
#pragma warning restore CS4014