From cb5418de4668713a45ca77b59e96775b0f985711 Mon Sep 17 00:00:00 2001 From: Hyerim Kim Date: Fri, 10 Mar 2017 16:12:08 +0900 Subject: [PATCH] Add All apps/Media Hub/Add pin icons in App list Add Dimmed image for app list icons Change-Id: I07d5a2f4007ffc564644b2d246cf45ac4fd282dc Signed-off-by: Hyerim Kim --- .../Models/AppShortcutController.cs | 63 +++++++++++++++- .../Models/SettingShortcutFactory.cs | 18 +++++ TVHome/TVHome.TizenTV/TVHome.TizenTV.csproj | 1 + TVHome/TVHome/Controls/SubPanelButton.xaml | 34 +++++---- .../Controls/SubPanelReservedButton.xaml | 51 +++++++++++++ .../Controls/SubPanelReservedButton.xaml.cs | 71 +++++++++++++++++++ TVHome/TVHome/TVHome.csproj | 11 ++- TVHome/TVHome/Views/MainPage.xaml | 5 -- TVHome/TVHome/Views/SubPanel.xaml.cs | 27 ++++++- 9 files changed, 258 insertions(+), 23 deletions(-) mode change 100644 => 100755 LibTVRefCommonPortable/Models/AppShortcutController.cs mode change 100644 => 100755 LibTVRefCommonPortable/Models/SettingShortcutFactory.cs mode change 100644 => 100755 TVHome/TVHome.TizenTV/TVHome.TizenTV.csproj mode change 100644 => 100755 TVHome/TVHome/Controls/SubPanelButton.xaml create mode 100755 TVHome/TVHome/Controls/SubPanelReservedButton.xaml create mode 100755 TVHome/TVHome/Controls/SubPanelReservedButton.xaml.cs mode change 100644 => 100755 TVHome/TVHome/TVHome.csproj mode change 100644 => 100755 TVHome/TVHome/Views/SubPanel.xaml.cs diff --git a/LibTVRefCommonPortable/Models/AppShortcutController.cs b/LibTVRefCommonPortable/Models/AppShortcutController.cs old mode 100644 new mode 100755 index b48eae1..81dcc3b --- a/LibTVRefCommonPortable/Models/AppShortcutController.cs +++ b/LibTVRefCommonPortable/Models/AppShortcutController.cs @@ -26,6 +26,7 @@ namespace LibTVRefCommmonPortable.Models { public class AppShortcutController { + private List returnPinnedAppsInfo = new List(); public AppShortcutController() { @@ -60,12 +61,69 @@ namespace LibTVRefCommmonPortable.Models return appShortcutInfoList; } + private void AddAllAppsAndMediaHubShortcut() + { + var allAppsStateDescription = new StateDescription() + { + Label = "All apps", + IconPath = "ic_tizen_home_list_allapps_normal.png", + Action = new AppControlAction + { + AppID = "org.tizen.example.TVApps.TizenTV", + } + }; + + var allAppsShortcutInfo = new AppShortcutInfo(); + + allAppsShortcutInfo.StateDescriptions.Add("default", allAppsStateDescription); + allAppsShortcutInfo.CurrentStateDescription = allAppsStateDescription; + + returnPinnedAppsInfo.Add(allAppsShortcutInfo); + + var mediaHubStateDescription = new StateDescription() + { + Label = "Media Hub", + IconPath = "ic_tizen_home_list_mediahub_normal.png", + Action = new AppControlAction + { + AppID = "org.tizen.mediahub", + } + }; + + var mediaHubShortcutInfo = new AppShortcutInfo(); + mediaHubShortcutInfo.StateDescriptions.Add("default", mediaHubStateDescription); + mediaHubShortcutInfo.CurrentStateDescription = mediaHubStateDescription; + + returnPinnedAppsInfo.Add(mediaHubShortcutInfo); + } + + private void AppendAddPinShortcut() + { + var addPinStateDescription = new StateDescription() + { + Label = "Add pin", + IconPath = "ic_tizen_home_list_addpin_normal.png", + Action = new AppControlAction + { + AppID = "org.tizen.example.TVApps.TizenTV", + } + }; + + var addPinShortcutInfo = new AppShortcutInfo(); + + addPinShortcutInfo.StateDescriptions.Add("default", addPinStateDescription); + addPinShortcutInfo.CurrentStateDescription = addPinStateDescription; + + returnPinnedAppsInfo.Add(addPinShortcutInfo); + } public IEnumerable GetPinnedApps() { IApplicationManagerAPIs applicationManagerPort = DependencyService.Get(); IEnumerable pinned_apps_info = AppShortcutStorage.Read(); string[] icons = { "ic_black.png", "ic_blue.png", "ic_green.png", "ic_red.png", "ic_yellow.png", "AppIcon.png" }; + AddAllAppsAndMediaHubShortcut(); + foreach (AppShortcutInfo appShortcutInfo in pinned_apps_info) { Dictionary appInfo = applicationManagerPort.GetInstalledApplication(appShortcutInfo.AppID); @@ -92,6 +150,7 @@ namespace LibTVRefCommmonPortable.Models appShortcutInfo.StateDescriptions.Add("default", defaultStateDescription); appShortcutInfo.CurrentStateDescription = defaultStateDescription; + returnPinnedAppsInfo.Add(appShortcutInfo); } else { @@ -99,7 +158,9 @@ namespace LibTVRefCommmonPortable.Models } } - return pinned_apps_info; + AppendAddPinShortcut(); + + return returnPinnedAppsInfo; } public void UpdatePinnedApps(IEnumerable pinnedAppsInfo) diff --git a/LibTVRefCommonPortable/Models/SettingShortcutFactory.cs b/LibTVRefCommonPortable/Models/SettingShortcutFactory.cs old mode 100644 new mode 100755 index 40cd561..6a45ec8 --- a/LibTVRefCommonPortable/Models/SettingShortcutFactory.cs +++ b/LibTVRefCommonPortable/Models/SettingShortcutFactory.cs @@ -36,6 +36,15 @@ namespace LibTVRefCommmonPortable.Models { StateDescriptions = { + { + "default", + new StateDescription + { + Label = "WiFi ON", + IconPath = "AppIcon.png", + Action = new WiFiOffAction(), + } + }, { "on", new StateDescription @@ -73,6 +82,15 @@ namespace LibTVRefCommmonPortable.Models { StateDescriptions = { + { + "default", + new StateDescription + { + Label = "BT ON", + IconPath = "AppIcon.png", + Action = new BTOffAction(), + } + }, { "on", new StateDescription diff --git a/TVHome/TVHome.TizenTV/TVHome.TizenTV.csproj b/TVHome/TVHome.TizenTV/TVHome.TizenTV.csproj old mode 100644 new mode 100755 index af0c5df..1f2d02e --- a/TVHome/TVHome.TizenTV/TVHome.TizenTV.csproj +++ b/TVHome/TVHome.TizenTV/TVHome.TizenTV.csproj @@ -52,6 +52,7 @@ + diff --git a/TVHome/TVHome/Controls/SubPanelButton.xaml b/TVHome/TVHome/Controls/SubPanelButton.xaml old mode 100644 new mode 100755 index d238c9d..27c56e7 --- a/TVHome/TVHome/Controls/SubPanelButton.xaml +++ b/TVHome/TVHome/Controls/SubPanelButton.xaml @@ -6,28 +6,36 @@ - +