Implements Apps out VI
[profile/tv/apps/dotnet/home.git] / TVApps / TVApps / Views / MainPage.xaml.cs
index 6f04242..0fa0ccb 100755 (executable)
@@ -129,12 +129,27 @@ namespace TVApps.Views
             set { SetValue(SumOfCheckedAppProperty, value); }
         }
 
-        /*
+
         private async void PlayHideAnimation()
         {
-            // TODO : Apps Out Animation.
+            var animation = new Animation();
+            var headerAnimation = new Animation(v => Header.Opacity = v, 1, 0);
+            var titleAnimation = new Animation(v => TitleLabel.Opacity = v, 1, 0);
+            var footerAnimation = new Animation(v => FooterNormal.Opacity = v, 1, 0);
+            var appListHeightAnimation = new Animation(v => AppList.TranslationY = v, 0, SizeUtils.GetHeightSize(12));
+            var appListAnimation = new Animation(v => AppList.Opacity = v, 1, 0);
+            var mainAnimation = new Animation(v => this.Opacity = v, 1, 0);
+
+            animation.Add(0.2, 0.8, headerAnimation);
+            animation.Add(0.2, 0.8, titleAnimation);
+            animation.Add(0.2, 0.8, footerAnimation);
+            animation.Add(0.2, 1, appListHeightAnimation);
+            animation.Add(0.2, 0.8, appListAnimation);
+            animation.Add(0.2, 1, mainAnimation);
+
+            animation.Commit(this, "QuitAnimation", 16, 834);
         }
-        */
+
 
         /// <summary>
         /// A constructor
@@ -434,6 +449,8 @@ namespace TVApps.Views
             var answer = await DisplayAlert("QUIT", "Do you want to quit?", "YES", "NO");
             if (answer)
             {
+                PlayHideAnimation();
+                await Task.Delay(800);
                 AppControlUtils.SelfTerminate();
             }
             else