{
public class RecentShortcutInfo : ShortcutInfo
{
- public DateTime Date
- {
- get;
- set;
- }
+ public DateTime Date { get; set; }
+
+ public string ScreenshotPath { get; set; }
public override void UpdateState()
{
var defaultStateDescription = new StateDescription()
{
Label = appLabel,
- IconPath = appIconPath ?? icons[random.Next(0, 6)], //IconPath = (resul5t[2] == null) ? "AppIcon.png" : result[2],
+ IconPath = appIconPath ?? icons[random.Next(0, 6)],
Action = new AppControlAction
{
AppID = appShortcutInfo.AppID,
return false;
}
- public async Task<IEnumerable<RecentShortcutInfo>> GetList()
+ public IEnumerable<RecentShortcutInfo> GetList()\r
+ {\r
+ // TODO : This is a clone of AppShorcutController.ReadFromFile(). Write new code by using RUA\r
+ IEnumerable<AppShortcutInfo> pinned_apps_info = AppShortcutStorage.ReadFromFile("/opt/usr/home/owner/share/pinned_apps_info.xml");\r
+ IApplicationManagerAPIs applicationManagerPort = DependencyService.Get<IApplicationManagerAPIs>();\r
+ List<RecentShortcutInfo> recentShortcutInfoList = new List<RecentShortcutInfo>();\r
+ string[] icons = { "ic_black.png", "ic_blue.png", "ic_green.png", "ic_red.png", "ic_yellow.png", "AppIcon.png" };\r
+\r
+ foreach (AppShortcutInfo appShortcutInfo in pinned_apps_info)
+ {
+ Dictionary<string, string> appInfo = applicationManagerPort.GetInstalledApplication(appShortcutInfo.AppID);
+
+ if (appInfo != null)
+ {
+ string appLabel;
+ string appIconPath;
+
+ appInfo.TryGetValue("Label", out appLabel);
+ appInfo.TryGetValue("IconPath", out appIconPath);
+
+ Random random = new Random();
+ var defaultStateDescription = new StateDescription()
+ {
+ Label = appLabel,
+ IconPath = appIconPath ?? icons[random.Next(0, 6)],
+ Action = new AppControlAction
+ {
+ AppID = appShortcutInfo.AppID,
+ }
+ };
+ var newRecentShortcutInfo = new RecentShortcutInfo();\r
+ newRecentShortcutInfo.ScreenshotPath = "screenshot.png";\r
+ // newRecentShortcutInfo.ScreenshotPath = "screenshot_" + appShortcutInfo.AppID + ".png";
+ newRecentShortcutInfo.StateDescriptions.Add("default", defaultStateDescription);
+ newRecentShortcutInfo.CurrentStateDescription = defaultStateDescription;
+ recentShortcutInfoList.Add(newRecentShortcutInfo);
+ }
+ }\r
+\r
+ return recentShortcutInfoList;\r
+ }
+
+ public async Task<IEnumerable<RecentShortcutInfo>> GetListAsync()
{
IApplicationManagerAPIs applicationManagerPort = DependencyService.Get<IApplicationManagerAPIs>();
List<RecentShortcutInfo> recentShortcutInfoList = new List<RecentShortcutInfo>();
{
var defaultStateDescription = new StateDescription()
{
- // TODO : Label에는 ApplicationInfo의 Label을 넣자
Label = item.Value[0],
IconPath = item.Value[2],
Action = new AppControlAction()
}
};
var recentShortcutInfo = new RecentShortcutInfo();
+ recentShortcutInfo.ScreenshotPath = "screenshot_" + item.Value[0] + ".png";
recentShortcutInfo.StateDescriptions.Add("default", defaultStateDescription);
recentShortcutInfo.CurrentStateDescription = defaultStateDescription;
recentShortcutInfoList.Add(recentShortcutInfo);
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup Condition="'$(NuGetPackageRoot)' == ''">
- <NuGetPackageRoot>$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
- </PropertyGroup>
- <ImportGroup>
- <Import Project="$(NuGetPackageRoot)\Xamarin.Forms\2.3.3.193\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('$(NuGetPackageRoot)\Xamarin.Forms\2.3.3.193\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
- </ImportGroup>
+<?xml version="1.0" encoding="utf-8" standalone="no"?>\r
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <PropertyGroup Condition="'$(NuGetPackageRoot)' == ''">\r
+ <NuGetPackageRoot>$(UserProfile)\.nuget\packages\</NuGetPackageRoot>\r
+ </PropertyGroup>\r
+ <ImportGroup>\r
+ <Import Project="$(NuGetPackageRoot)\Xamarin.Forms\2.3.3.193\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('$(NuGetPackageRoot)\Xamarin.Forms\2.3.3.193\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />\r
+ </ImportGroup>\r
</Project>
\ No newline at end of file
<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}"
- Source="screenshot.png" />
+ Source="{Binding ScreenshotPath}" />
<Image x:Name="ThumbnailGradient"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=1}"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=1}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.689}"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.131}"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.233}"
- Source="AppIcon.png" />
+ Source="{Binding CurrentStateDescription.IconPath}" />
<Label x:Name="ThumbnailTitle"
RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.206}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.722}"
#pragma warning disable CS4014
ThumbnailTitle.FadeTo(0.8, 300);
+ View.ScaleTo(1.15, 300);
#pragma warning restore CS4014
await View.FadeTo(0.8, 300);
}
//Animation.Commit(ThumbnailTitle, "UnfocusedAnimation", 16, 300);
#pragma warning disable CS4014
- ThumbnailTitle.FadeTo(0.6, 300);
+ ThumbnailTitle.FadeTo(0.3, 300);
+ View.ScaleTo(1.0, 300);
#pragma warning restore CS4014
- await View.FadeTo(0.6, 300);
+ await View.FadeTo(0.3, 300);
}
}
}
\ No newline at end of file
OnPropertyChanged("AppList");
}
- private async void MakeRecentButtons()
+ private void MakeRecentButtons()
{
- RecentList = await TVHomeImpl.GetInstance.RecentShortcutControllerInstance.GetList();
+ RecentList = TVHomeImpl.GetInstance.RecentShortcutControllerInstance.GetList();
if (RecentList != null)
{
OnPropertyChanged("RecentList");