1. Add bolierplate \n 2. Change enum name : AppsStatus Normal -> Launch
authorgs86.lee <gs86.lee@DO-GS86-LEE04>
Thu, 9 Mar 2017 08:52:28 +0000 (17:52 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:45 +0000 (18:34 +0900)
Change-Id: I4e61b36c86ec165e010f6afed005c827a1d3f04e

TVApps/TVApps/ViewModels/MainPageViewModel.cs
TVApps/TVApps/Views/FooterDeleteStatus.xaml.cs
TVApps/TVApps/Views/FooterNormalStatus.xaml.cs
TVApps/TVApps/Views/FooterPinStatus.xaml.cs
TVApps/TVApps/Views/MainPage.xaml.cs

index 9e6910873a387b2ec9916cf116a20e00b2ee5333..a2c417b9f0d327e25ceeeb50ac9d5c22cb073f70 100644 (file)
 
 using LibTVRefCommmonPortable.DataModels;
 using LibTVRefCommmonPortable.Utils;
-using System.Collections;
 using System.Collections.Generic;
-using System.Collections.ObjectModel;
 using System.ComponentModel;
-using System.Linq;
-using System.Threading.Tasks;
 using Xamarin.Forms;
 
 namespace TVApps.ViewModels
 {
     public enum AppsStatus
     {
-        Normal,
+        Launch,
         Pin,
         Delete,
     };
@@ -40,11 +36,11 @@ namespace TVApps.ViewModels
         Quit,
     };
 
-    public enum SortList
+    public enum SortingOptions
     {
         Newest,
-        Ascending, // A-Z
-        Descending, // Z-A
+        Ascending,
+        Descending,
     };
 
     class MainPageViewModel : INotifyPropertyChanged
@@ -56,7 +52,7 @@ namespace TVApps.ViewModels
 
         public AppsStatus CurrentStatus { get; private set; }
 
-        public SortList SortStatus { get; private set; }
+        public SortingOptions SortingOption { get; private set; }
 
         public BackKeyInfo BackKeyStatus { get; private set; }
 
@@ -65,27 +61,17 @@ namespace TVApps.ViewModels
         public ShortcutInfo FocusedItem { get; set; }
 
         public event PropertyChangedEventHandler PropertyChanged;
-        protected void OnPropertyChanged(string name)
-        {
-            PropertyChangedEventHandler handler = PropertyChanged;
-            if (handler != null)
-            {
-                handler(this, new PropertyChangedEventArgs(name));
-            }
-        }
-
         public MainPageViewModel()
         {
-            BackKeyStatus = BackKeyInfo.Back;
-            SortStatus = SortList.Newest;
-            CurrentStatus = AppsStatus.Normal;
+            init();
 
             GetInstalledApps();
 
             SortCommand = new Command((sortType) =>
             {
                 // 1. SortType = sortType;
-                // 2. Sorting appsList
+                // 2. Sorting AppsList
+                // 3. OnPropertyChanged("AppList");
             });
 
             OptionCommand = new Command((optionType) =>
@@ -97,7 +83,7 @@ namespace TVApps.ViewModels
 
             ButtonDelCommand = new Command(() =>
             {
-                CurrentStatus = AppsStatus.Normal;
+                CurrentStatus = AppsStatus.Launch;
                 OnPropertyChanged("CurrentStatus");
             });
 
@@ -108,6 +94,22 @@ namespace TVApps.ViewModels
             });
         }
 
+        private void init()
+        {
+            BackKeyStatus = BackKeyInfo.Back;
+            SortingOption = SortingOptions.Newest;
+            CurrentStatus = AppsStatus.Launch;
+        }
+
+        protected void OnPropertyChanged(string name)
+        {
+            PropertyChangedEventHandler handler = PropertyChanged;
+            if (handler != null)
+            {
+                handler(this, new PropertyChangedEventArgs(name));
+            }
+        }
+
         private async void GetInstalledApps()
         {
             AppList = await TVHomeImpl.GetInstance.AppShortcutControllerInstance.GetList();
index 6bc6abcdee130e513104181ce25b3d854b62c65b..ec3d9bc6668fc2043e2d75f7b7e19626cadef581 100644 (file)
@@ -1,8 +1,18 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 using Xamarin.Forms;
 
index 7bb23e101aac03562e371c0a6030cf776008d5af..1d97f402920f2a2206c1dfc5c91ca4b020e300b0 100644 (file)
@@ -1,8 +1,18 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 using Xamarin.Forms;
 
index 7683e37a273b22b0a2ddcc74e5c5d054502b0f3a..5f5e8a43faaa6b8f090ec34b818a4cf34c1c9800 100644 (file)
@@ -1,8 +1,18 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 using Xamarin.Forms;
 
index 548f9cf1749ee46badd410609837cfff68b66451..7d8796f7fa41ab94ea44f760f66387676a5a60c7 100644 (file)
@@ -46,7 +46,7 @@ namespace TVApps.Views
             {
                 switch (CurrentStatus)
                 {
-                    case AppsStatus.Normal:
+                    case AppsStatus.Launch:
                         FooterNormal.IsVisible = true;
                         FooterPin.IsVisible = false;
                         FooterDelete.IsVisible = false;