From: Hyerim Kim Date: Wed, 5 Apr 2017 13:35:42 +0000 (+0900) Subject: 1. Add setting list in Setting SubPanel X-Git-Tag: submit/tizen/20170808.015446~121 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ecb0308307b39a7f83c4206d3ebc5edd266aa4a;p=profile%2Ftv%2Fapps%2Fdotnet%2Fhome.git 1. Add setting list in Setting SubPanel 2. Add Context popup in Recent SubPanel 3. Implement Remove/Clear all Change-Id: I896860dc9f27d49fd7c3ae673378da67d27ef2bd Signed-off-by: Hyerim Kim --- diff --git a/LibTVRefCommonPortable/DataModels/BTLaunchAction.cs b/LibTVRefCommonPortable/DataModels/BTLaunchAction.cs deleted file mode 100644 index 6a1e834..0000000 --- a/LibTVRefCommonPortable/DataModels/BTLaunchAction.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 LibTVRefCommonPortable.Utils; -using Xamarin.Forms; - -namespace LibTVRefCommonPortable.DataModels -{ - /// - /// A Bluetooth Shortcut - /// - class BTLaunchAction : IAction - { - /// - /// A method execute a action. - /// In this method Bluetooth settings app will be launched. - /// - /// A next statue of a Shortcut. - public string Execute() - { - IBTAPIs ibtapis; - - ibtapis = DependencyService.Get(); - ibtapis?.LaunchBTSetting(); - - return "launch"; - } - } -} diff --git a/LibTVRefCommonPortable/DataModels/BTOffAction.cs b/LibTVRefCommonPortable/DataModels/BTOffAction.cs deleted file mode 100644 index 58c95f5..0000000 --- a/LibTVRefCommonPortable/DataModels/BTOffAction.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ - - -namespace LibTVRefCommonPortable.DataModels -{ - /// - /// A Bluetooth Off Action - /// - class BTOffAction : IAction - { - /// - /// A method turns off Bluetooth. - /// - /// A next statue of a Shortcut. - public string Execute() - { - // Turn BT Off - return "off"; - } - } -} diff --git a/LibTVRefCommonPortable/DataModels/BTOnAction.cs b/LibTVRefCommonPortable/DataModels/BTOnAction.cs deleted file mode 100644 index d355fca..0000000 --- a/LibTVRefCommonPortable/DataModels/BTOnAction.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - -namespace LibTVRefCommonPortable.DataModels -{ - /// - /// A Bluetooth On Action - /// - class BTOnAction : IAction - { - /// - /// A method turns on Bluetooth. - /// - /// A next statue of a Shortcut. - public string Execute() - { - // Turn BT On - return "on"; - } - } -} diff --git a/LibTVRefCommonPortable/DataModels/BTSettingShortcutInfo.cs b/LibTVRefCommonPortable/DataModels/BTSettingShortcutInfo.cs deleted file mode 100644 index 35e8939..0000000 --- a/LibTVRefCommonPortable/DataModels/BTSettingShortcutInfo.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - - -namespace LibTVRefCommonPortable.DataModels -{ - /// - /// BT Setting shortcut information - /// - /// - public class BTSettingShortcutInfo : ShortcutInfo - { - /// - /// Update State of a shortcut. - /// - public override void UpdateState() - { - // 1. Check Current BT Status. - - // 2. Set Description - SetCurrentState("off"); - } - } -} diff --git a/LibTVRefCommonPortable/DataModels/RecentShortcutInfo.cs b/LibTVRefCommonPortable/DataModels/RecentShortcutInfo.cs old mode 100644 new mode 100755 index 6623cfd..255d3f5 --- a/LibTVRefCommonPortable/DataModels/RecentShortcutInfo.cs +++ b/LibTVRefCommonPortable/DataModels/RecentShortcutInfo.cs @@ -23,6 +23,10 @@ namespace LibTVRefCommonPortable.DataModels /// public class RecentShortcutInfo : ShortcutInfo { + /// + /// A application ID + /// + public string AppID { get; set; } /// /// A Last used Time /// diff --git a/LibTVRefCommonPortable/DataModels/SettingShortcutInfo.cs b/LibTVRefCommonPortable/DataModels/SettingShortcutInfo.cs new file mode 100755 index 0000000..4cdd35d --- /dev/null +++ b/LibTVRefCommonPortable/DataModels/SettingShortcutInfo.cs @@ -0,0 +1,28 @@ +/* + * 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 System; + +namespace LibTVRefCommonPortable.DataModels +{ + public class SettingShortcutInfo : ShortcutInfo + { + public override void UpdateState() + { + SetCurrentState("default"); + } + } +} diff --git a/LibTVRefCommonPortable/DataModels/WiFiLaunchAction.cs b/LibTVRefCommonPortable/DataModels/WiFiLaunchAction.cs deleted file mode 100644 index 89b6c50..0000000 --- a/LibTVRefCommonPortable/DataModels/WiFiLaunchAction.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 LibTVRefCommonPortable.Utils; -using Xamarin.Forms; - -namespace LibTVRefCommonPortable.DataModels -{ - /// - /// A Action to shows a WiFi settings - /// - class WiFiLaunchAction : IAction - { - /// - /// A method execute a action. - /// This method will launch the WiFi settings app. - /// - /// A next statue of a Shortcut. - public string Execute() - { - // Launch WiFi Setting - IWifiAPIs iwifiapis; - - iwifiapis = DependencyService.Get(); - iwifiapis?.LaunchWifiSetting(); - - return "launch"; - } - } -} diff --git a/LibTVRefCommonPortable/DataModels/WiFiOffAction.cs b/LibTVRefCommonPortable/DataModels/WiFiOffAction.cs deleted file mode 100644 index 7594093..0000000 --- a/LibTVRefCommonPortable/DataModels/WiFiOffAction.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - - -namespace LibTVRefCommonPortable.DataModels -{ - /// - /// A WiFi Off Action - /// - class WiFiOffAction : IAction - { - /// - /// A method turns off the WiFi. - /// A next statue of a Shortcut. - public string Execute() - { - // Turn WiFi Off - return "off"; - } - } -} diff --git a/LibTVRefCommonPortable/DataModels/WiFiOnAction.cs b/LibTVRefCommonPortable/DataModels/WiFiOnAction.cs deleted file mode 100644 index 4c847d5..0000000 --- a/LibTVRefCommonPortable/DataModels/WiFiOnAction.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - - -namespace LibTVRefCommonPortable.DataModels -{ - /// - /// A WiFi On Action - /// - class WiFiOnAction : IAction - { - /// - /// A method turns off the WiFi. - /// A next statue of a Shortcut. - public string Execute() - { - // Turn WiFi On - return "on"; - } - } -} diff --git a/LibTVRefCommonPortable/DataModels/WiFiSettingShortcutInfo.cs b/LibTVRefCommonPortable/DataModels/WiFiSettingShortcutInfo.cs deleted file mode 100644 index 2cd402d..0000000 --- a/LibTVRefCommonPortable/DataModels/WiFiSettingShortcutInfo.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 System; - -namespace LibTVRefCommonPortable.DataModels -{ - /// - /// A class represents the WiFi setting Shortcut. - /// - public class WiFiSettingShortcutInfo : ShortcutInfo - { - /// - /// A method initializes the status of a Shortcut. - /// - public override void UpdateState() - { - // 1. Check Current WiFi Status. - - // 2. Set Description - SetCurrentState("off"); - } - } -} diff --git a/LibTVRefCommonPortable/LibTVRefCommonPortable.csproj b/LibTVRefCommonPortable/LibTVRefCommonPortable.csproj old mode 100644 new mode 100755 index 7df8835..1b1f96c --- a/LibTVRefCommonPortable/LibTVRefCommonPortable.csproj +++ b/LibTVRefCommonPortable/LibTVRefCommonPortable.csproj @@ -37,27 +37,18 @@ - - - - + - - - - - - @@ -68,18 +59,20 @@ - - + + ..\packages\Tizen.Xamarin.Forms.Extension.2.3.4-r214-001\lib\portable-win+net45+wp80+win81+wpa81\Tizen.Xamarin.Forms.Extension.dll + True + ..\packages\Xamarin.Forms.2.3.4.214-pre5\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Core.dll True diff --git a/LibTVRefCommonPortable/Models/RecentShortcutController.cs b/LibTVRefCommonPortable/Models/RecentShortcutController.cs old mode 100644 new mode 100755 index 4ef9e6e..6678270 --- a/LibTVRefCommonPortable/Models/RecentShortcutController.cs +++ b/LibTVRefCommonPortable/Models/RecentShortcutController.cs @@ -39,10 +39,11 @@ namespace LibTVRefCommonPortable.Models /// /// A method removes a Recent Shortcut. /// - /// a Recent Shortcut to be removed. - public void Remove(RecentShortcutInfo history) + /// a Recent Shortcut's appId to be removed. + public void Remove(string appId) { - RecentShortcutStorage.Delete(history); + //RecentShortcutStorage.Delete(history); + RecentShortcutStorage.Delete(appId); } /// @@ -90,6 +91,7 @@ namespace LibTVRefCommonPortable.Models recentShortcutInfo.ScreenshotPath = "screenshot.png"; recentShortcutInfo.StateDescriptions.Add("default", defaultStateDescription); recentShortcutInfo.CurrentStateDescription = defaultStateDescription; + recentShortcutInfo.AppID = item.appID; recentShortcutInfoList.Add(recentShortcutInfo); } diff --git a/LibTVRefCommonPortable/Models/SettingShortcutController.cs b/LibTVRefCommonPortable/Models/SettingShortcutController.cs deleted file mode 100755 index a2a80eb..0000000 --- a/LibTVRefCommonPortable/Models/SettingShortcutController.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 System.Collections.Generic; -using LibTVRefCommonPortable.DataModels; - -namespace LibTVRefCommonPortable.Models -{ - /// - /// A class provides Settings Shortcut information. - /// - public class SettingShortcutController - { - /// - /// A Setting Shortcut list. - /// - private List settingShortcutList = new List(); - - /// - /// A Constructor - /// Set dedicated Settings to be displayed in the TVHome. - /// - public SettingShortcutController() - { - // TODO : read from file!!! - ShortcutInfo settings = SettingShortcutFactory.Get(SettingID.SETTINGS); - settingShortcutList.Add(settings); - - ShortcutInfo wifi = SettingShortcutFactory.Get(SettingID.WiFi); - settingShortcutList.Add(wifi); - - ShortcutInfo bt = SettingShortcutFactory.Get(SettingID.BLUETOOTH); - settingShortcutList.Add(bt); - - // TODO : Provides list of SettingShortcuts - } - - /// - /// A method provides Setting Shortcut list. - /// - /// A Setting Shortcut list. - public IEnumerable GetList() - { - return new List(settingShortcutList); - } - - } -} diff --git a/LibTVRefCommonPortable/Models/SettingShortcutFactory.cs b/LibTVRefCommonPortable/Models/SettingShortcutFactory.cs deleted file mode 100755 index 1904a97..0000000 --- a/LibTVRefCommonPortable/Models/SettingShortcutFactory.cs +++ /dev/null @@ -1,164 +0,0 @@ -/* - * 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 LibTVRefCommonPortable.DataModels; - -namespace LibTVRefCommonPortable.Models -{ - /// - /// A enumeration for Setting Shortcut making. - /// - public enum SettingID - { - SETTINGS, - WiFi, - BLUETOOTH - }; - - /// - /// A factory class to provide Setting Shortcuts. - /// - public static class SettingShortcutFactory - { - /// - /// A method provides Setting Shortcuts. - /// - /// A Setting ID - /// A Setting Shortcut. - public static ShortcutInfo Get(SettingID id) - { - ShortcutInfo sc; - switch (id) - { - case SettingID.SETTINGS: - sc = new AppShortcutInfo() - { - StateDescriptions = - { - { - "default", - new StateDescription - { - Label = "Settings", - IconPath = "ic_tizen_home_menu_settings_selected.png", - Action = new AppControlAction() - { - AppID = "org.tizen.settings" - }, - } - }, - } - }; - sc.UpdateState(); - return sc; - - case SettingID.WiFi: - sc = new WiFiSettingShortcutInfo() - { - StateDescriptions = - { - { - "default", - new StateDescription - { - Label = "WiFi ON", - IconPath = "AppIcon.png", - Action = new WiFiOffAction(), - } - }, - { - "on", - new StateDescription - { - Label = "WiFi ON", - IconPath = "AppIcon.png", - Action = new WiFiOffAction(), - } - }, - { - "off", - new StateDescription - { - Label = "WiFi OFF", - IconPath = "AppIcon.png", - Action = new WiFiOnAction(), - } - }, - { - "launch", - new StateDescription - { - Label = "WiFi Launch", - IconPath = "AppIcon.png", - Action = new WiFiLaunchAction(), - } - }, - } - }; - sc.UpdateState(); - return sc; - - case SettingID.BLUETOOTH: - sc = new BTSettingShortcutInfo() - { - StateDescriptions = - { - { - "default", - new StateDescription - { - Label = "BT ON", - IconPath = "AppIcon.png", - Action = new BTOffAction(), - } - }, - { - "on", - new StateDescription - { - Label = "BT ON", - IconPath = "AppIcon.png", - Action = new BTOffAction(), - } - }, - { - "off", - new StateDescription - { - Label = "BT OFF", - IconPath = "AppIcon.png", - Action = new BTOnAction(), - } - }, - { - "launch", - new StateDescription - { - Label = "BT Launch", - IconPath = "AppIcon.png", - Action = new BTLaunchAction(), - } - }, - } - }; - sc.UpdateState(); - return sc; - } - - return null; - } - } -} diff --git a/LibTVRefCommonPortable/Utils/IApplicationManagerAPIs.cs b/LibTVRefCommonPortable/Utils/IApplicationManagerAPIs.cs old mode 100644 new mode 100755 index 62bfa08..cf65a8e --- a/LibTVRefCommonPortable/Utils/IApplicationManagerAPIs.cs +++ b/LibTVRefCommonPortable/Utils/IApplicationManagerAPIs.cs @@ -84,5 +84,15 @@ namespace LibTVRefCommonPortable.Utils /// A application ID /// A installed application information Dictionary GetInstalledApplication(string applicationId); + + /// + /// A method for removing all recent applications + /// + void DeleteAllRecentApplication(); + + /// + /// A method for removing the specified recent application + /// + void DeleteRecentApplication(string appId); } } diff --git a/LibTVRefCommonPortable/Utils/IBTAPIs.cs b/LibTVRefCommonPortable/Utils/IBTAPIs.cs deleted file mode 100644 index ca0b5f1..0000000 --- a/LibTVRefCommonPortable/Utils/IBTAPIs.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -namespace LibTVRefCommonPortable.Utils -{ - /// - /// A Bluetooth interface. - /// - public interface IBTAPIs - { - /// - /// A method turns on the Bluetooth - /// - void BTOn(); - - /// - /// A method turns off the Bluetooth - /// - void BTOff(); - - /// - /// A method launches BT settings app. - /// - void LaunchBTSetting(); - } -} diff --git a/LibTVRefCommonPortable/Utils/ITVHome.cs b/LibTVRefCommonPortable/Utils/ITVHome.cs old mode 100644 new mode 100755 index 21aab96..58f503e --- a/LibTVRefCommonPortable/Utils/ITVHome.cs +++ b/LibTVRefCommonPortable/Utils/ITVHome.cs @@ -44,14 +44,5 @@ namespace LibTVRefCommonPortable.Utils { get; } - - /// - /// A instance of the SettingShortcutController - /// - /// - SettingShortcutController SettingShortcutControllerInstance - { - get; - } } } diff --git a/LibTVRefCommonPortable/Utils/IWifiAPIs.cs b/LibTVRefCommonPortable/Utils/IWifiAPIs.cs deleted file mode 100644 index 32b81cc..0000000 --- a/LibTVRefCommonPortable/Utils/IWifiAPIs.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -namespace LibTVRefCommonPortable.Utils -{ - /// - /// A class for the WiFi function control - /// - public interface IWifiAPIs - { - /// - /// A method turns on the WiFi. - /// - void WifiOn(); - - /// - /// A method turns off the WiFi. - /// - void WifiOff(); - - /// - /// A method launches the WiFi Settings app. - /// - void LaunchWifiSetting(); - } -} diff --git a/LibTVRefCommonPortable/Utils/RecentShortcutStorage.cs b/LibTVRefCommonPortable/Utils/RecentShortcutStorage.cs old mode 100644 new mode 100755 index 01de300..6920fa3 --- a/LibTVRefCommonPortable/Utils/RecentShortcutStorage.cs +++ b/LibTVRefCommonPortable/Utils/RecentShortcutStorage.cs @@ -16,6 +16,7 @@ using System.Collections.Generic; using LibTVRefCommonPortable.DataModels; +using Xamarin.Forms; namespace LibTVRefCommonPortable.Utils { @@ -70,8 +71,10 @@ namespace LibTVRefCommonPortable.Utils /// A method deletes a Recent Shortcut. /// /// A recent Shortcut - public static void Delete(ShortcutInfo shortcut) + public static void Delete(string appId) { + IApplicationManagerAPIs applicationManagerPort = DependencyService.Get(); + applicationManagerPort.DeleteRecentApplication(appId); } /// @@ -79,6 +82,8 @@ namespace LibTVRefCommonPortable.Utils /// public static void DeleteAll() { + IApplicationManagerAPIs applicationManagerPort = DependencyService.Get(); + applicationManagerPort.DeleteAllRecentApplication(); } } } diff --git a/LibTVRefCommonPortable/Utils/TVHomeImpl.cs b/LibTVRefCommonPortable/Utils/TVHomeImpl.cs old mode 100644 new mode 100755 index d923053..e85d531 --- a/LibTVRefCommonPortable/Utils/TVHomeImpl.cs +++ b/LibTVRefCommonPortable/Utils/TVHomeImpl.cs @@ -77,17 +77,5 @@ namespace LibTVRefCommonPortable.Utils return recentShortcutController; } } - - /// - /// A instance of the SettingShortcutController - /// - private static readonly SettingShortcutController settingShortcutController = new SettingShortcutController(); - public SettingShortcutController SettingShortcutControllerInstance - { - get - { - return settingShortcutController; - } - } } } diff --git a/LibTVRefCommonTizen/LibTVRefCommonTizen.csproj b/LibTVRefCommonTizen/LibTVRefCommonTizen.csproj old mode 100644 new mode 100755 index 0cc9d91..cdd82fd --- a/LibTVRefCommonTizen/LibTVRefCommonTizen.csproj +++ b/LibTVRefCommonTizen/LibTVRefCommonTizen.csproj @@ -47,13 +47,11 @@ - - diff --git a/LibTVRefCommonTizen/Ports/ApplicationManagerPort.cs b/LibTVRefCommonTizen/Ports/ApplicationManagerPort.cs old mode 100644 new mode 100755 index 59af18c..8182734 --- a/LibTVRefCommonTizen/Ports/ApplicationManagerPort.cs +++ b/LibTVRefCommonTizen/Ports/ApplicationManagerPort.cs @@ -56,6 +56,33 @@ namespace LibTVRefCommonTizen.Ports DebuggingUtils.Dbg(launchedEventArgs.ApplicationRunningContext.ApplicationId + " launched"); } + /// + /// Clear all recent applications + /// + public void DeleteAllRecentApplication() + { + RecentApplicationControl.DeleteAll(); + } + + /// + /// Removes the specified application with the app ID + /// + /// A application ID that is removed + public void DeleteRecentApplication(string appId) + { + IEnumerable recentApps = ApplicationManager.GetRecentApplications(); + string pkgId = PackageManager.GetPackageIdByApplicationId(appId); + + foreach (var item in recentApps) + { + if (item.PackageId.Equals(pkgId)) + { + RecentApplicationControl controller = item.Controller; + controller.Delete(); + } + } + } + /// /// Gets the information of the recent applications /// diff --git a/LibTVRefCommonTizen/Ports/BTModulePort.cs b/LibTVRefCommonTizen/Ports/BTModulePort.cs deleted file mode 100644 index f2fedcf..0000000 --- a/LibTVRefCommonTizen/Ports/BTModulePort.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.Platform.Tizen.Native; -using Tizen; -using LibTVRefCommonPortable.Utils; -using System; - -namespace LibTVRefCommonTizen.Ports -{ - public class BTModulePort : IBTAPIs - { - public void BTOff() - { - DebuggingUtils.Dbg("BT is OFF"); - } - - public void BTOn() - { - DebuggingUtils.Dbg("BT is ON"); - } - - public void LaunchBTSetting() - { - DebuggingUtils.Dbg("BT setting is launched"); - } - } -} \ No newline at end of file diff --git a/LibTVRefCommonTizen/Ports/WifiModulePort.cs b/LibTVRefCommonTizen/Ports/WifiModulePort.cs deleted file mode 100644 index 89cefba..0000000 --- a/LibTVRefCommonTizen/Ports/WifiModulePort.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.Platform.Tizen.Native; -using Tizen; -using LibTVRefCommonPortable.Utils; -using System; - -namespace LibTVRefCommonTizen.Ports -{ - public class WifiModulePort : IWifiAPIs - { - - public void WifiOff() - { - DebuggingUtils.Dbg("WiFi is OFF"); - } - - public void WifiOn() - { - DebuggingUtils.Dbg("WiFi is ON"); - } - - public void LaunchWifiSetting() - { - DebuggingUtils.Dbg("WiFi setting is launched"); - } - } -} \ No newline at end of file diff --git a/TVApps/TVApps.TizenTV/TVApps.TizenTV.cs b/TVApps/TVApps.TizenTV/TVApps.TizenTV.cs old mode 100644 new mode 100755 index c065409..44300b7 --- a/TVApps/TVApps.TizenTV/TVApps.TizenTV.cs +++ b/TVApps/TVApps.TizenTV/TVApps.TizenTV.cs @@ -135,8 +135,6 @@ namespace TVApps.TizenTV Xamarin.Forms.DependencyService.Register(); Xamarin.Forms.DependencyService.Register(); Xamarin.Forms.DependencyService.Register(); - Xamarin.Forms.DependencyService.Register(); - Xamarin.Forms.DependencyService.Register(); Xamarin.Forms.DependencyService.Register(); Xamarin.Forms.DependencyService.Register(); Xamarin.Forms.DependencyService.Register(); diff --git a/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs b/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs index db194e3..268d499 100755 --- a/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs +++ b/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs @@ -155,8 +155,6 @@ namespace TVHome.TizenTV global::Xamarin.Forms.DependencyService.Register(); global::Xamarin.Forms.DependencyService.Register(); global::Xamarin.Forms.DependencyService.Register(); - global::Xamarin.Forms.DependencyService.Register(); - global::Xamarin.Forms.DependencyService.Register(); global::Xamarin.Forms.DependencyService.Register(); global::Xamarin.Forms.DependencyService.Register(); global::Xamarin.Forms.DependencyService.Register(); diff --git a/TVHome/TVHome/Controls/PanelButton.cs b/TVHome/TVHome/Controls/PanelButton.cs index 5b84efe..4f310e8 100755 --- a/TVHome/TVHome/Controls/PanelButton.cs +++ b/TVHome/TVHome/Controls/PanelButton.cs @@ -53,6 +53,16 @@ namespace TVHome.Controls /// public ICommand OnUnpinCommand { get; set; } + /// + /// A Command will be executed the recent is removed. + /// + public ICommand OnClearCommand { get; set; } + + /// + /// A Command will be executed the all recent are cleared. + /// + public ICommand OnClearAllCommand { get; set; } + /// /// Handles Button Focused event /// diff --git a/TVHome/TVHome/Controls/SubPanelThumbnailButton.xaml b/TVHome/TVHome/Controls/SubPanelThumbnailButton.xaml old mode 100644 new mode 100755 index 3409847..1ac9573 --- a/TVHome/TVHome/Controls/SubPanelThumbnailButton.xaml +++ b/TVHome/TVHome/Controls/SubPanelThumbnailButton.xaml @@ -8,6 +8,11 @@ WidthRequest="320" HeightRequest="180" Opacity="0"/> + -