+++ /dev/null
-/*
- * 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
-{
- /// <summary>
- /// A Bluetooth Shortcut
- /// </summary>
- class BTLaunchAction : IAction
- {
- /// <summary>
- /// A method execute a action.
- /// In this method Bluetooth settings app will be launched.
- /// </summary>
- /// <returns>A next statue of a Shortcut.</returns>
- public string Execute()
- {
- IBTAPIs ibtapis;
-
- ibtapis = DependencyService.Get<IBTAPIs>();
- ibtapis?.LaunchBTSetting();
-
- return "launch";
- }
- }
-}
+++ /dev/null
-/*
- * 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
-{
- /// <summary>
- /// A Bluetooth Off Action
- /// </summary>
- class BTOffAction : IAction
- {
- /// <summary>
- /// A method turns off Bluetooth.
- /// </summary>
- /// <returns>A next statue of a Shortcut.</returns>
- public string Execute()
- {
- // Turn BT Off
- return "off";
- }
- }
-}
+++ /dev/null
-/*
- * 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
-{
- /// <summary>
- /// A Bluetooth On Action
- /// </summary>
- class BTOnAction : IAction
- {
- /// <summary>
- /// A method turns on Bluetooth.
- /// </summary>
- /// <returns>A next statue of a Shortcut.</returns>
- public string Execute()
- {
- // Turn BT On
- return "on";
- }
- }
-}
+++ /dev/null
-/*
- * 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
-{
- /// <summary>
- /// BT Setting shortcut information
- /// <seealso cref="ShortcutInfo"/>
- /// </summary>
- public class BTSettingShortcutInfo : ShortcutInfo
- {
- /// <summary>
- /// Update State of a shortcut.
- /// </summary>
- public override void UpdateState()
- {
- // 1. Check Current BT Status.
-
- // 2. Set Description
- SetCurrentState("off");
- }
- }
-}
public class RecentShortcutInfo : ShortcutInfo
{
/// <summary>
+ /// A application ID
+ /// </summary>
+ public string AppID { get; set; }
+ /// <summary>
/// A Last used Time
/// </summary>
public DateTime Date { get; set; }
-/*
+/*
* Copyright (c) 2017 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.1 (the "License");
* limitations under the License.
*/
+using System;
namespace LibTVRefCommonPortable.DataModels
{
- /// <summary>
- /// A WiFi On Action
- /// </summary>
- class WiFiOnAction : IAction
+ public class SettingShortcutInfo : ShortcutInfo
{
- /// <summary>
- /// A method turns off the WiFi. </summary>
- /// <returns>A next statue of a Shortcut.</returns>
- public string Execute()
+ public override void UpdateState()
{
- // Turn WiFi On
- return "on";
+ SetCurrentState("default");
}
}
}
+++ /dev/null
-/*
- * 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
-{
- /// <summary>
- /// A Action to shows a WiFi settings
- /// </summary>
- class WiFiLaunchAction : IAction
- {
- /// <summary>
- /// A method execute a action.
- /// This method will launch the WiFi settings app.
- /// </summary>
- /// <returns>A next statue of a Shortcut.</returns>
- public string Execute()
- {
- // Launch WiFi Setting
- IWifiAPIs iwifiapis;
-
- iwifiapis = DependencyService.Get<IWifiAPIs>();
- iwifiapis?.LaunchWifiSetting();
-
- return "launch";
- }
- }
-}
+++ /dev/null
-/*
- * 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
-{
- /// <summary>
- /// A WiFi Off Action
- /// </summary>
- class WiFiOffAction : IAction
- {
- /// <summary>
- /// A method turns off the WiFi. </summary>
- /// <returns>A next statue of a Shortcut.</returns>
- public string Execute()
- {
- // Turn WiFi Off
- return "off";
- }
- }
-}
+++ /dev/null
-/*
- * 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
-{
- /// <summary>
- /// A class represents the WiFi setting Shortcut.
- /// </summary>
- public class WiFiSettingShortcutInfo : ShortcutInfo
- {
- /// <summary>
- /// A method initializes the status of a Shortcut.
- /// </summary>
- public override void UpdateState()
- {
- // 1. Check Current WiFi Status.
-
- // 2. Set Description
- SetCurrentState("off");
- }
- }
-}
<ItemGroup>
<Compile Include="DataModels\AppControlAction.cs" />
<Compile Include="DataModels\AppShortcutInfo.cs" />
- <Compile Include="DataModels\BTLaunchAction.cs" />
- <Compile Include="DataModels\BTOffAction.cs" />
- <Compile Include="DataModels\BTOnAction.cs" />
- <Compile Include="DataModels\BTSettingShortcutInfo.cs" />
<Compile Include="DataModels\CommandAction.cs" />
<Compile Include="DataModels\FileSystemEventCustomArgs.cs" />
<Compile Include="DataModels\HomeMenuAppShortcutInfo.cs" />
<Compile Include="DataModels\IAction.cs" />
<Compile Include="DataModels\MediaControlAction.cs" />
<Compile Include="DataModels\RecentShortcutInfo.cs" />
+ <Compile Include="DataModels\SettingShortcutInfo.cs" />
<Compile Include="DataModels\ShortcutInfo.cs" />
<Compile Include="DataModels\StateDescription.cs" />
<Compile Include="DataModels\WatcherType.cs" />
- <Compile Include="DataModels\WiFiLaunchAction.cs" />
- <Compile Include="DataModels\WiFiOffAction.cs" />
- <Compile Include="DataModels\WiFiOnAction.cs" />
- <Compile Include="DataModels\WiFiSettingShortcutInfo.cs" />
<Compile Include="Models\AppShortcutController.cs" />
<Compile Include="Models\RecentShortcutController.cs" />
- <Compile Include="Models\SettingShortcutController.cs" />
- <Compile Include="Models\SettingShortcutFactory.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utils\AppControlUtils.cs" />
<Compile Include="Utils\AppShortcutStorage.cs" />
<Compile Include="Utils\IAppLifeControl.cs" />
<Compile Include="Utils\IWindowAPIs.cs" />
<Compile Include="Utils\IPlatformNotification.cs" />
- <Compile Include="Utils\IBTAPIs.cs" />
<Compile Include="Utils\IDebuggingAPIs.cs" />
<Compile Include="Utils\IFileSystemAPIs.cs" />
<Compile Include="Utils\IFileSystemWatcherAPIs.cs" />
<Compile Include="Utils\IPackageManager.cs" />
<Compile Include="Utils\ITVHome.cs" />
- <Compile Include="Utils\IWifiAPIs.cs" />
<Compile Include="Utils\PackageManagerUtils.cs" />
<Compile Include="Utils\RecentShortcutStorage.cs" />
<Compile Include="Utils\TVHomeImpl.cs" />
</ItemGroup>
<ItemGroup>
+ <Reference Include="Tizen.Xamarin.Forms.Extension, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\packages\Tizen.Xamarin.Forms.Extension.2.3.4-r214-001\lib\portable-win+net45+wp80+win81+wpa81\Tizen.Xamarin.Forms.Extension.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.2.3.4.214-pre5\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Core.dll</HintPath>
<Private>True</Private>
/// <summary>
/// A method removes a Recent Shortcut.
/// </summary>
- /// <param name="history">a Recent Shortcut to be removed.</param>
- public void Remove(RecentShortcutInfo history)
+ /// <param name="appId">a Recent Shortcut's appId to be removed.</param>
+ public void Remove(string appId)
{
- RecentShortcutStorage.Delete(history);
+ //RecentShortcutStorage.Delete(history);
+ RecentShortcutStorage.Delete(appId);
}
/// <summary>
recentShortcutInfo.ScreenshotPath = "screenshot.png";
recentShortcutInfo.StateDescriptions.Add("default", defaultStateDescription);
recentShortcutInfo.CurrentStateDescription = defaultStateDescription;
+ recentShortcutInfo.AppID = item.appID;
recentShortcutInfoList.Add(recentShortcutInfo);
}
+++ /dev/null
-/*
- * 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
-{
- /// <summary>
- /// A class provides Settings Shortcut information.
- /// </summary>
- public class SettingShortcutController
- {
- /// <summary>
- /// A Setting Shortcut list.
- /// </summary>
- private List<ShortcutInfo> settingShortcutList = new List<ShortcutInfo>();
-
- /// <summary>
- /// A Constructor
- /// Set dedicated Settings to be displayed in the TVHome.
- /// </summary>
- 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
- }
-
- /// <summary>
- /// A method provides Setting Shortcut list.
- /// </summary>
- /// <returns>A Setting Shortcut list.</returns>
- public IEnumerable<ShortcutInfo> GetList()
- {
- return new List<ShortcutInfo>(settingShortcutList);
- }
-
- }
-}
+++ /dev/null
-/*
- * 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
-{
- /// <summary>
- /// A enumeration for Setting Shortcut making.
- /// </summary>
- public enum SettingID
- {
- SETTINGS,
- WiFi,
- BLUETOOTH
- };
-
- /// <summary>
- /// A factory class to provide Setting Shortcuts.
- /// </summary>
- public static class SettingShortcutFactory
- {
- /// <summary>
- /// A method provides Setting Shortcuts.
- /// </summary>
- /// <param name="id">A Setting ID</param>
- /// <returns>A Setting Shortcut.</returns>
- 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;
- }
- }
-}
/// <param name="applicationId">A application ID</param>
/// <returns>A installed application information</returns>
Dictionary<string, string> GetInstalledApplication(string applicationId);
+
+ /// <summary>
+ /// A method for removing all recent applications
+ /// </summary>
+ void DeleteAllRecentApplication();
+
+ /// <summary>
+ /// A method for removing the specified recent application
+ /// </summary>
+ void DeleteRecentApplication(string appId);
}
}
+++ /dev/null
-/*
- * 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
-{
- /// <summary>
- /// A Bluetooth interface.
- /// </summary>
- public interface IBTAPIs
- {
- /// <summary>
- /// A method turns on the Bluetooth
- /// </summary>
- void BTOn();
-
- /// <summary>
- /// A method turns off the Bluetooth
- /// </summary>
- void BTOff();
-
- /// <summary>
- /// A method launches BT settings app.
- /// </summary>
- void LaunchBTSetting();
- }
-}
{
get;
}
-
- /// <summary>
- /// A instance of the SettingShortcutController
- /// </summary>
- /// <see cref="SettingShortcutController"/>
- SettingShortcutController SettingShortcutControllerInstance
- {
- get;
- }
}
}
+++ /dev/null
-/*
- * 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
-{
- /// <summary>
- /// A class for the WiFi function control
- /// </summary>
- public interface IWifiAPIs
- {
- /// <summary>
- /// A method turns on the WiFi.
- /// </summary>
- void WifiOn();
-
- /// <summary>
- /// A method turns off the WiFi.
- /// </summary>
- void WifiOff();
-
- /// <summary>
- /// A method launches the WiFi Settings app.
- /// </summary>
- void LaunchWifiSetting();
- }
-}
using System.Collections.Generic;
using LibTVRefCommonPortable.DataModels;
+using Xamarin.Forms;
namespace LibTVRefCommonPortable.Utils
{
/// A method deletes a Recent Shortcut.
/// </summary>
/// <param name="shortcut">A recent Shortcut</param>
- public static void Delete(ShortcutInfo shortcut)
+ public static void Delete(string appId)
{
+ IApplicationManagerAPIs applicationManagerPort = DependencyService.Get<IApplicationManagerAPIs>();
+ applicationManagerPort.DeleteRecentApplication(appId);
}
/// <summary>
/// </summary>
public static void DeleteAll()
{
+ IApplicationManagerAPIs applicationManagerPort = DependencyService.Get<IApplicationManagerAPIs>();
+ applicationManagerPort.DeleteAllRecentApplication();
}
}
}
return recentShortcutController;
}
}
-
- /// <summary>
- /// A instance of the SettingShortcutController
- /// </summary>
- private static readonly SettingShortcutController settingShortcutController = new SettingShortcutController();
- public SettingShortcutController SettingShortcutControllerInstance
- {
- get
- {
- return settingShortcutController;
- }
- }
}
}
<ItemGroup>
<Compile Include="Ports\AppControlPort.cs" />
<Compile Include="Ports\ApplicationManagerPort.cs" />
- <Compile Include="Ports\BTModulePort.cs" />
<Compile Include="Ports\DbgPort.cs" />
<Compile Include="Ports\WindowPort.cs" />
<Compile Include="Ports\FileSystemPort.cs" />
<Compile Include="Ports\FileSystemWatcherPort.cs" />
<Compile Include="Ports\PackageManagerPort.cs" />
- <Compile Include="Ports\WifiModulePort.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
}
/// <summary>
+ /// Clear all recent applications
+ /// </summary>
+ public void DeleteAllRecentApplication()
+ {
+ RecentApplicationControl.DeleteAll();
+ }
+
+ /// <summary>
+ /// Removes the specified application with the app ID
+ /// </summary>
+ /// <param name="appId">A application ID that is removed</param>
+ public void DeleteRecentApplication(string appId)
+ {
+ IEnumerable<RecentApplicationInfo> recentApps = ApplicationManager.GetRecentApplications();
+ string pkgId = PackageManager.GetPackageIdByApplicationId(appId);
+
+ foreach (var item in recentApps)
+ {
+ if (item.PackageId.Equals(pkgId))
+ {
+ RecentApplicationControl controller = item.Controller;
+ controller.Delete();
+ }
+ }
+ }
+
+ /// <summary>
/// Gets the information of the recent applications
/// </summary>
/// <returns>The list of the recent applications</returns>
+++ /dev/null
-/*
- * 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
+++ /dev/null
-/*
- * 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
Xamarin.Forms.DependencyService.Register<Program>();
Xamarin.Forms.DependencyService.Register<AppControlPort>();
Xamarin.Forms.DependencyService.Register<PackageManagerPort>();
- Xamarin.Forms.DependencyService.Register<WifiModulePort>();
- Xamarin.Forms.DependencyService.Register<BTModulePort>();
Xamarin.Forms.DependencyService.Register<FileSystemWatcherPort>();
Xamarin.Forms.DependencyService.Register<ApplicationManagerPort>();
Xamarin.Forms.DependencyService.Register<FileSystemPort>();
global::Xamarin.Forms.DependencyService.Register<DbgPort>();
global::Xamarin.Forms.DependencyService.Register<AppControlPort>();
global::Xamarin.Forms.DependencyService.Register<PackageManagerPort>();
- global::Xamarin.Forms.DependencyService.Register<WifiModulePort>();
- global::Xamarin.Forms.DependencyService.Register<BTModulePort>();
global::Xamarin.Forms.DependencyService.Register<FileSystemWatcherPort>();
global::Xamarin.Forms.DependencyService.Register<ApplicationManagerPort>();
global::Xamarin.Forms.DependencyService.Register<FileSystemPort>();
public ICommand OnUnpinCommand { get; set; }
/// <summary>
+ /// A Command will be executed the recent is removed.
+ /// </summary>
+ public ICommand OnClearCommand { get; set; }
+
+ /// <summary>
+ /// A Command will be executed the all recent are cleared.
+ /// </summary>
+ public ICommand OnClearAllCommand { get; set; }
+
+ /// <summary>
/// Handles Button Focused event
/// </summary>
/// <param name="sender">The source of the event</param>
WidthRequest="320"
HeightRequest="180"
Opacity="0"/>
+ <Image x:Name="ThumnailDimLayer"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=1}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=1}"
+ Opacity="0.99"
+ Source="img_tizen_home_list_dim_recent.png"/>
<Image x:Name="ThumbnailImage"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=1}"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=1}"
Text="{Binding CurrentStateDescription.Label}"
TextColor="#FFFFFF"
FontSize="70"/>
- <Image x:Name="ThumnailDimLayer"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=1}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=1}"
- Opacity="0.99"
- Source="img_tizen_home_list_dim_recent.png"/>
<Button x:Name="ButtonFocusArea"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=1}"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=1}"
/// </summary>
public partial class SubPanelThumbnailButton : PanelButton
{
+ private bool isPopupShowing = false;
/// <summary>
/// Constructor
/// </summary>
public SubPanelThumbnailButton()
{
InitializeComponent();
+ //InitializeLongTapGesture();
}
+ /*
+ private void InitializeLongTapGesture()
+ {
+ var longTapGesture = new LongTapGestureRecognizer
+ {
+ Timeout = 0.5
+ };
+
+ var tapGesture = new TapGestureRecognizer
+ {
+ NumberOfTapsRequired = 1
+ };
+
+ tapGesture.Tapped += (sender, args) =>
+ {
+ if (!isMoveMode)
+ {
+ if (OnClickedCommand != null)
+ {
+ OnClickedCommand.Execute("");
+ }
+
+ View.FadeTo(0.99, 300);
+ }
+ else
+ {
+ OnMoveFinishedCommand.Execute("");
+ }
+ };
+
+ longTapGesture.TapCompleted += (sender, args) =>
+ {
+ ShowContextPopup();
+ //OnMoveFinishedCommand.Execute("");
+ };
+
+ View.GestureRecognizers.Add(longTapGesture);
+ //View.GestureRecognizers.Add(tapGesture);
+ }
+ */
+
private void AnimationInitialize(object sender, EventArgs e)
{
/// <param name="e">The event that is occurred when button is focused</param>
public override async void OnFocused(object sender, FocusEventArgs e)
{
+ isFocused = true;
+
if (OnFocusedCommand != null)
{
OnFocusedCommand.Execute("");
/// <param name="e">The event that is occurred when button is unfocused</param>
public override async void OnUnfocused(object sender, FocusEventArgs e)
{
+ isFocused = false;
// Height, Width 확장 Animiation
//var Animation = new Animation();
//var viewHeightAnimation = new Animation(v => View.HeightRequest = v, 216, 180);
/// </summary>
public override void ShowContextPopup()
{
+ if (isPopupShowing)
+ {
+ return;
+ }
+
ContextPopup popup = new ContextPopup
{
IsAutoHidingEnabled = true,
var ctxPopup = sender as ContextPopup;
if (ctxPopup.SelectedIndex == 0)
{
- OnMoveFinishedCommand.Execute("");
+ OnClearCommand.Execute("");
ctxPopup.Dismiss();
}
else if (ctxPopup.SelectedIndex == 1)
{
- OnUnpinCommand.Execute("");
+ OnClearAllCommand.Execute("");
ctxPopup.Dismiss();
}
};
+ popup.Dismissed += (sender, args) =>
+ {
+ isPopupShowing = false;
+ };
+
popup.Show(View);
+ isPopupShowing = true;
}
}
}
\ No newline at end of file
public Command OnMoveCommand { get; set; }
public Command OnUnpinCommand { get; set; }
+ public Command OnClearCommand { get; set; }
+ public Command OnClearAllCommand { get; set; }
/// <summary>
/// Gets or set CurrentStatus of HomeStatus
{
UnpinAppShortcutInfo(appId);
});
+
+ OnClearCommand = new Command<string>((appId) =>
+ {
+ RemoveRecentApplication(appId);
+ });
+
+ OnClearAllCommand = new Command(() =>
+ {
+ ClearAllRecentApplications();
+ });
}
/// <summary>
/// </summary>
private void MakeSettingsButtons()
{
- SettingsList = TVHomeImpl.GetInstance.SettingShortcutControllerInstance.GetList();
+ string[] ShortCutLabel = { "Settings", "Brightness", "Contrast", "Color", "Tint" };
+
+ List<ShortcutInfo> TempList = new List<ShortcutInfo>();
+ for (int i = 0; i < ShortCutLabel.Length; i++)
+ {
+ ShortcutInfo shortcutInfo = new SettingShortcutInfo()
+ {
+ StateDescriptions =
+ {
+ {
+ "default",
+ new StateDescription
+ {
+ Label = ShortCutLabel[i],
+ IconPath = "ic_tizen_home_menu_settings_normal.png",
+ Action = new AppControlAction()
+ {
+ AppID = "org.tizen.settings"
+ }
+ }
+ },
+ },
+ };
+ shortcutInfo.UpdateState();
+ TempList.Add(shortcutInfo);
+ }
+
+ SettingsList = TempList;
OnPropertyChanged("SettingsList");
}
}
/// <summary>
+ /// Clears all recent applications and updates the list to Recent SubPanel
+ /// </summary>
+ private void ClearAllRecentApplications()
+ {
+ TVHomeImpl.GetInstance.RecentShortcutControllerInstance.RemoveAll();
+ MakeRecentButtons();
+ }
+
+ /// <summary>
+ /// Removes specified recent application and updates the list to Recent SubPanel
+ /// </summary>
+ private void RemoveRecentApplication(string appId)
+ {
+ TVHomeImpl.GetInstance.RecentShortcutControllerInstance.Remove(appId);
+ MakeRecentButtons();
+ }
+
+ /// <summary>
/// A method for invoking PropertyChanged event
/// </summary>
/// <param name="name">The name of property</param>
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.89}"
OnFocusedCommand="{Binding SubPanelFocusedCommand}"
+ OnClearVMCommand="{Binding OnClearCommand}"
+ OnClearAllVMCommand="{Binding OnClearAllCommand}"
ItemsSource="{Binding RecentList}"
ShowNoContentsInfo="{Binding IsShowNoRecentContents}">
</Views:SubThumbnailPanel>
set { SetValue(OnMoveVMCommandProperty, value); }
}
+ public static readonly BindableProperty OnClearVMCommandProperty = BindableProperty.Create("OnClearVMCommand", typeof(ICommand), typeof(SubThumbnailPanel));
+
+ public ICommand OnClearVMCommand
+ {
+ get { return (ICommand)GetValue(OnClearVMCommandProperty); }
+ set { SetValue(OnClearVMCommandProperty, value); }
+ }
+
+ public static readonly BindableProperty OnClearAllVMCommandProperty = BindableProperty.Create("OnClearAllVMCommand", typeof(ICommand), typeof(SubThumbnailPanel));
+
+ public ICommand OnClearAllVMCommand
+ {
+ get { return (ICommand)GetValue(OnClearAllVMCommandProperty); }
+ set { SetValue(OnClearAllVMCommandProperty, value); }
+ }
+
/// <summary>
/// Identifies the ItemsSource bindable property
/// </summary>
using LibTVRefCommonPortable.DataModels;
using Xamarin.Forms;
using System.Threading.Tasks;
+using Tizen.Xamarin.Forms.Extension;
+using LibTVRefCommonPortable.Utils;
+using System.Collections.Generic;
namespace TVHome.Views
{
/// </summary>
public partial class SubThumbnailPanel : Panel
{
+ private List<PanelButton> ButtonList;
/// <summary>
/// Identifies the ShowNoContentsInfo bindable property
/// </summary>
InitializeComponent();
isFocused = false;
PropertyChanged += OnItemsSourcePropertyChanged;
+
+ ButtonList = new List<PanelButton>();
+
+ MessagingCenter.Subscribe<App>(this, "MenuKeyPressed", (sender) =>
+ {
+ if (isFocused)
+ {
+ foreach (var item in ButtonList)
+ {
+ if (item.isFocused)
+ {
+ item.ShowContextPopup();
+ }
+ }
+ }
+ });
}
/// <summary>
}
PanelButtonStack.Children.Clear();
- foreach (ShortcutInfo item in ItemsSource)
+ ButtonList.Clear();
+ foreach (RecentShortcutInfo item in ItemsSource)
{
PanelButton button = new SubPanelThumbnailButton();
button.View.BindingContext = item;
{
item.DoAction();
});
+ button.OnClearCommand = new Command(() =>
+ {
+ OnClearVMCommand.Execute(item.AppID);
+ });
+ button.OnClearAllCommand = new Command(() =>
+ {
+ OnClearAllVMCommand.Execute("");
+ });
PanelButtonStack.Children.Add(button.View);
+ ButtonList.Add(button);
}
- HidePanel();
+ if (!isFocused)
+ {
+ HidePanel();
+ }
+ else
+ {
+ isFocused = false;
+ FocusPanel();
+ }
}
/// <summary>