revert to use the NavigationPage with SimpleImageViewer.
authorcskim <charles0.kim@samsung.com>
Thu, 4 May 2017 12:48:02 +0000 (21:48 +0900)
committercskim <charles0.kim@samsung.com>
Thu, 4 May 2017 13:21:24 +0000 (22:21 +0900)
Change-Id: I15da6b7eca7efbc3d2826ed18aec63c0d81bc3b6

TVMediaHub/TVMediaHub.Tizen/Controls/ContentPageEx.cs
TVMediaHub/TVMediaHub.Tizen/TVMediaHub.Tizen.cs
TVMediaHub/TVMediaHub.Tizen/TVMediaHub.cs
TVMediaHub/TVMediaHub.Tizen/ViewModels/ImageTabViewModel.cs
TVMediaHub/TVMediaHub.Tizen/Views/ImageTab.xaml.cs
TVMediaHub/TVMediaHub.Tizen/Views/MediaHubMainPage.xaml.cs
TVMediaHub/TVMediaHub.Tizen/Views/SimpleImageViewer.xaml.cs
TVMediaHub/TVMediaHub.Tizen/Views/VideoTab.xaml.cs

index 5833664..37b1b69 100644 (file)
@@ -7,6 +7,13 @@ namespace TVMediaHub.Tizen.Controls
     {
         protected EventHandler OnBackButtonPressedHandler { set; get; }
 
+        protected ContentPageEx()
+            : base()
+        {
+            NavigationPage.SetHasBackButton(this, false);
+            NavigationPage.SetHasNavigationBar(this, false);
+        }
+
         protected override void OnAppearing()
         {
             base.OnAppearing();
index a15a59f..57f92a8 100644 (file)
@@ -25,8 +25,18 @@ namespace TVMediaHub.Tizen
 {
     class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
     {
-        public static Program Instance;
-        public static string ResourceDirectoryPath;
+        public static Program Instance
+        {
+            get;
+            private set;
+        }
+
+        public static string ResourceDirectoryPath
+        {
+            get;
+            private set;
+        }
+
         private static App app;
 
         protected override void OnCreate()
index c386a47..46eb92e 100755 (executable)
@@ -57,13 +57,26 @@ namespace TVMediaHub
 
         public void TransitionTo(ContentPage page)
         {
-            MainPage = page;
+            //MainPage = page;
+            AppMainPage.PushAsync(page);
         }
         public void TransitionToMain(int tabIndex = 0)
         {
+            /*
             MainPage = new NavigationPage(new MediaHubMainPage(tabIndex));
             MainPage.Opacity = 0;
             AppMainPage = MainPage as NavigationPage;
+            */
+            if (AppMainPage == null)
+            {
+                MainPage = new NavigationPage(new MediaHubMainPage(tabIndex));
+                MainPage.Opacity = 0;
+                AppMainPage = MainPage as NavigationPage;
+            }
+            else
+            {
+                AppMainPage.PopToRootAsync();
+            }
         }
 
         public void RunHideAnimation()
index a4192f8..bcfd69e 100755 (executable)
@@ -53,7 +53,7 @@ namespace TVMediaHub.Tizen.ViewModels
                 }
 
                 displayingImageIndex = value;
-                //OnPropertyChanged("CurrentImage");
+                OnPropertyChanged("CurrentImage");
             }
         }
         public ImageViewerInfomation CurrentImage
index 9821ec6..9b04d61 100755 (executable)
@@ -17,6 +17,7 @@
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
+using System.Threading;
 using System.Windows.Input;
 using TVMediaHub.Tizen.Controls;
 using TVMediaHub.Tizen.DataModels;
@@ -105,6 +106,12 @@ namespace TVMediaHub.Tizen.Views
             InitializeSize();
             InitializeFooter();
             ItemsSource.CollectionChanged += ItemsSourceCollectionChanged;
+
+
+            SynchronizationContext.Current.Post((o) =>
+            {
+                InitializePage();
+            }, "");
         }
 
 
@@ -149,6 +156,7 @@ namespace TVMediaHub.Tizen.Views
 
         protected override void FinalizePage()
         {
+            /*
             ItemsSource.Clear();
             GalleryContentView.Children.Clear();
             BottomButtonList.Clear();
@@ -159,6 +167,7 @@ namespace TVMediaHub.Tizen.Views
                 FooterDelete.IsVisible = false;
             }
             IsContentReady = false;
+            */
         }
 
         private void ItemsSourceCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
index 11ad73e..f4613b9 100755 (executable)
@@ -27,14 +27,9 @@ namespace TVMediaHub.Tizen.Views
     [XamlCompilation(XamlCompilationOptions.Compile)]
     public partial class MediaHubMainPage : TabbedPage
     {
-        //private int StartTabIndex;
-
         public MediaHubMainPage(int tabIndex)
         {
             InitializeComponent();
-            // TODO : revert this, temporarily commented this out for reducing a delay when this page is showing up.
-            //StartTabIndex = tabIndex;
-            //CurrentPage = Children[StartTabIndex];
             NavigationPage.SetHasBackButton(this, false);
             NavigationPage.SetHasNavigationBar(this, true);
         }
index 439dbbb..4b1a466 100644 (file)
@@ -311,7 +311,6 @@ namespace TVMediaHub.Tizen.Views
             setControlAreaState(ControlAreaState.AUTO);
 
             NavigationCommand?.Execute("Left");
-            Program.TransitionTo(new SimpleImageViewer());
         }
 
         private void RightBtnClicked(object sender, EventArgs e)
@@ -326,7 +325,6 @@ namespace TVMediaHub.Tizen.Views
             setControlAreaState(ControlAreaState.AUTO);
 
             NavigationCommand?.Execute("Right");
-            Program.TransitionTo(new SimpleImageViewer());
         }
 
         private void SlideShowBtnClicked(object sender, EventArgs e)
index 838b454..29532f1 100644 (file)
@@ -158,6 +158,7 @@ namespace TVMediaHub.Tizen.Views
 
         protected override void FinalizePage()
         {
+            /*
             ItemsSource.Clear();
             VideoTabList.Children.Clear();
             BottomButtonList.Clear();
@@ -168,6 +169,7 @@ namespace TVMediaHub.Tizen.Views
                 FooterDelete.IsVisible = false;
             }
             IsContentReady = false;
+            */
         }
 
         private void ItemsSource_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)