Change TVApps GUI for demo.
authorcskim <charles0.kim@samsung.com>
Fri, 17 Mar 2017 04:31:47 +0000 (13:31 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:48 +0000 (18:34 +0900)
Change-Id: I4c31b4af930801f028b173b3001ec90c4328ceb8

TVApps/TVApps.TizenTV/TVApps.TizenTV.cs
TVApps/TVApps/Controls/TVButton.xaml
TVApps/TVApps/Controls/TVButton.xaml.cs
TVApps/TVApps/Views/MainPage.xaml
TVApps/TVApps/Views/MainPage.xaml.cs
TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk

index 32824e57da66724e447c2be3d4d4fb3e3925dd82..1fc292d2787acb099a8560c24ac9436b338b5a26 100644 (file)
@@ -23,7 +23,8 @@ namespace TVApps.TizenTV
 {
     public class Program : Xamarin.Forms.Platform.Tizen.FormsApplication, IAppLifeControl
     {
-        IPlatformNotification notification;
+        private static Program instance;
+        private IPlatformNotification notification;
 
         public static string AppResourcePath
         {
@@ -74,11 +75,11 @@ namespace TVApps.TizenTV
 
         static void Main(string[] args)
         {
-            var app = new Program();
+            instance = new Program();
 
             Xamarin.Forms.DependencyService.Register<DebuggingPort>();
             Xamarin.Forms.DependencyService.Register<DBPort>();
-            Xamarin.Forms.DependencyService.Register<IAppLifeControl>();
+            Xamarin.Forms.DependencyService.Register<Program>();
             Xamarin.Forms.DependencyService.Register<AppControlPort>();
             Xamarin.Forms.DependencyService.Register<PackageManagerPort>();
             Xamarin.Forms.DependencyService.Register<WifiModulePort>();
@@ -87,15 +88,15 @@ namespace TVApps.TizenTV
             Xamarin.Forms.DependencyService.Register<ApplicationManagerPort>();
             Xamarin.Forms.DependencyService.Register<FileSystemPort>();
             // TODO : add true argument at end.
-            Xamarin.Forms.Platform.Tizen.Forms.Init(app);
+            Xamarin.Forms.Platform.Tizen.Forms.Init(instance);
 
-            app.Run(args);
+            instance.Run(args);
 
         }
 
         public void SelfTerminate()
         {
-            Exit();
+            instance.Exit();
         }
     }
 }
index ed76e5f99d78ce8b4a95527e86ab5ac585c8603b..a13b4f72ec0eb4aadd0620d1b5ce89e454b22024 100644 (file)
            HorizontalOptions="Center"
            TextColor="#F7F7F7"></Label>
 
+    <!--
     <Image Grid.Row="0" Grid.Column="0"
            x:Name="BackgroundImage"
            VerticalOptions="FillAndExpand"
            HorizontalOptions="FillAndExpand"
            Source="btn_tizen_dropdown_line_normal.9.png"/>
-
+    -->
     <Controls:CustomButton Grid.Row="0" Grid.Column="0"
                            x:Name="HiddenButton"
                            VerticalOptions="FillAndExpand"
index 9abe00166c6d7557aafc6e9e2be9284d3bac57b6..5355383e39dcd795a56b509f43bc7bbd1aeaa9ae 100644 (file)
@@ -56,8 +56,9 @@ namespace TVApps.Controls
             set;
         }
 
-        private static String ButtonImagePressed = "btn_tizen_dropdown_line_dimmed.9.png";
-        private static String ButtonImageReleased = "btn_tizen_dropdown_line_normal.9.png";
+        // TODO : revert this after 9 patch image is displaying properly
+        //private static String ButtonImagePressed = "btn_tizen_dropdown_line_dimmed.9.png";
+        //private static String ButtonImageReleased = "btn_tizen_dropdown_line_normal.9.png";
 
         public TVButton()
         {
@@ -69,13 +70,13 @@ namespace TVApps.Controls
 
         public void ButtonUpListener(Object sender, EventArgs e)
         {
-            BackgroundImage.Source = ButtonImageReleased;
+            //BackgroundImage.Source = ButtonImageReleased;
             Command?.Execute(CommandParameter);
         }
 
         public void ButtonDownListener(Object sender, EventArgs e)
         {
-            BackgroundImage.Source = ButtonImagePressed;
+            //BackgroundImage.Source = ButtonImagePressed;
         }
 
 
index c4aaf8b422edf5d87735dc816cc708ea8735bd7d..105ab6df05ef419090e5556f525ca7df9aa92c95 100755 (executable)
 
       <!-- This StackLayout is temporary code for Long Press test -->
       <Button Grid.Row="0" Grid.Column="1"
-              Text="Set LongPress"
-              FontSize="30"
               Style="{StaticResource button}"
               Command="{Binding SetLongPressCommand}"
               CommandParameter="org.tizen.example.TVHome.TizenTV"
               VerticalOptions="FillAndExpand"
               HorizontalOptions="FillAndExpand"/>
       <Button Grid.Row="2" Grid.Column="1"
-              Text="UnSet LongPress"
-              FontSize="30"
               Style="{StaticResource button}"
               Command="{Binding UnSetLongPressCommand}"
               CommandParameter="org.tizen.example.TVHome.TizenTV"
index 12e6364244d3bdcbe5b6beee643510e334822b1b..7bb87feb30e0c1bfb8cfe463612a555503b46941 100644 (file)
@@ -85,10 +85,15 @@ namespace TVApps.Views
             }
         }
 
+        // TODO : remove this
+        private static bool IsBackKeyPressed;
+
         private async Task<bool> OnBackKeyPressedAtMain()
         {
-            if (!AppList.IsFirstItemFocused)
+            if (!AppList.IsFirstItemFocused &&
+                IsBackKeyPressed == false)
             {
+                IsBackKeyPressed = true;
                 DebuggingUtils.Dbg("OnBackKeyPressedAtMain - focus move");
                 AppList.InitializeFocus();
                 return true;
@@ -98,15 +103,13 @@ namespace TVApps.Views
             if (answer)
             {
                 DebuggingUtils.Dbg("OnBackKeyPressedAtMain - Yes");
-                // TODO : app screen inconized.
-                await this.Navigation.PopAsync();
+                AppControlUtils.SelfTerminate();
                 return true;
             }
 
             return true;
         }
 
-        /*
         protected override bool OnBackButtonPressed()
         {
             DebuggingUtils.Dbg("OnBackButtonPressed");
@@ -116,6 +119,5 @@ namespace TVApps.Views
             }, "");
             return true;
         }
-        */
     }
 }
index a3237babd3344d21699025427b2dafec118f0e97..4b4c8dcc9953bf12bc0a129cda6739e3faf462ae 100644 (file)
Binary files a/TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk and b/TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk differ