From b71b53d118df69b5c7043a0ee15ce29d2b96dd9b Mon Sep 17 00:00:00 2001 From: "jjie.choi" Date: Mon, 22 May 2017 17:37:52 +0900 Subject: [PATCH 01/16] Show toast when the number of selected apps exceeds 10 Change-Id: I22a9b891d4a0a128b179808e91a9a7e3fd0b9e8b Signed-off-by: jjie.choi --- TVApps/TVApps/ViewModels/AppsHolder.cs | 8 ++++++++ TVApps/TVApps/ViewModels/MainPageViewModel.cs | 9 +++++++++ TVApps/TVApps/Views/MainPage.xaml | 3 ++- TVApps/TVApps/Views/MainPage.xaml.cs | 16 ++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/TVApps/TVApps/ViewModels/AppsHolder.cs b/TVApps/TVApps/ViewModels/AppsHolder.cs index 7461a4c..0117ca9 100755 --- a/TVApps/TVApps/ViewModels/AppsHolder.cs +++ b/TVApps/TVApps/ViewModels/AppsHolder.cs @@ -62,6 +62,8 @@ namespace TVApps.ViewModels /// public string UnpinnedAppName; + public bool IsSelectedExceeds; + /// /// A constructor /// Initializes installed and pinned app list @@ -197,6 +199,12 @@ namespace TVApps.ViewModels } else { + if(PinnedApps.Count >= 10) + { + IsSelectedExceeds = true; + ViewModel.OnPropertyChanged("IsSelectedExceeds"); + return; + } DebuggingUtils.Dbg("Pin! : " + selectedApp); selectedApp.IsChecked = true; selectedApp.IsPinned = true; diff --git a/TVApps/TVApps/ViewModels/MainPageViewModel.cs b/TVApps/TVApps/ViewModels/MainPageViewModel.cs index 84c3ea2..5c77900 100755 --- a/TVApps/TVApps/ViewModels/MainPageViewModel.cs +++ b/TVApps/TVApps/ViewModels/MainPageViewModel.cs @@ -118,6 +118,14 @@ namespace TVApps.ViewModels } } + public bool IsSelectedExceeds + { + get + { + return appsHolder.IsSelectedExceeds; + } + } + /// /// A command will be executed if the cancel button in FooterDeleteStatus is clicked /// @@ -439,5 +447,6 @@ namespace TVApps.ViewModels handler(this, new PropertyChangedEventArgs(propertyName)); } } + } } diff --git a/TVApps/TVApps/Views/MainPage.xaml b/TVApps/TVApps/Views/MainPage.xaml index 62a9fcf..1d3823a 100755 --- a/TVApps/TVApps/Views/MainPage.xaml +++ b/TVApps/TVApps/Views/MainPage.xaml @@ -10,7 +10,8 @@ IsEnabledDeletePopup="{Binding IsEnabledDeletePopup}" IsPinAppRequested="{Binding IsPinAppRequested}" DeletePopupAppLabel="{Binding DeletePopupAppLabel}" - DeletePopupCommand="{Binding DeletePopupCommand}"> + DeletePopupCommand="{Binding DeletePopupCommand}" + IsSelectedExceeds="{Binding IsSelectedExceeds}"> diff --git a/TVApps/TVApps/Views/MainPage.xaml.cs b/TVApps/TVApps/Views/MainPage.xaml.cs index 9764e59..f3abab6 100755 --- a/TVApps/TVApps/Views/MainPage.xaml.cs +++ b/TVApps/TVApps/Views/MainPage.xaml.cs @@ -111,6 +111,14 @@ namespace TVApps.Views set { SetValue(DeletePopupCommandProperty, value); } } + public static readonly BindableProperty IsSelectedExceedsProperty = BindableProperty.Create("IsSelectedExceeds", typeof(bool), typeof(FooterPinStatus), false, BindingMode.TwoWay); + + public bool IsSelectedExceeds + { + get { return (bool)GetValue(IsSelectedExceedsProperty); } + set { SetValue(IsSelectedExceedsProperty, value); } + } + /// /// A method for animation when application is terminated /// @@ -437,6 +445,14 @@ namespace TVApps.Views AppList.InitializeFocus(); } } + else if (e.PropertyName.Equals("IsSelectedExceeds")) + { + if (IsSelectedExceeds) + { + Toast.DisplayText("Number of selected apps exceeds 10."); + IsSelectedExceeds = false; + } + } } /// -- 2.7.4 From fb268bba3a9107581f2879bdf1ef14dc9f3fd084 Mon Sep 17 00:00:00 2001 From: Heonjae Jang Date: Mon, 22 May 2017 18:28:33 +0900 Subject: [PATCH 02/16] Add and change comment in TVHome, TVApps Change-Id: I7538cc76d667b2751ced1a681cb81170b95a1cc1 Signed-off-by: Heonjae Jang --- .../DataModels/AppControlAction.cs | 2 +- .../DataModels/AppShortcutInfo.cs | 6 +-- LibTVRefCommonPortable/DataModels/IAction.cs | 4 +- .../DataModels/SettingShortcutInfo.cs | 6 +++ LibTVRefCommonPortable/DataModels/ShortcutInfo.cs | 2 +- .../Models/AppShortcutController.cs | 14 +++--- .../Models/RecentShortcutController.cs | 2 +- LibTVRefCommonPortable/Utils/AppControlUtils.cs | 6 +-- LibTVRefCommonPortable/Utils/AppShortcutStorage.cs | 16 +++---- LibTVRefCommonPortable/Utils/DebuggingUtils.cs | 8 ++-- LibTVRefCommonPortable/Utils/IAppControl.cs | 6 +-- LibTVRefCommonPortable/Utils/IAppLifeControl.cs | 2 +- .../Utils/IApplicationManagerAPIs.cs | 16 +++---- LibTVRefCommonPortable/Utils/IDebuggingAPIs.cs | 8 ++-- LibTVRefCommonPortable/Utils/IFileSystemAPIs.cs | 8 ++-- .../Utils/IFileSystemWatcherAPIs.cs | 2 +- LibTVRefCommonPortable/Utils/IMediaContentAPIs.cs | 6 +-- LibTVRefCommonPortable/Utils/IPackageManager.cs | 6 +-- .../Utils/IPlatformNotification.cs | 8 ++-- LibTVRefCommonPortable/Utils/ISystemSettings.cs | 2 +- LibTVRefCommonPortable/Utils/ITVHome.cs | 6 +-- LibTVRefCommonPortable/Utils/IWindowAPIs.cs | 2 +- .../Utils/PackageManagerUtils.cs | 4 +- .../Utils/RecentShortcutStorage.cs | 2 +- LibTVRefCommonPortable/Utils/TVHomeImpl.cs | 8 ++-- .../Ports/ApplicationManagerPort.cs | 4 +- LibTVRefCommonTizen/Ports/DbgPort.cs | 2 +- LibTVRefCommonTizen/Ports/PackageManagerPort.cs | 2 +- .../Renderer/NinePatchImageRenderer.cs | 4 +- TVApps/TVApps.TizenTV/TVApps.TizenTV.cs | 2 +- TVApps/TVApps/Controls/AppItemCell.xaml.cs | 50 ++++++++++++++++------ TVApps/TVApps/Controls/AppListView.xaml.cs | 3 +- TVApps/TVApps/TVApps.cs | 14 +++--- TVApps/TVApps/ViewModels/AppsListSorter.cs | 12 +++--- TVApps/TVApps/ViewModels/IAppsViewModel.cs | 2 +- TVApps/TVApps/ViewModels/MainPageViewModel.cs | 8 ++-- TVApps/TVApps/Views/FooterPinStatus.xaml.cs | 1 + TVHome/TVHome.TizenTV/Sniper.cs | 18 ++++---- TVHome/TVHome.TizenTV/TVHome.TizenTV.cs | 2 +- TVHome/TVHome/Controls/PanelButton.cs | 6 +++ TVHome/TVHome/TVHome.cs | 12 +++--- TVHome/TVHome/ViewModels/IHomeViewModel.cs | 2 +- TVHome/TVHome/ViewModels/MainPageViewModel.cs | 8 ++-- TVHome/TVHome/Views/MainPage.xaml.cs | 2 +- TVHome/TVHome/Views/MainPanel.xaml.cs | 13 ++++-- TVHome/TVHome/Views/Panel.cs | 6 ++- TVHome/TVHome/Views/SubPanel.xaml.cs | 15 +++++-- TVHome/TVHome/Views/SubThumbnailPanel.xaml.cs | 4 +- 48 files changed, 199 insertions(+), 145 deletions(-) diff --git a/LibTVRefCommonPortable/DataModels/AppControlAction.cs b/LibTVRefCommonPortable/DataModels/AppControlAction.cs index b51e844..e30afe4 100644 --- a/LibTVRefCommonPortable/DataModels/AppControlAction.cs +++ b/LibTVRefCommonPortable/DataModels/AppControlAction.cs @@ -52,7 +52,7 @@ namespace LibTVRefCommonPortable.DataModels } /// - /// A method which invoke a App Control to the application of the AppID + /// A method which invoke an App Control to the application of the AppID /// /// a next state after App Control invocation public string Execute() diff --git a/LibTVRefCommonPortable/DataModels/AppShortcutInfo.cs b/LibTVRefCommonPortable/DataModels/AppShortcutInfo.cs index cfef3e3..7aeff96 100755 --- a/LibTVRefCommonPortable/DataModels/AppShortcutInfo.cs +++ b/LibTVRefCommonPortable/DataModels/AppShortcutInfo.cs @@ -27,12 +27,12 @@ namespace LibTVRefCommonPortable.DataModels public class AppShortcutInfo : ShortcutInfo { /// - /// A application ID of the App Shortcut. + /// An application ID of the App Shortcut. /// public string AppID { get; set; } /// - /// A App Shortcut status. + /// An App Shortcut status. /// [XmlIgnore] public string Status { get; set; } @@ -179,7 +179,7 @@ namespace LibTVRefCommonPortable.DataModels } /// - /// A app installed time. + /// An app installed time. /// [XmlIgnore] public DateTime Installed { get; set; } diff --git a/LibTVRefCommonPortable/DataModels/IAction.cs b/LibTVRefCommonPortable/DataModels/IAction.cs index e226873..d4616da 100644 --- a/LibTVRefCommonPortable/DataModels/IAction.cs +++ b/LibTVRefCommonPortable/DataModels/IAction.cs @@ -17,12 +17,12 @@ namespace LibTVRefCommonPortable.DataModels { /// - /// A interface defines behaviors that will be exported by inherited classes. + /// An interface defines behaviors that will be exported by inherited classes. /// public interface IAction { /// - /// A method execute a action. + /// A method execute an action. /// /// A next statue of a Shortcut. string Execute(); diff --git a/LibTVRefCommonPortable/DataModels/SettingShortcutInfo.cs b/LibTVRefCommonPortable/DataModels/SettingShortcutInfo.cs index 4cdd35d..fd355d2 100755 --- a/LibTVRefCommonPortable/DataModels/SettingShortcutInfo.cs +++ b/LibTVRefCommonPortable/DataModels/SettingShortcutInfo.cs @@ -18,8 +18,14 @@ using System; namespace LibTVRefCommonPortable.DataModels { + /// + /// A Setting Shortcut information + /// public class SettingShortcutInfo : ShortcutInfo { + /// + /// Initialize State of a shortcut. + /// public override void UpdateState() { SetCurrentState("default"); diff --git a/LibTVRefCommonPortable/DataModels/ShortcutInfo.cs b/LibTVRefCommonPortable/DataModels/ShortcutInfo.cs index 96fb832..b110f36 100644 --- a/LibTVRefCommonPortable/DataModels/ShortcutInfo.cs +++ b/LibTVRefCommonPortable/DataModels/ShortcutInfo.cs @@ -29,7 +29,7 @@ namespace LibTVRefCommonPortable.DataModels public abstract class ShortcutInfo : INotifyPropertyChanged { /// - /// A event handler for handing property changed. + /// An event handler for handing property changed. public event PropertyChangedEventHandler PropertyChanged; /// diff --git a/LibTVRefCommonPortable/Models/AppShortcutController.cs b/LibTVRefCommonPortable/Models/AppShortcutController.cs index 953f0bb..db256bb 100755 --- a/LibTVRefCommonPortable/Models/AppShortcutController.cs +++ b/LibTVRefCommonPortable/Models/AppShortcutController.cs @@ -29,7 +29,7 @@ namespace LibTVRefCommonPortable.Models /// The TVHome shows the Pinned app list when the App Home Menu is pressed, /// by invoking AppShortcutController's API to retrieve the pinned app list. /// The TVApps shows the installed the Tizen UI apps in the main screen. - /// To provides the installed apps, the TVApps invokes a AppShortcutController's API. + /// To provides the installed apps, the TVApps invokes an AppShortcutController's API. /// public class AppShortcutController { @@ -42,7 +42,7 @@ namespace LibTVRefCommonPortable.Models /// A method provides installed app list. /// The returned app list has only Tizen UI apps not the system app or no display apps. /// - /// A installed app list. + /// An installed app list. public async Task> GetInstalledApps() { List appShortcutInfoList = new List(); @@ -88,12 +88,12 @@ namespace LibTVRefCommonPortable.Models } /// - /// A method appends a All Apps Shortcut and a MediaHub Shortcut at first in the given App Shortcut list. + /// A method appends an All Apps Shortcut and a MediaHub Shortcut at first in the given App Shortcut list. /// Actually this method is used for making the Pinned App Shortcut panel of the TVHome /// /// /// - /// A App Shortcut list contains the additional Shortcuts. + /// An App Shortcut list contains the additional Shortcuts. private void AddAllAppsAndMediaHubShortcut(ref List returnPinnedAppsInfo) { var allAppsShortcutInfo = new AppShortcutInfo() @@ -166,11 +166,11 @@ namespace LibTVRefCommonPortable.Models } /// - /// A method appends a Add Pin Shortcut in the given App Shortcut list. + /// A method appends an Add Pin Shortcut in the given App Shortcut list. /// /// /// - /// A App Shortcut list contains the additional Shortcuts. + /// An App Shortcut list contains the additional Shortcuts. private void AppendAddPinShortcut(ref List returnPinnedAppsInfo) { var addPinShortcutInfo = new AppShortcutInfo() @@ -274,7 +274,7 @@ namespace LibTVRefCommonPortable.Models } /// - /// A method provides a App Shortcut list which contains default App Shortcuts + /// A method provides an App Shortcut list which contains default App Shortcuts /// such as the All Apps, the Media Hub, and the Add Pin. /// /// A default App Shortcut list. diff --git a/LibTVRefCommonPortable/Models/RecentShortcutController.cs b/LibTVRefCommonPortable/Models/RecentShortcutController.cs index c35e8fe..ec69ecd 100755 --- a/LibTVRefCommonPortable/Models/RecentShortcutController.cs +++ b/LibTVRefCommonPortable/Models/RecentShortcutController.cs @@ -25,7 +25,7 @@ namespace LibTVRefCommonPortable.Models { /// /// A class provides Recent Shortcut information to the ViewModel - /// The Recent Shortcut can be a app which is recently used and + /// The Recent Shortcut can be an app which is recently used and /// a content which is recently consumed in the TV. /// public class RecentShortcutController diff --git a/LibTVRefCommonPortable/Utils/AppControlUtils.cs b/LibTVRefCommonPortable/Utils/AppControlUtils.cs index 7add8b7..64a8832 100644 --- a/LibTVRefCommonPortable/Utils/AppControlUtils.cs +++ b/LibTVRefCommonPortable/Utils/AppControlUtils.cs @@ -27,8 +27,8 @@ namespace LibTVRefCommonPortable.Utils /// /// A method makes the app to be launched. /// - /// A application ID of the targeted application. - /// A extra data for App Control invoking. + /// An application ID of the targeted application. + /// An extra data for App Control invoking. /// A file Uri to be opened. public static void SendLaunchRequest(string appID, IDictionary extraData = null, string fileUri = null) { @@ -56,7 +56,7 @@ namespace LibTVRefCommonPortable.Utils /// /// A method sends a pin added notification App control to TVHome app. /// - /// A app ID of newly added. + /// An app ID of newly added. public static void SendAppAddedNotificationToHome(string addedAddID) { if (DependencyService.Get() == null) diff --git a/LibTVRefCommonPortable/Utils/AppShortcutStorage.cs b/LibTVRefCommonPortable/Utils/AppShortcutStorage.cs index 83817d7..f415a44 100644 --- a/LibTVRefCommonPortable/Utils/AppShortcutStorage.cs +++ b/LibTVRefCommonPortable/Utils/AppShortcutStorage.cs @@ -42,12 +42,12 @@ namespace LibTVRefCommonPortable.Utils private static IFileSystemWatcherAPIs fileSystemWatcher = DependencyService.Get(); /// - /// A instance of AppShortcutStorage. + /// An instance of AppShortcutStorage. /// private static AppShortcutStorage instance = new AppShortcutStorage(); /// - /// A instance of AppShortcutStorage. + /// An instance of AppShortcutStorage. /// public static AppShortcutStorage Instance { @@ -59,7 +59,7 @@ namespace LibTVRefCommonPortable.Utils /// private AppShortcutStorage() { - // TODO : Make this working properly, a accessing below directory is not permitted. + // TODO : Make this working properly, an accessing below directory is not permitted. //return DependencyService.Get()?.AppDataStorage + "pinned_apps_info.xml"; StoragePath = DependencyService.Get()?.PlatformShareStorage + "pinned_apps_info.xml"; @@ -67,9 +67,9 @@ namespace LibTVRefCommonPortable.Utils } /// - /// A method provides a App Shortcut list. + /// A method provides an app Shortcut list. /// - /// A App Shortcut list. + /// An app Shortcut list. public static async Task> Read() { IFileSystemAPIs fileSystem = DependencyService.Get(); @@ -113,7 +113,7 @@ namespace LibTVRefCommonPortable.Utils /// /// A method updates App Shortcuts of the storage /// - /// A App Shortcuts that pinned by a user. + /// An app Shortcuts that pinned by a user. /// A status of storage update. public static bool Write(IEnumerable pinnedAppInfo) { @@ -133,9 +133,9 @@ namespace LibTVRefCommonPortable.Utils } /// - /// A method sets a event listener for the storage watcher + /// A method sets an event listener for the storage watcher /// - /// A event handler for the storage event + /// An event handler for the storage event public void AddStorageChangedListener(EventHandler eventListener) { fileSystemWatcher.CustomChanged += eventListener; diff --git a/LibTVRefCommonPortable/Utils/DebuggingUtils.cs b/LibTVRefCommonPortable/Utils/DebuggingUtils.cs index 568659d..987251a 100644 --- a/LibTVRefCommonPortable/Utils/DebuggingUtils.cs +++ b/LibTVRefCommonPortable/Utils/DebuggingUtils.cs @@ -31,7 +31,7 @@ namespace LibTVRefCommonPortable.Utils private static IDebuggingAPIs ism; /// - /// A instance of DebuggingUtils + /// An instance of DebuggingUtils /// private static readonly DebuggingUtils instance = new DebuggingUtils(); @@ -49,9 +49,9 @@ namespace LibTVRefCommonPortable.Utils private class DefaultSM : IDebuggingAPIs { /// - /// A method displays a error log. + /// A method displays an error log. /// - /// A error message. + /// An error message. /// A file name. /// A function name. /// A line number. @@ -107,7 +107,7 @@ namespace LibTVRefCommonPortable.Utils } /// - /// A method displays a error message + /// A method displays an error message /// /// A list of command line arguments. /// A file name. diff --git a/LibTVRefCommonPortable/Utils/IAppControl.cs b/LibTVRefCommonPortable/Utils/IAppControl.cs index dca0693..9aa4c3f 100644 --- a/LibTVRefCommonPortable/Utils/IAppControl.cs +++ b/LibTVRefCommonPortable/Utils/IAppControl.cs @@ -20,7 +20,7 @@ using System.Collections.Generic; namespace LibTVRefCommonPortable.Utils { /// - /// A interface for App Control feature + /// An interface for App Control feature /// public interface IAppControl { @@ -33,14 +33,14 @@ namespace LibTVRefCommonPortable.Utils void SendLaunchRequest(string appId, IDictionary extraData, string fileUri); /// - /// A method sends a add pin request App Control to TVApps app. + /// A method sends add pin request App Control to TVApps app. /// void SendAddAppRequestToApps(); /// /// A method sends a pin added notification App control to TVHome app. /// - /// A app ID of newly added. + /// An app ID of newly added. void SendAppAddedNotificationToHome(string addedAddID); } } diff --git a/LibTVRefCommonPortable/Utils/IAppLifeControl.cs b/LibTVRefCommonPortable/Utils/IAppLifeControl.cs index 149b3ad..ab6e2e7 100644 --- a/LibTVRefCommonPortable/Utils/IAppLifeControl.cs +++ b/LibTVRefCommonPortable/Utils/IAppLifeControl.cs @@ -17,7 +17,7 @@ namespace LibTVRefCommonPortable.Utils { /// - /// A Interface for app life management. + /// An interface for app life management. /// public interface IAppLifeControl { diff --git a/LibTVRefCommonPortable/Utils/IApplicationManagerAPIs.cs b/LibTVRefCommonPortable/Utils/IApplicationManagerAPIs.cs index b5a7693..b8ee51c 100755 --- a/LibTVRefCommonPortable/Utils/IApplicationManagerAPIs.cs +++ b/LibTVRefCommonPortable/Utils/IApplicationManagerAPIs.cs @@ -36,17 +36,17 @@ namespace LibTVRefCommonPortable.Utils public String InstanceLabel; /// - /// A app ID + /// An app ID /// public String AppID; /// - /// A app label + /// An app label /// public String Applabel; /// - /// A app icon path + /// An app icon path /// public String IconPath; @@ -67,14 +67,14 @@ namespace LibTVRefCommonPortable.Utils } /// - /// A interface for Application Manager feature + /// An interface for Application Manager feature /// public interface IApplicationManagerAPIs { /// /// A method provides installed application list. /// - /// A installed application list + /// An installed application list Task> GetAllInstalledApplication(); /// @@ -86,8 +86,8 @@ namespace LibTVRefCommonPortable.Utils /// /// A method provides application information which is matched with the given app ID. /// - /// A application ID - /// A installed application information + /// An application ID + /// An installed application information Dictionary GetInstalledApplication(string applicationId); /// @@ -98,7 +98,7 @@ namespace LibTVRefCommonPortable.Utils /// /// A method for removing the specified recent application /// - /// A application ID + /// An application ID void DeleteRecentApplication(string appId); /// diff --git a/LibTVRefCommonPortable/Utils/IDebuggingAPIs.cs b/LibTVRefCommonPortable/Utils/IDebuggingAPIs.cs index 57e3440..eb46618 100644 --- a/LibTVRefCommonPortable/Utils/IDebuggingAPIs.cs +++ b/LibTVRefCommonPortable/Utils/IDebuggingAPIs.cs @@ -19,11 +19,11 @@ using System; namespace LibTVRefCommonPortable.Utils { /// - /// A interface contains debugging methods which are using platform subsystems. + /// An interface contains debugging methods which are using platform subsystems. /// /// /// Implementing this class should be occurred in platform project. - /// Also the implementation should be registered to the DependencyService in a app initialization. + /// Also the implementation should be registered to the DependencyService in an app initialization. /// Please refer to Xamarin Dependency Service /// https://developer.xamarin.com/guides/xamarin-forms/dependency-service/introduction/ /// @@ -35,8 +35,8 @@ namespace LibTVRefCommonPortable.Utils void Popup(string message); /// - /// A method displays a error log. - /// A error message. + /// A method displays an error log. + /// An error message. /// A file name. /// A function name. /// A line number. diff --git a/LibTVRefCommonPortable/Utils/IFileSystemAPIs.cs b/LibTVRefCommonPortable/Utils/IFileSystemAPIs.cs index d3f6017..edeb092 100644 --- a/LibTVRefCommonPortable/Utils/IFileSystemAPIs.cs +++ b/LibTVRefCommonPortable/Utils/IFileSystemAPIs.cs @@ -24,7 +24,7 @@ using System.IO; namespace LibTVRefCommonPortable.Utils { /// - /// A enumeration for the file open mode. + /// An enumeration for the file open mode. /// public enum UtilFileMode { @@ -37,7 +37,7 @@ namespace LibTVRefCommonPortable.Utils } /// - /// A interface for the file operations + /// An interface for the file operations /// public interface IFileSystemAPIs { @@ -69,7 +69,7 @@ namespace LibTVRefCommonPortable.Utils /// A method opens a file on the given mode. /// /// A file path - /// A opening mode + /// An opening mode /// A file descriptor Stream OpenFile(string filePath, UtilFileMode mode); @@ -89,7 +89,7 @@ namespace LibTVRefCommonPortable.Utils /// A method checks if a file existence in the file system. /// /// A file path - /// A existence of the file + /// An existence of the file bool IsFileExist(String filePath); /// diff --git a/LibTVRefCommonPortable/Utils/IFileSystemWatcherAPIs.cs b/LibTVRefCommonPortable/Utils/IFileSystemWatcherAPIs.cs index 7966e52..fda442d 100644 --- a/LibTVRefCommonPortable/Utils/IFileSystemWatcherAPIs.cs +++ b/LibTVRefCommonPortable/Utils/IFileSystemWatcherAPIs.cs @@ -19,7 +19,7 @@ using System; namespace LibTVRefCommonPortable.Utils { /// - /// A interface for the file system watcher. + /// An interface for the file system watcher. /// public interface IFileSystemWatcherAPIs { diff --git a/LibTVRefCommonPortable/Utils/IMediaContentAPIs.cs b/LibTVRefCommonPortable/Utils/IMediaContentAPIs.cs index 82d916c..a0b26a9 100644 --- a/LibTVRefCommonPortable/Utils/IMediaContentAPIs.cs +++ b/LibTVRefCommonPortable/Utils/IMediaContentAPIs.cs @@ -21,12 +21,12 @@ using System.Collections.Generic; namespace LibTVRefCommonPortable.Utils { /// - /// A information of recently played media content + /// An information of recently played media content /// public struct RecentlyPlayedMedia { /// - /// A id of media content + /// An ID of media content /// public string MediaId; @@ -52,7 +52,7 @@ namespace LibTVRefCommonPortable.Utils } /// - /// A interface for getting recently played media contents. + /// An interface for getting recently played media contents. /// public interface IMediaContentAPIs { diff --git a/LibTVRefCommonPortable/Utils/IPackageManager.cs b/LibTVRefCommonPortable/Utils/IPackageManager.cs index 58a8548..cfb14bd 100644 --- a/LibTVRefCommonPortable/Utils/IPackageManager.cs +++ b/LibTVRefCommonPortable/Utils/IPackageManager.cs @@ -19,7 +19,7 @@ using System.Collections.Generic; namespace LibTVRefCommonPortable.Utils { /// - /// A interface for package manager subsystem. + /// An interface for package manager subsystem. /// public interface IPackageManager { @@ -51,9 +51,9 @@ namespace LibTVRefCommonPortable.Utils bool UninstallPackage(string pkgID); /// - /// A method remove the package by using a app ID. + /// A method remove the package by using an app ID. /// - /// A app ID + /// an app ID /// A status of uninstall bool UninstallPackageByAppID(string appID); diff --git a/LibTVRefCommonPortable/Utils/IPlatformNotification.cs b/LibTVRefCommonPortable/Utils/IPlatformNotification.cs index 648ef7c..9c1c07d 100755 --- a/LibTVRefCommonPortable/Utils/IPlatformNotification.cs +++ b/LibTVRefCommonPortable/Utils/IPlatformNotification.cs @@ -18,7 +18,7 @@ namespace LibTVRefCommonPortable.Utils { /// - /// A interface for the platform notification. + /// An interface for the platform notification. /// public interface IPlatformNotification { @@ -33,13 +33,13 @@ namespace LibTVRefCommonPortable.Utils void OnMenuKeyPressed(); /// - /// A method will be called if a app is installed. + /// A method will be called if an app is installed. /// /// A package ID of newly installed. void OnAppInstalled(string pkgID); /// - /// A method will be called if a app is uninstalled. + /// A method will be called if an app is uninstalled. /// /// A package ID of uninstalled. void OnAppUninstalled(string pkgID); @@ -50,7 +50,7 @@ namespace LibTVRefCommonPortable.Utils void OnPinAppRequestReceived(); /// - /// A method will be called if the app gets a app pinned notification App Control request. + /// A method will be called if the app gets an app pinned notification App Control request. /// /// A pinned app ID void OnAppPinnedNotificationReceived(string appID); diff --git a/LibTVRefCommonPortable/Utils/ISystemSettings.cs b/LibTVRefCommonPortable/Utils/ISystemSettings.cs index fe34df8..97c369e 100644 --- a/LibTVRefCommonPortable/Utils/ISystemSettings.cs +++ b/LibTVRefCommonPortable/Utils/ISystemSettings.cs @@ -17,7 +17,7 @@ namespace LibTVRefCommonPortable.Utils { /// - /// A interface for getting system setting informations. + /// An interface for getting system setting informations. /// public interface ISystemSettings { diff --git a/LibTVRefCommonPortable/Utils/ITVHome.cs b/LibTVRefCommonPortable/Utils/ITVHome.cs index 58f503e..c7c6f69 100755 --- a/LibTVRefCommonPortable/Utils/ITVHome.cs +++ b/LibTVRefCommonPortable/Utils/ITVHome.cs @@ -19,7 +19,7 @@ using LibTVRefCommonPortable.Models; namespace LibTVRefCommonPortable.Utils { /// - /// A interface for the TVHomeImpl class + /// An interface for the TVHomeImpl class /// The Models' instances in the TVHomeImpl class, /// so to use the Models from other files, it should access the instance of the TVHomeImpl. /// To reduce dependency between the TVHome and any other file, @@ -28,7 +28,7 @@ namespace LibTVRefCommonPortable.Utils public interface ITVHome { /// - /// A instance of the AppShortcutController + /// An instance of the AppShortcutController /// /// AppShortcutController AppShortcutControllerInstance @@ -37,7 +37,7 @@ namespace LibTVRefCommonPortable.Utils } /// - /// A instance of the RecentShortcutController + /// An instance of the RecentShortcutController /// /// RecentShortcutController RecentShortcutControllerInstance diff --git a/LibTVRefCommonPortable/Utils/IWindowAPIs.cs b/LibTVRefCommonPortable/Utils/IWindowAPIs.cs index 0db84f4..98de5ef 100644 --- a/LibTVRefCommonPortable/Utils/IWindowAPIs.cs +++ b/LibTVRefCommonPortable/Utils/IWindowAPIs.cs @@ -17,7 +17,7 @@ namespace LibTVRefCommonPortable.Utils { /// - /// A interface for the Window management. + /// An interface for the Window management. /// public interface IWindowAPIs { diff --git a/LibTVRefCommonPortable/Utils/PackageManagerUtils.cs b/LibTVRefCommonPortable/Utils/PackageManagerUtils.cs index 20b6c99..36de825 100644 --- a/LibTVRefCommonPortable/Utils/PackageManagerUtils.cs +++ b/LibTVRefCommonPortable/Utils/PackageManagerUtils.cs @@ -84,9 +84,9 @@ namespace LibTVRefCommonPortable.Utils } /// - /// A method remove the package by using a app ID. + /// A method remove the package by using an app ID. /// - /// A app ID + /// An app ID /// A status of uninstall public static bool UninstallPackageByAppID(string appID) { diff --git a/LibTVRefCommonPortable/Utils/RecentShortcutStorage.cs b/LibTVRefCommonPortable/Utils/RecentShortcutStorage.cs index 7691850..6fa8df4 100755 --- a/LibTVRefCommonPortable/Utils/RecentShortcutStorage.cs +++ b/LibTVRefCommonPortable/Utils/RecentShortcutStorage.cs @@ -70,7 +70,7 @@ namespace LibTVRefCommonPortable.Utils /// /// A method deletes a Recent Shortcut. /// - /// A application ID + /// An application ID public static void Delete(string appId) { IApplicationManagerAPIs applicationManagerPort = DependencyService.Get(); diff --git a/LibTVRefCommonPortable/Utils/TVHomeImpl.cs b/LibTVRefCommonPortable/Utils/TVHomeImpl.cs index e85d531..01cd0f2 100755 --- a/LibTVRefCommonPortable/Utils/TVHomeImpl.cs +++ b/LibTVRefCommonPortable/Utils/TVHomeImpl.cs @@ -30,12 +30,12 @@ namespace LibTVRefCommonPortable.Utils public class TVHomeImpl : ITVHome { /// - /// A instance of the TVHomeImpl + /// An instance of the TVHomeImpl /// private static readonly TVHomeImpl instance = new TVHomeImpl(); /// - /// A instance of the TVHomeImpl + /// An instance of the TVHomeImpl /// public static ITVHome GetInstance { @@ -55,7 +55,7 @@ namespace LibTVRefCommonPortable.Utils } /// - /// A instance of the AppShortcutController + /// An instance of the AppShortcutController /// private static readonly AppShortcutController appShortcutController = new AppShortcutController(); public AppShortcutController AppShortcutControllerInstance @@ -67,7 +67,7 @@ namespace LibTVRefCommonPortable.Utils } /// - /// A instance of the RecentShortcutController + /// An instance of the RecentShortcutController /// private static readonly RecentShortcutController recentShortcutController = new RecentShortcutController(); public RecentShortcutController RecentShortcutControllerInstance diff --git a/LibTVRefCommonTizen/Ports/ApplicationManagerPort.cs b/LibTVRefCommonTizen/Ports/ApplicationManagerPort.cs index 98a4cd0..72e833a 100755 --- a/LibTVRefCommonTizen/Ports/ApplicationManagerPort.cs +++ b/LibTVRefCommonTizen/Ports/ApplicationManagerPort.cs @@ -57,7 +57,7 @@ namespace LibTVRefCommonTizen.Ports } /// - /// Clear all recent applications + /// Clears all recent applications /// public void DeleteAllRecentApplication() { @@ -67,7 +67,7 @@ namespace LibTVRefCommonTizen.Ports /// /// Removes the specified application with the app ID /// - /// A application ID that is removed + /// An alication ID that is removed public void DeleteRecentApplication(string appId) { IEnumerable recentApps = ApplicationManager.GetRecentApplications(); diff --git a/LibTVRefCommonTizen/Ports/DbgPort.cs b/LibTVRefCommonTizen/Ports/DbgPort.cs index 3076dc5..64eb213 100644 --- a/LibTVRefCommonTizen/Ports/DbgPort.cs +++ b/LibTVRefCommonTizen/Ports/DbgPort.cs @@ -122,7 +122,7 @@ namespace LibTVRefCommonTizen.Ports } /// - /// Displays a error log message + /// Displays an error log message /// /// A debugging message /// A file name that debugging message is exist diff --git a/LibTVRefCommonTizen/Ports/PackageManagerPort.cs b/LibTVRefCommonTizen/Ports/PackageManagerPort.cs index c1c14ba..b8dc1b1 100644 --- a/LibTVRefCommonTizen/Ports/PackageManagerPort.cs +++ b/LibTVRefCommonTizen/Ports/PackageManagerPort.cs @@ -28,7 +28,7 @@ namespace LibTVRefCommonTizen.Ports public class PackageManagerPort : IPackageManager { /// - /// A interface for platform notification + /// An interface for platform notification /// private static IPlatformNotification Notification { diff --git a/TVApps/TVApps.TizenTV/Renderer/NinePatchImageRenderer.cs b/TVApps/TVApps.TizenTV/Renderer/NinePatchImageRenderer.cs index 9b791b5..f490767 100644 --- a/TVApps/TVApps.TizenTV/Renderer/NinePatchImageRenderer.cs +++ b/TVApps/TVApps.TizenTV/Renderer/NinePatchImageRenderer.cs @@ -32,7 +32,7 @@ namespace TVApps.TizenTV.Renderer /// /// Updates border when Element is changed /// - /// A image element changed event's argument + /// An image element changed event's argument protected override void OnElementChanged(ElementChangedEventArgs args) { base.OnElementChanged(args); @@ -43,7 +43,7 @@ namespace TVApps.TizenTV.Renderer /// Updates border when ElementProperty is changed /// /// The source of the event - /// A image element property changed event's argument + /// An image element property changed event's argument protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs args) { if ((args.PropertyName == NinePatchImage.BorderBottomProperty.PropertyName) diff --git a/TVApps/TVApps.TizenTV/TVApps.TizenTV.cs b/TVApps/TVApps.TizenTV/TVApps.TizenTV.cs index f8a2f19..72abdc5 100755 --- a/TVApps/TVApps.TizenTV/TVApps.TizenTV.cs +++ b/TVApps/TVApps.TizenTV/TVApps.TizenTV.cs @@ -32,7 +32,7 @@ namespace TVApps.TizenTV private static Program instance; /// - /// A interface for the platform notification + /// An interface for the platform notification /// private IPlatformNotification notification; diff --git a/TVApps/TVApps/Controls/AppItemCell.xaml.cs b/TVApps/TVApps/Controls/AppItemCell.xaml.cs index 3c8afa5..9738449 100755 --- a/TVApps/TVApps/Controls/AppItemCell.xaml.cs +++ b/TVApps/TVApps/Controls/AppItemCell.xaml.cs @@ -27,7 +27,7 @@ namespace TVApps.Controls using LibTVRefCommonPortable.DataModels; using Tizen = Xamarin.Forms.PlatformConfiguration.Tizen; /// - /// A enumeration for AppItemCell icon size + /// An enumeration for AppItemCell icon size /// public enum IconSize { @@ -120,33 +120,56 @@ namespace TVApps.Controls set { SetValue(IsItemFocusedProperty, value); } } + /// + /// Identifies the PinCommand bindable property + /// public static readonly BindableProperty PinCommandProperty = BindableProperty.Create("PinCommand", typeof(ICommand), typeof(AppItemCell)); + /// + /// A command will be executed if pin item in context popup is clicked + /// public ICommand PinCommand { get { return (ICommand)GetValue(PinCommandProperty); } set { SetValue(PinCommandProperty, value); } } + /// + /// Identifies the DeleteCommand bindable property + /// public static readonly BindableProperty DeleteCommandProperty = BindableProperty.Create("DeleteCommand", typeof(ICommand), typeof(AppItemCell)); + /// + /// A command will be executed if delete item in context popup is clicked + /// public ICommand DeleteCommand { get { return (ICommand)GetValue(DeleteCommandProperty); } set { SetValue(DeleteCommandProperty, value); } } + /// + /// Identifies the ToDefaultCommand bindable property + /// public static readonly BindableProperty ToDefaultCommandProperty = BindableProperty.Create("ToDefaultCommand", typeof(ICommand), typeof(AppItemCell)); + /// + /// A command will be executed if context popup is dismissed + /// public ICommand ToDefaultCommand { get { return (ICommand)GetValue(ToDefaultCommandProperty); } set { SetValue(ToDefaultCommandProperty, value); } } - + /// + /// Identifies the AppDescription bindable property + /// public static readonly BindableProperty AppDescriptionProperty = BindableProperty.Create("AppDescription", typeof(StateDescription), typeof(AppItemCell)); + /// + /// Gets or sets current StateDescription + /// public StateDescription AppDescription { get { return (StateDescription)GetValue(AppDescriptionProperty); } @@ -154,24 +177,17 @@ namespace TVApps.Controls } private int height16 = SizeUtils.GetHeightSize(16); - private int height32 = SizeUtils.GetHeightSize(32); - private int height84 = SizeUtils.GetHeightSize(84); - private int height100 = SizeUtils.GetHeightSize(100); - - /// - /// 144 px height size - /// private int height144 = SizeUtils.GetHeightSize(144); - private int height271 = SizeUtils.GetHeightSize(271); - private int height284 = SizeUtils.GetHeightSize(284); - private int height300 = SizeUtils.GetHeightSize(300); + /// + /// A flag indicates whether the context popup is showing or not + /// private bool isPopupShowing = false; /// @@ -189,6 +205,9 @@ namespace TVApps.Controls } + /// + /// Initializes Layout width and height + /// private void InitializeSize() { int Width240 = SizeUtils.GetWidthSize(240); @@ -258,12 +277,14 @@ namespace TVApps.Controls length: 167, finished: (a, b) => { - if (IsChecked) { + if (IsChecked) + { StrokeImage.FadeTo(0.99, 167); DimImage.FadeTo(0.99, 167); StrokeImage.ScaleTo(1.195, 167); DimImage.ScaleTo(1.195, 167); } + ButtonImage.ScaleTo(1.195, 167); TextArea.TranslateTo(0.0, height300, 167); }); @@ -323,6 +344,9 @@ namespace TVApps.Controls } } + /// + /// Initializes and shows context popup + /// private void ShowContextPopup() { if (isPopupShowing) diff --git a/TVApps/TVApps/Controls/AppListView.xaml.cs b/TVApps/TVApps/Controls/AppListView.xaml.cs index 49f7323..df96e6d 100755 --- a/TVApps/TVApps/Controls/AppListView.xaml.cs +++ b/TVApps/TVApps/Controls/AppListView.xaml.cs @@ -215,6 +215,7 @@ namespace TVApps.Controls AppLowerList.IsVisible = false; NoContentsView.IsVisible = true; } + if (OnChangeFocusChainingCommand != null) { OnChangeFocusChainingCommand.Execute(""); @@ -224,7 +225,7 @@ namespace TVApps.Controls /// /// A method scrolls the list with spacing /// - /// A index of focused item cell + /// An index of focused item cell private async void ScrollToIndex(int index) { if (AppUpperList.Children.Count > index) diff --git a/TVApps/TVApps/TVApps.cs b/TVApps/TVApps/TVApps.cs index 95368db..1f014a0 100755 --- a/TVApps/TVApps/TVApps.cs +++ b/TVApps/TVApps/TVApps.cs @@ -35,22 +35,22 @@ namespace TVApps public class App : Application, IPlatformNotification { /// - /// A event handler for handling MenuKey event + /// An event handler for handling MenuKey event /// private static EventHandler MenuKeyListener; /// - /// A event handler for handling AppInstalled event + /// An event handler for handling AppInstalled event /// private static EventHandler AppInstalledListener; /// - /// A event handler for handling AppUninstalled event + /// An event handler for handling AppUninstalled event /// private static EventHandler AppUninstalledListener; /// - /// A event handler for handling PinApp request for TV Home + /// An event handler for handling PinApp request for TV Home /// private static EventHandler PinAppRequestListener; @@ -148,7 +148,7 @@ namespace TVApps } /// - /// A method will be called if a app is installed. + /// A method will be called if an app is installed. /// /// A package ID of newly installed. public void OnAppInstalled(string pkgID) @@ -161,7 +161,7 @@ namespace TVApps } /// - /// A method will be called if a app is uninstalled. + /// A method will be called if an app is uninstalled. /// /// A package ID of uninstalled. public void OnAppUninstalled(string pkgID) @@ -183,7 +183,7 @@ namespace TVApps } /// - /// A method will be called if the app gets a app pinned notification App Control request. + /// A method will be called if the app gets an app pinned notification App Control request. /// /// A pinned app ID/// public void OnAppPinnedNotificationReceived(string appID) diff --git a/TVApps/TVApps/ViewModels/AppsListSorter.cs b/TVApps/TVApps/ViewModels/AppsListSorter.cs index b65db7d..c2c9a20 100644 --- a/TVApps/TVApps/ViewModels/AppsListSorter.cs +++ b/TVApps/TVApps/ViewModels/AppsListSorter.cs @@ -29,8 +29,8 @@ namespace TVApps.ViewModels /// A method compares two labels of AppShortcutInfo /// Sorts AppShortcutInfo by label in ascending /// - /// A AppShortcutInfo to be compared with right - /// A AppShortcutInfo to be compared with left + /// An AppShortcutInfo to be compared with right + /// An AppShortcutInfo to be compared with left /// /// left precedes right, return lesser than 0. /// left follows right, return greater than 0. @@ -45,8 +45,8 @@ namespace TVApps.ViewModels /// A method compares two labels of AppShortcutInfo /// Sorts AppShortcutInfo by label in descending /// - /// A AppShortcutInfo to be compared with right - /// A AppShortcutInfo to be compared with left + /// An AppShortcutInfo to be compared with right + /// An AppShortcutInfo to be compared with left /// /// If left precedes right, return greater than 0. /// If left follows right, return lesser than 0. @@ -61,8 +61,8 @@ namespace TVApps.ViewModels /// A method compares two installed dates of AppShortcutInfo /// Sorts AppShortcutInfo by installed date in descending /// - /// A AppShortcutInfo to be compared with right - /// A AppShortcutInfo to be compared with left + /// An AppShortcutInfo to be compared with right + /// An AppShortcutInfo to be compared with left /// /// If left precedes right, return greater than 0. /// If left follows right, return lesser than 0. diff --git a/TVApps/TVApps/ViewModels/IAppsViewModel.cs b/TVApps/TVApps/ViewModels/IAppsViewModel.cs index 1c06dce..b260081 100644 --- a/TVApps/TVApps/ViewModels/IAppsViewModel.cs +++ b/TVApps/TVApps/ViewModels/IAppsViewModel.cs @@ -17,7 +17,7 @@ namespace TVApps.ViewModels { /// - /// A interface for TV Apps MainPageViewModel feature + /// An interface for TV Apps MainPageViewModel feature /// interface IAppsViewModel { diff --git a/TVApps/TVApps/ViewModels/MainPageViewModel.cs b/TVApps/TVApps/ViewModels/MainPageViewModel.cs index 5c77900..7efefd9 100755 --- a/TVApps/TVApps/ViewModels/MainPageViewModel.cs +++ b/TVApps/TVApps/ViewModels/MainPageViewModel.cs @@ -26,7 +26,7 @@ using System.Runtime.CompilerServices; namespace TVApps.ViewModels { /// - /// A enumeration for status of TV Apps + /// An enumeration for status of TV Apps /// public enum AppsStatus { @@ -37,7 +37,7 @@ namespace TVApps.ViewModels }; /// - /// A enumeration for flag how to sort + /// An enumeration for flag how to sort /// public enum SortingOptions { @@ -52,7 +52,7 @@ namespace TVApps.ViewModels class MainPageViewModel : INotifyPropertyChanged, IAppsViewModel { /// - /// A instance of AppsHolder for getting application list + /// An instance of AppsHolder for getting application list /// AppsHolder appsHolder; @@ -232,7 +232,7 @@ namespace TVApps.ViewModels public ShortcutInfo FocusedItem { get; set; } /// - /// A event that is occurred when property of MainPageViewModel is changed + /// An event that is occurred when property of MainPageViewModel is changed /// public event PropertyChangedEventHandler PropertyChanged; diff --git a/TVApps/TVApps/Views/FooterPinStatus.xaml.cs b/TVApps/TVApps/Views/FooterPinStatus.xaml.cs index feb070f..f5c808e 100755 --- a/TVApps/TVApps/Views/FooterPinStatus.xaml.cs +++ b/TVApps/TVApps/Views/FooterPinStatus.xaml.cs @@ -204,6 +204,7 @@ namespace TVApps.Views pinnedAppCount = SumOfCheckedApp; return; } + additionalInfo.Opacity = 0; additionalInfo.Children.Add(AppNameLabel); additionalInfo.Children.Add(AfterLabel); diff --git a/TVHome/TVHome.TizenTV/Sniper.cs b/TVHome/TVHome.TizenTV/Sniper.cs index 3fc0b5e..22c55f0 100644 --- a/TVHome/TVHome.TizenTV/Sniper.cs +++ b/TVHome/TVHome.TizenTV/Sniper.cs @@ -81,8 +81,8 @@ namespace CoreApp /// /// A method for handling launched application /// - /// A ID of launched application - /// A instance ID of launched application + /// An ID of launched application + /// An instance ID of launched application private void AddedCallback(string appId, string instanceId) { EventHandler handler = AddRemoveEvent; @@ -115,8 +115,8 @@ namespace CoreApp /// /// A method for handling terminated application /// - /// A ID of terminated application - /// A instance ID of terminated application + /// An ID of terminated application + /// An instance ID of terminated application private void RemovedCallback(string appId, string instanceId) { EventHandler handler = AddRemoveEvent; @@ -149,8 +149,8 @@ namespace CoreApp /// /// A method for handling application screen is updated /// - /// A ID of application that screen is updated - /// A instance ID of application that screen is updated + /// An ID of application that screen is updated + /// An instance ID of application that screen is updated /// A path of application screen shot private void UpdatedCallback(string appId, string instanceId, string Filename) { @@ -184,8 +184,8 @@ namespace CoreApp /// /// A method for handling screen update is skipped /// - /// A ID of application that screen update is skipped - /// A instance ID of application that screen update is skipped + /// An ID of application that screen update is skipped + /// An instance ID of application that screen update is skipped /// A path of application screen shot /// Returns finish code private int SkipUpdateCallback(string appId, string instanceId, string Filename) @@ -293,7 +293,7 @@ namespace CoreApp /// /// A method requests updating application screen shot /// - /// A instance ID of application + /// An instance ID of application public void RequestUpdate(string instanceId) { try diff --git a/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs b/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs index 9fe9f51..c83c2c7 100755 --- a/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs +++ b/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs @@ -29,7 +29,7 @@ namespace TVHome.TizenTV class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication { /// - /// A interface for the platform notification + /// An interface for the platform notification /// IPlatformNotification notification; /// diff --git a/TVHome/TVHome/Controls/PanelButton.cs b/TVHome/TVHome/Controls/PanelButton.cs index 6c12bd3..895eff6 100755 --- a/TVHome/TVHome/Controls/PanelButton.cs +++ b/TVHome/TVHome/Controls/PanelButton.cs @@ -66,8 +66,14 @@ namespace TVHome.Controls /// public ICommand OnClearAllCommand { get; set; } + /// + /// A Command changes Panel Button to default mode. + /// public ICommand OnDefaultModeCommand { get; set; } + /// + /// A Command will be executed the option menus are showed. + /// public ICommand OnShowOptionsCommand { get; set; } /// diff --git a/TVHome/TVHome/TVHome.cs b/TVHome/TVHome/TVHome.cs index 213a24a..ac5121d 100755 --- a/TVHome/TVHome/TVHome.cs +++ b/TVHome/TVHome/TVHome.cs @@ -50,27 +50,27 @@ namespace TVHome public static readonly string AppStatus = "appstatus"; /// - /// A event handler for handling Home key pressed event + /// An event handler for handling Home key pressed event /// private static EventHandler HomeKeyListener; /// - /// A event handler for handling Menu key pressed event + /// An event handler for handling Menu key pressed event /// private static EventHandler MenuKeyListener; /// - /// A event handler for handling application installed event + /// An event handler for handling application installed event /// private static EventHandler AppInstalledListener; /// - /// A event handler for handling application uninstalled event + /// An event handler for handling application uninstalled event /// private static EventHandler AppUninstalledListener; /// - /// A event handler for handling application pinned event + /// An event handler for handling application pinned event /// private static EventHandler AppPinnedNotificationListener; @@ -206,7 +206,7 @@ namespace TVHome /// /// A method for handling application installed event /// - /// A installed package ID + /// An installed package ID public void OnAppInstalled(string pkgID) { DebuggingUtils.Dbg("[[[ App Installed ]]] " + pkgID); diff --git a/TVHome/TVHome/ViewModels/IHomeViewModel.cs b/TVHome/TVHome/ViewModels/IHomeViewModel.cs index 1aee6f4..d6d374f 100755 --- a/TVHome/TVHome/ViewModels/IHomeViewModel.cs +++ b/TVHome/TVHome/ViewModels/IHomeViewModel.cs @@ -17,7 +17,7 @@ namespace TVHome.ViewModels { /// - /// A interface for TV Home MainPageViewModel + /// An interface for TV Home MainPageViewModel /// interface IHomeViewModel { diff --git a/TVHome/TVHome/ViewModels/MainPageViewModel.cs b/TVHome/TVHome/ViewModels/MainPageViewModel.cs index 493e011..3e5b88f 100755 --- a/TVHome/TVHome/ViewModels/MainPageViewModel.cs +++ b/TVHome/TVHome/ViewModels/MainPageViewModel.cs @@ -129,7 +129,7 @@ namespace TVHome.ViewModels public bool IsShowNoRecentContents { get; set; } /// - /// A event that is occurred when property of MainPageViewModel is changed + /// An event that is occurred when property of MainPageViewModel is changed /// public event PropertyChangedEventHandler PropertyChanged; @@ -500,7 +500,7 @@ namespace TVHome.ViewModels /// /// Removes specified recent application and updates the list to Recent SubPanel /// - /// A application ID + /// An application ID private void RemoveRecentApplication(string appId) { TVHomeImpl.GetInstance.RecentShortcutControllerInstance.Remove(appId); @@ -627,7 +627,7 @@ namespace TVHome.ViewModels /// /// A method for unpin application /// - /// A application ID for unpin + /// An application ID for unpin private void UnpinAppShortcutInfo(string appId) { RemovePinnedApp(appId); @@ -654,7 +654,7 @@ namespace TVHome.ViewModels /// /// A method for remove pinned application /// - /// A ID of application for removing from pinned application list + /// An ID of application for removing from pinned application list private async void RemovePinnedApp(string appID) { Dictionary PinnedApps = await TVHomeImpl.GetInstance.AppShortcutControllerInstance.GetPinnedAppsAppIDs(); diff --git a/TVHome/TVHome/Views/MainPage.xaml.cs b/TVHome/TVHome/Views/MainPage.xaml.cs index 5780690..8479f6e 100755 --- a/TVHome/TVHome/Views/MainPage.xaml.cs +++ b/TVHome/TVHome/Views/MainPage.xaml.cs @@ -79,7 +79,7 @@ namespace TVHome.Views } /// - /// Uniconifies the Home screen(Maximize the Home screen) + /// Uniconifies the Home screen(Maximizes the Home screen) /// private async void Uniconified() { diff --git a/TVHome/TVHome/Views/MainPanel.xaml.cs b/TVHome/TVHome/Views/MainPanel.xaml.cs index 1447636..6e4ad58 100755 --- a/TVHome/TVHome/Views/MainPanel.xaml.cs +++ b/TVHome/TVHome/Views/MainPanel.xaml.cs @@ -52,7 +52,7 @@ namespace TVHome.Views } /// - /// A event handler for handling property changed event + /// An event handler for handling property changed event /// /// The source of the event /// The event that is occurred when property is changed @@ -103,7 +103,7 @@ namespace TVHome.Views /// /// A method for getting focusable element of Panel Button /// - /// A index of panel button to get + /// An index of panel button to get /// A Button element of Panel Button public Button GetButtonToFocusing(int index) { @@ -147,18 +147,23 @@ namespace TVHome.Views /// /// A method for setting focus to Panel Button /// - /// A index of Panel Button to set focus + /// An index of Panel Button to set focus public void SetButtonFocus(int index) { var button = PanelButtonGrid.Children[index]; button.FindByName public bool isFocused; + /// /// A flag indicates whether the panel is move mode or not /// public bool isMoveMode; + /// + /// A flag indicates wheter the ContextPopup Menu is shown or not + /// public bool isShowOptions; /// diff --git a/TVHome/TVHome/Views/SubPanel.xaml.cs b/TVHome/TVHome/Views/SubPanel.xaml.cs index 145d4f4..80e5189 100755 --- a/TVHome/TVHome/Views/SubPanel.xaml.cs +++ b/TVHome/TVHome/Views/SubPanel.xaml.cs @@ -51,6 +51,10 @@ namespace TVHome.Views /// private int selectTransitionHeight = SizeUtils.GetHeightSize(146); + /// + /// A method for getting Panel Buttons + /// + /// A list of panel button views public IList GetSubPanelButtons() { return PanelButtonStack.Children; @@ -71,7 +75,9 @@ namespace TVHome.Views PropertyChanged += OnItemsSourcePropertyChanged; } - + /// + /// A method for handling when menu key is pressed + /// public override void MenuKeyPressed() { isShowOptions = true; @@ -93,8 +99,9 @@ namespace TVHome.Views } } } + /// - /// A event handler for handling property changed event + /// An event handler for handling property changed event /// /// A source of event /// The event that is occurred when property is changed @@ -372,7 +379,7 @@ namespace TVHome.Views /// /// A method for moving the selected item to right /// - /// A index of item to be moved + /// An index of item to be moved /// TODO : Comment this private void MoveItemToRight(int index, PanelButton button) { @@ -419,7 +426,7 @@ namespace TVHome.Views /// /// A method for moving the selected item to left /// - /// A index of item to be moved + /// An index of item to be moved /// TODO : Comment this private void MoveItemToLeft(int index, PanelButton button) { diff --git a/TVHome/TVHome/Views/SubThumbnailPanel.xaml.cs b/TVHome/TVHome/Views/SubThumbnailPanel.xaml.cs index fc1facc..3e293a3 100755 --- a/TVHome/TVHome/Views/SubThumbnailPanel.xaml.cs +++ b/TVHome/TVHome/Views/SubThumbnailPanel.xaml.cs @@ -72,7 +72,7 @@ namespace TVHome.Views } /// - /// + /// A method for handling when menu key is pressed /// public override void MenuKeyPressed() { @@ -89,7 +89,7 @@ namespace TVHome.Views } /// - /// A event handler for handling property changed event + /// An event handler for handling property changed event /// /// A source of event /// The event that is occurred when property is changed -- 2.7.4 From e97364d2d069a413db303ea0aac3240d28d1e9a7 Mon Sep 17 00:00:00 2001 From: Heonjae Jang Date: Tue, 23 May 2017 17:08:49 +0900 Subject: [PATCH 03/16] Change Layout and Animation in TVHome Change-Id: Ie65bc85ccea68bba86f465b84757ab9df2e74f30 Signed-off-by: Heonjae Jang --- TVApps/TVApps/Controls/AppItemCell.xaml | 2 +- TVHome/TVHome/Controls/SubPanelAllAppsButton.xaml.cs | 4 ++-- TVHome/TVHome/Controls/SubPanelButton.xaml.cs | 6 +++--- TVHome/TVHome/Controls/SubPanelSettingButton.xaml.cs | 4 ++-- TVHome/TVHome/Views/MainPage.xaml | 4 ++-- TVHome/TVHome/Views/SubPanel.xaml.cs | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/TVApps/TVApps/Controls/AppItemCell.xaml b/TVApps/TVApps/Controls/AppItemCell.xaml index 3317ab1..d21c79d 100755 --- a/TVApps/TVApps/Controls/AppItemCell.xaml +++ b/TVApps/TVApps/Controls/AppItemCell.xaml @@ -8,7 +8,7 @@ IsChecked="{Binding IsChecked}" IsShowOptions="{Binding IsShowOptions}" IsDim="{Binding IsDim}" - IsFocused="{Binding IsFocused}" + IsItemFocused="{Binding IsFocused}" PinCommand="{Binding OptionMenuPinToggleCommand}" DeleteCommand="{Binding OptionMenuDeleteCommand}" ToDefaultCommand="{Binding ToDefaultCommand}"> diff --git a/TVHome/TVHome/Controls/SubPanelAllAppsButton.xaml.cs b/TVHome/TVHome/Controls/SubPanelAllAppsButton.xaml.cs index 272a785..beb6120 100755 --- a/TVHome/TVHome/Controls/SubPanelAllAppsButton.xaml.cs +++ b/TVHome/TVHome/Controls/SubPanelAllAppsButton.xaml.cs @@ -76,8 +76,8 @@ namespace TVHome.Controls ButtonTitle.FadeTo(0.99, 300); ButtonTitle.TranslateTo(0, selectTransitionHeight, 300); #pragma warning restore CS4014 - await ButtonImage.ScaleTo(1.3, 300); - ButtonDimmedImage.Scale = 1.3; + await ButtonImage.ScaleTo(1.235, 300); + ButtonDimmedImage.Scale = 1.235; } /// diff --git a/TVHome/TVHome/Controls/SubPanelButton.xaml.cs b/TVHome/TVHome/Controls/SubPanelButton.xaml.cs index 8300b5a..270c4b3 100755 --- a/TVHome/TVHome/Controls/SubPanelButton.xaml.cs +++ b/TVHome/TVHome/Controls/SubPanelButton.xaml.cs @@ -35,7 +35,7 @@ namespace TVHome.Controls /// /// SubPanel icon's transition height value when it focused. /// - private int moveTransitionHeight = SizeUtils.GetHeightSize(130); + private int moveTransitionHeight = SizeUtils.GetHeightSize(128); /// /// Constructor @@ -239,8 +239,8 @@ namespace TVHome.Controls ButtonTitle.FadeTo(0.8, 300); ButtonTitle.TranslateTo(0, selectTransitionHeight, 300); #pragma warning restore CS4014 - await ButtonImage.ScaleTo(1.3, 300); - ButtonDimmedImage.Scale = 1.3; + await ButtonImage.ScaleTo(1.235, 300); + ButtonDimmedImage.Scale = 1.235; } /// diff --git a/TVHome/TVHome/Controls/SubPanelSettingButton.xaml.cs b/TVHome/TVHome/Controls/SubPanelSettingButton.xaml.cs index 1101413..bc97f1e 100755 --- a/TVHome/TVHome/Controls/SubPanelSettingButton.xaml.cs +++ b/TVHome/TVHome/Controls/SubPanelSettingButton.xaml.cs @@ -76,8 +76,8 @@ namespace TVHome.Controls ButtonTitle.FadeTo(0.99, 300); ButtonTitle.TranslateTo(0, selectTransitionHeight, 300); #pragma warning restore CS4014 - await ButtonImage.ScaleTo(1.3, 300); - ButtonDimmedImage.Scale = 1.3; + await ButtonImage.ScaleTo(1.235, 300); + ButtonDimmedImage.Scale = 1.235; } /// diff --git a/TVHome/TVHome/Views/MainPage.xaml b/TVHome/TVHome/Views/MainPage.xaml index 1df880f..6bef84f 100755 --- a/TVHome/TVHome/Views/MainPage.xaml +++ b/TVHome/TVHome/Views/MainPage.xaml @@ -44,7 +44,7 @@ diff --git a/TVHome/TVHome/Views/SubPanel.xaml.cs b/TVHome/TVHome/Views/SubPanel.xaml.cs index 80e5189..8f17af5 100755 --- a/TVHome/TVHome/Views/SubPanel.xaml.cs +++ b/TVHome/TVHome/Views/SubPanel.xaml.cs @@ -49,7 +49,7 @@ namespace TVHome.Views /// /// SubPanel icon's transition height value when it focused. /// - private int selectTransitionHeight = SizeUtils.GetHeightSize(146); + private int selectTransitionHeight = SizeUtils.GetHeightSize(122); /// /// A method for getting Panel Buttons -- 2.7.4 From 7c50df1a673427e5a5169eb36f21b2f9d4fe4209 Mon Sep 17 00:00:00 2001 From: "jjie.choi" Date: Wed, 24 May 2017 14:59:42 +0900 Subject: [PATCH 04/16] TV Apps GUI changed. manifest file changed. Change-Id: I246dcceada87b590c36f1619f5423a9937e3ae48 Signed-off-by: jjie.choi --- TVApps/TVApps/Controls/AppItemCell.xaml.cs | 2 +- TVApps/TVApps/Views/MainPage.xaml.cs | 1 + TVHome/TVHome.TizenTV/tizen-manifest.xml | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/TVApps/TVApps/Controls/AppItemCell.xaml.cs b/TVApps/TVApps/Controls/AppItemCell.xaml.cs index 9738449..58e38f7 100755 --- a/TVApps/TVApps/Controls/AppItemCell.xaml.cs +++ b/TVApps/TVApps/Controls/AppItemCell.xaml.cs @@ -336,7 +336,7 @@ namespace TVApps.Controls ButtonImage.ScaleTo((isShow) ? 1 : 1.195, 167); ButtonImage.TranslateTo(0, (isShow) ? 0 : height100, 334); TextArea.TranslateTo(0, (isShow) ? height271 : height300, 167); - TextArea.FadeTo((isShow) ? 0.0 : 0.99, 50); + TextArea.FadeTo((isShow) ? 0.0 : 0.99, 100); if (isShow) { diff --git a/TVApps/TVApps/Views/MainPage.xaml.cs b/TVApps/TVApps/Views/MainPage.xaml.cs index f3abab6..3ec14c3 100755 --- a/TVApps/TVApps/Views/MainPage.xaml.cs +++ b/TVApps/TVApps/Views/MainPage.xaml.cs @@ -400,6 +400,7 @@ namespace TVApps.Views FooterPin.IsVisible = true; FooterDelete.IsVisible = false; BackKeyInfo.Text = "Front"; + AppList.InitializeFocus(); break; case AppsStatus.Delete: FooterNormal.IsVisible = false; diff --git a/TVHome/TVHome.TizenTV/tizen-manifest.xml b/TVHome/TVHome.TizenTV/tizen-manifest.xml index cd899ae..ba93e06 100755 --- a/TVHome/TVHome.TizenTV/tizen-manifest.xml +++ b/TVHome/TVHome.TizenTV/tizen-manifest.xml @@ -5,6 +5,10 @@ xahome.png + + xaapps.png + + http://tizen.org/privilege/bluetooth @@ -17,3 +21,4 @@ http://tizen.org/privilege/keygrab + -- 2.7.4 From d6c4a332bce49b5a2d0a11336eada7eb16ab41a5 Mon Sep 17 00:00:00 2001 From: "jjie.choi" Date: Wed, 24 May 2017 17:36:06 +0900 Subject: [PATCH 05/16] Changed to focus at option button after pin/unpin Change-Id: Id84aeafbde1fa4b97bff2fcf0f27927c5036829e Signed-off-by: jjie.choi --- TVApps/TVApps/ViewModels/MainPageViewModel.cs | 9 +++++++++ TVApps/TVApps/Views/FooterNormalStatus.xaml | 3 ++- TVApps/TVApps/Views/FooterNormalStatus.xaml.cs | 22 ++++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/TVApps/TVApps/ViewModels/MainPageViewModel.cs b/TVApps/TVApps/ViewModels/MainPageViewModel.cs index 7efefd9..626a8b2 100755 --- a/TVApps/TVApps/ViewModels/MainPageViewModel.cs +++ b/TVApps/TVApps/ViewModels/MainPageViewModel.cs @@ -126,6 +126,12 @@ namespace TVApps.ViewModels } } + public bool SetFocusOptionButton + { + get; + set; + } + /// /// A command will be executed if the cancel button in FooterDeleteStatus is clicked /// @@ -290,6 +296,9 @@ namespace TVApps.ViewModels AppControlUtils.SendAppAddedNotificationToHome("org.tizen.settings"); AppControlUtils.SelfTerminate(); } + SetFocusOptionButton = true; + OnPropertyChanged("SetFocusOptionButton"); + }); SortOptionIndexCommand = new Command((sortingOption) => diff --git a/TVApps/TVApps/Views/FooterNormalStatus.xaml b/TVApps/TVApps/Views/FooterNormalStatus.xaml index 849808c..4d65a2f 100644 --- a/TVApps/TVApps/Views/FooterNormalStatus.xaml +++ b/TVApps/TVApps/Views/FooterNormalStatus.xaml @@ -5,6 +5,7 @@ x:Class="TVApps.Views.FooterNormalStatus" PinAppCommand="{Binding ButtonPinAppCommand}" DeleteAppCommand="{Binding ButtonDeleteAppCommand}" - SortOptionIndexCommand="{Binding SortOptionIndexCommand}"> + SortOptionIndexCommand="{Binding SortOptionIndexCommand}" + SetFocusOptionButton ="{Binding SetFocusOptionButton}"> \ No newline at end of file diff --git a/TVApps/TVApps/Views/FooterNormalStatus.xaml.cs b/TVApps/TVApps/Views/FooterNormalStatus.xaml.cs index da65aaa..733e38a 100755 --- a/TVApps/TVApps/Views/FooterNormalStatus.xaml.cs +++ b/TVApps/TVApps/Views/FooterNormalStatus.xaml.cs @@ -64,6 +64,13 @@ namespace TVApps.Views set { SetValue(SortOptionIndexCommandProperty, value); } } + public static readonly BindableProperty SetFocusOptionButtonProperty = BindableProperty.Create("SetFocusOptionButton", typeof(bool), typeof(FooterNormalStatus), false, BindingMode.TwoWay); + public bool SetFocusOptionButton + { + get { return (bool)GetValue(SetFocusOptionButtonProperty); } + set { SetValue(SetFocusOptionButtonProperty, value); } + } + /// /// A command will be executed if the Context Popup is showed or dismissed /// @@ -78,6 +85,8 @@ namespace TVApps.Views CreateSortButton(); CreateOptionButton(); + + PropertyChanged += FooterNormalStatusPropertyChanged; } /// @@ -191,5 +200,18 @@ namespace TVApps.Views isPopupShowing = true; ChangeBackKeyInfoCommand?.Execute(isPopupShowing); } + + + private void FooterNormalStatusPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) + { + if (e.PropertyName.Equals("SetFocusOptionButton")) + { + if (SetFocusOptionButton) + { + OptionButton.Focus(); + SetFocusOptionButton = false; + } + } + } } } -- 2.7.4 From 135babded280d5bb6a21b08e9b3bff1a27d8e844 Mon Sep 17 00:00:00 2001 From: "jjie.choi" Date: Thu, 25 May 2017 14:34:33 +0900 Subject: [PATCH 06/16] Apps Item focus bug fixed. Change-Id: Id76caebf39250b992c05de699bae1a334961a80b Signed-off-by: jjie.choi --- TVApps/TVApps/Controls/AppItemCell.xaml.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/TVApps/TVApps/Controls/AppItemCell.xaml.cs b/TVApps/TVApps/Controls/AppItemCell.xaml.cs index 58e38f7..048ad03 100755 --- a/TVApps/TVApps/Controls/AppItemCell.xaml.cs +++ b/TVApps/TVApps/Controls/AppItemCell.xaml.cs @@ -109,7 +109,7 @@ namespace TVApps.Controls /// /// Identifies the IsFocused bindable property /// - public static readonly BindableProperty IsItemFocusedProperty = BindableProperty.Create("IsFocused", typeof(bool), typeof(AppItemCell), default(bool), BindingMode.TwoWay); + public static readonly BindableProperty IsItemFocusedProperty = BindableProperty.Create("IsItemFocused", typeof(bool), typeof(AppItemCell), default(bool), BindingMode.TwoWay); /// /// Gets or sets focus state of AppItemCell @@ -250,13 +250,12 @@ namespace TVApps.Controls if (e.PropertyName.CompareTo("IsPinned") == 0) { PinnedIcon.FadeTo((IsPinned) ? 0.99 : 0.0, 300); - return; } else if (e.PropertyName.CompareTo("IsChecked") == 0) { // TODO : Change Animation (Add Pin Contents Item : Unselected) - if (IsFocused) + if (IsItemFocused) { this.AbortAnimation("CheckedAnimation"); this.Animate("CheckedAnimation", (v) => @@ -281,7 +280,7 @@ namespace TVApps.Controls { StrokeImage.FadeTo(0.99, 167); DimImage.FadeTo(0.99, 167); - StrokeImage.ScaleTo(1.195, 167); + StrokeImage.ScaleTo(1.195, 0); DimImage.ScaleTo(1.195, 167); } -- 2.7.4 From 65dbaa5bd010b13e32204eaab8453ed2c27c769f Mon Sep 17 00:00:00 2001 From: Heonjae Jang Date: Thu, 25 May 2017 12:40:33 +0900 Subject: [PATCH 07/16] Change ViewCell to RelativeLayout in TVHome Change-Id: Ie1c42edd4136ddd7b80dbaaca164bba995f95d44 Signed-off-by: Heonjae Jang --- TVHome/TVHome/Controls/MainPanelButton.xaml | 8 +- TVHome/TVHome/Controls/MainPanelButton.xaml.cs | 4 +- TVHome/TVHome/Controls/PanelButton.cs | 2 +- TVHome/TVHome/Controls/SubPanelAllAppsButton.xaml | 72 +++++++------- .../TVHome/Controls/SubPanelAllAppsButton.xaml.cs | 6 +- TVHome/TVHome/Controls/SubPanelButton.xaml | 100 ++++++++++---------- TVHome/TVHome/Controls/SubPanelButton.xaml.cs | 18 ++-- TVHome/TVHome/Controls/SubPanelSettingButton.xaml | 40 ++++---- .../TVHome/Controls/SubPanelSettingButton.xaml.cs | 6 +- .../TVHome/Controls/SubPanelThumbnailButton.xaml | 84 ++++++++--------- .../Controls/SubPanelThumbnailButton.xaml.cs | 12 +-- TVHome/TVHome/Views/MainPage.xaml | 103 ++++++++++----------- TVHome/TVHome/Views/MainPanel.xaml.cs | 20 ++-- TVHome/TVHome/Views/Panel.cs | 14 --- TVHome/TVHome/Views/SubPanel.xaml.cs | 24 ++--- TVHome/TVHome/Views/SubThumbnailPanel.xaml.cs | 8 +- 16 files changed, 246 insertions(+), 275 deletions(-) diff --git a/TVHome/TVHome/Controls/MainPanelButton.xaml b/TVHome/TVHome/Controls/MainPanelButton.xaml index 0468c7d..9f017d4 100755 --- a/TVHome/TVHome/Controls/MainPanelButton.xaml +++ b/TVHome/TVHome/Controls/MainPanelButton.xaml @@ -2,10 +2,9 @@ - + x:Class="TVHome.Controls.MainPanelButton" + HorizontalOptions="Center" + VerticalOptions="Center"> - diff --git a/TVHome/TVHome/Controls/MainPanelButton.xaml.cs b/TVHome/TVHome/Controls/MainPanelButton.xaml.cs index 77cb61b..e7418e0 100755 --- a/TVHome/TVHome/Controls/MainPanelButton.xaml.cs +++ b/TVHome/TVHome/Controls/MainPanelButton.xaml.cs @@ -47,8 +47,8 @@ namespace TVHome.Controls { InitializeComponent(); - ButtonBox.WidthRequest = SizeUtils.GetWidthSize(236); - ButtonBox.HeightRequest = SizeUtils.GetHeightSize(260); + WidthRequest = SizeUtils.GetWidthSize(236); + HeightRequest = SizeUtils.GetHeightSize(260); ButtonTitle.FontSize = SizeUtils.GetFontSize(26); ButtonTitle.On().SetFontWeight(FontWeight.Medium); diff --git a/TVHome/TVHome/Controls/PanelButton.cs b/TVHome/TVHome/Controls/PanelButton.cs index 895eff6..efc0162 100755 --- a/TVHome/TVHome/Controls/PanelButton.cs +++ b/TVHome/TVHome/Controls/PanelButton.cs @@ -24,7 +24,7 @@ namespace TVHome.Controls /// TVHome has two panels, MainPanel and SubPanel. The panels have several panel buttons. /// The class for handling panel button's events /// - public abstract class PanelButton : ViewCell + public abstract class PanelButton : RelativeLayout { public bool isMoveMode; public bool isFocused; diff --git a/TVHome/TVHome/Controls/SubPanelAllAppsButton.xaml b/TVHome/TVHome/Controls/SubPanelAllAppsButton.xaml index 706b656..8831de0 100755 --- a/TVHome/TVHome/Controls/SubPanelAllAppsButton.xaml +++ b/TVHome/TVHome/Controls/SubPanelAllAppsButton.xaml @@ -2,41 +2,39 @@ - - - - public partial class MainPanel : Panel { + public delegate void FocusEventHandler(HomeMenuItem item); public delegate void SelectEventHandler(HomeMenuItem item); /// + /// A EventHandler for Item focused event + /// + public FocusEventHandler OnItemFocusedHandler; + + /// /// A EventHandler for Item selected event /// public SelectEventHandler OnItemSelectedHandler; /// + /// Main panel icon's width + /// + private int mainPanelIconWidth = SizeUtils.GetWidthSize(236); + + /// + /// Main panel icon's width + /// + private int mainPanelColumnSpacing = SizeUtils.GetWidthSize(-94); + + /// /// MainPanel icon's transition height value when it focused. /// private int selectTransitionHeight = SizeUtils.GetHeightSize(-78); @@ -48,9 +62,23 @@ namespace TVHome.Views public MainPanel() { InitializeComponent(); + InitializeSize(); PropertyChanged += OnItemsSourcePropertyChanged; } + private void InitializeSize() + { + PanelButtonGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }); + PanelButtonGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(mainPanelIconWidth) }); + PanelButtonGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(mainPanelIconWidth) }); + PanelButtonGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(mainPanelIconWidth) }); + PanelButtonGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }); + + PanelButtonGrid.ColumnSpacing = mainPanelColumnSpacing; + + PanelButtonGrid.ForceLayout(); + } + /// /// An event handler for handling property changed event /// @@ -73,8 +101,9 @@ namespace TVHome.Views HomeMenuItem ItemName = menuIndex; button.OnFocusedCommand = new Command(() => { + ChangeStatusCommand?.Execute(HomeStatus.MainPanelFocused); + OnItemFocusedHandler?.Invoke(ItemName); FocusPanel(); - OnFocusedCommand.Execute(ItemName); }); button.OnClickedCommand = new Command(() => { @@ -113,9 +142,14 @@ namespace TVHome.Views /// /// A method for translating when panel is focused /// - public override async void FocusPanel() + public override void FocusPanel() { - await this.TranslateTo(0, 0, 300); + AnimationExtensions.AbortAnimation(this, "PanelAnimation"); + var currentTranslationY = TranslationY; + Animation animation = new Animation(); + Animation translateAnimation = new Animation(v => TranslationY = (currentTranslationY * (1 - v))); + animation.Add(0, 1, translateAnimation); + animation.Commit(this, "PanelAnimation", length: 300); } /// @@ -131,7 +165,7 @@ namespace TVHome.Views /// public void SelectPanel() { - AnimationExtensions.AbortAnimation(this,"PanelAnimation"); + AnimationExtensions.AbortAnimation(this, "PanelAnimation"); var currentTranslationY = TranslationY; var diff = selectTransitionHeight - currentTranslationY; Animation animation = new Animation(); diff --git a/TVHome/TVHome/Views/Panel.cs b/TVHome/TVHome/Views/Panel.cs index 1c8b1f8..61e9bbe 100755 --- a/TVHome/TVHome/Views/Panel.cs +++ b/TVHome/TVHome/Views/Panel.cs @@ -28,17 +28,17 @@ namespace TVHome.Views public abstract class Panel : ContentView { /// - /// Identifies the OnFocusedCommand bindable property + /// Identifies the ChangeStatusCommand bindable property /// - public static readonly BindableProperty OnFocusedCommandProperty = BindableProperty.Create("OnFocusedCommand", typeof(ICommand), typeof(MainPanel)); + public static readonly BindableProperty ChangeStatusCommandProperty = BindableProperty.Create("ChangeStatusCommand", typeof(ICommand), typeof(MainPanel)); /// /// A command is executed when panel is focused /// - public ICommand OnFocusedCommand + public ICommand ChangeStatusCommand { - get { return (ICommand)GetValue(OnFocusedCommandProperty); } - set { SetValue(OnFocusedCommandProperty, value); } + get { return (ICommand)GetValue(ChangeStatusCommandProperty); } + set { SetValue(ChangeStatusCommandProperty, value); } } /// diff --git a/TVHome/TVHome/Views/SubPanel.xaml b/TVHome/TVHome/Views/SubPanel.xaml index 9e89e08..8a0115c 100755 --- a/TVHome/TVHome/Views/SubPanel.xaml +++ b/TVHome/TVHome/Views/SubPanel.xaml @@ -7,9 +7,7 @@ Orientation="Horizontal" HorizontalOptions="Center"> + Orientation="Horizontal"> \ No newline at end of file diff --git a/TVHome/TVHome/Views/SubPanel.xaml.cs b/TVHome/TVHome/Views/SubPanel.xaml.cs index 283fb96..630dd7e 100755 --- a/TVHome/TVHome/Views/SubPanel.xaml.cs +++ b/TVHome/TVHome/Views/SubPanel.xaml.cs @@ -23,6 +23,7 @@ using System.Windows.Input; using System.Collections.Generic; using LibTVRefCommonPortable.Utils; using System; +using TVHome.ViewModels; namespace TVHome.Views { @@ -72,9 +73,17 @@ namespace TVHome.Views ButtonList = new List(); ButtonViewList = new List(); + + InitializeSize(); PropertyChanged += OnItemsSourcePropertyChanged; } + private void InitializeSize() + { + PanelButtonStack.Spacing = SizeUtils.GetWidthSize(34); + PanelButtonStack.Padding = new Thickness(SizeUtils.GetWidthSize(74), 0, SizeUtils.GetWidthSize(74), SizeUtils.GetWidthSize(26)); + } + /// /// A method for handling when menu key is pressed /// @@ -176,8 +185,8 @@ namespace TVHome.Views button.BindingContext = item; button.OnFocusedCommand = new Command(() => { + ChangeStatusCommand?.Execute(HomeStatus.SubPanelFocused); FocusPanel(); - if (SizeUtils.GetWidthSize((int)button.X) - SizeUtils.GetWidthSize((int)PanelScrollView.ScrollX) < 0) { ScrollToLeft(); @@ -265,7 +274,7 @@ namespace TVHome.Views /// /// A method for hiding the panel /// - public override async void HidePanel() + public override void HidePanel() { isFocused = false; foreach (var item in PanelButtonStack.Children) @@ -273,19 +282,24 @@ namespace TVHome.Views item.IsEnabled = false; } -#pragma warning disable CS4014 PanelScrollView.ScrollToAsync(0, 0, true); - this.TranslateTo(0, selectTransitionHeight, 300); -#pragma warning restore CS4014 - await this.FadeTo(0, 300); + AnimationExtensions.AbortAnimation(this, "PanelAnimation"); + var currentTranslationY = TranslationY; + var diff = selectTransitionHeight - currentTranslationY; + var currentOpacity = Opacity; + Animation animation = new Animation(); + Animation translateAnimation = new Animation(v => TranslationY = (currentTranslationY + diff * v)); + Animation fadeAnimation = new Animation(v => Opacity = currentOpacity * (1 - v)); + animation.Add(0, 1, translateAnimation); + animation.Add(0, 1, fadeAnimation); + animation.Commit(this, "PanelAnimation", length: 300); } /// /// A method for showing the panel /// - public override async void ShowPanel() + public override void ShowPanel() { -#pragma warning disable CS4014 isFocused = false; foreach (var item in PanelButtonStack.Children) { @@ -294,28 +308,28 @@ namespace TVHome.Views //item.FindByName("ButtonDimmedImage").ScaleTo(1.0, 300); } - this.TranslateTo(0, 0, 300); -#pragma warning restore CS4014 - await this.FadeTo(1, 300); + AnimationExtensions.AbortAnimation(this, "PanelAnimation"); + var currentTranslationY = TranslationY; + var currentOpacity = Opacity; + var diff = 1 - currentOpacity; + Animation animation = new Animation(); + Animation translateAnimation = new Animation(v => TranslationY = (currentTranslationY * (1 - v))); + Animation fadeAnimation = new Animation(v => Opacity = currentOpacity + diff * v); + animation.Add(0, 1, translateAnimation); + animation.Add(0, 1, fadeAnimation); + animation.Commit(this, "PanelAnimation", length: 300); } /// /// A method for handling panel focused event /// - public override async void FocusPanel() + public override void FocusPanel() { if (isFocused) { - if (!isMoveMode) - { - OnFocusedCommand.Execute(""); - } - return; } - OnFocusedCommand.Execute(""); - isFocused = true; var button = PanelButtonStack.Children[1]; button.FindByName