{
watcher = new FileSystemWatcher();
watcher.Path = "/opt/usr/home/owner/share/";
- watcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.Size;
- watcher.Filter = "apinnedapp.xml";
+ watcher.NotifyFilter = NotifyFilters.LastWrite;
+ watcher.Filter = "pinned_apps_info.xml";
watcher.Created += new FileSystemEventHandler(WatcherChanged);
watcher.Changed += new FileSystemEventHandler(WatcherChanged);
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:Controls="clr-namespace:TVHome.Controls"
x:Class="TVHome.Controls.SubPanelAllAppsButton">
- <RelativeLayout>
- <BoxView x:Name = "ButtonBox"
+ <RelativeLayout x:Name="ButtonBox"
HeightRequest="186"
WidthRequest="138"
- Opacity="0"/>
+ HorizontalOptions="Center">
<Image x:Name="ButtonBgImage"
RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0}"
}
#pragma warning disable CS4014
- ButtonTitle.FadeTo(0.8, 300);
+ ButtonTitle.FadeTo(0.99, 300);
ButtonTitle.TranslateTo(0, 22, 300);
ButtonImage.ScaleTo(1.3, 300);
#pragma warning restore CS4014
public override async void OnUnfocused(object sender, FocusEventArgs e)
{
- DebuggingUtils.Dbg(View.Width.ToString() + ", " + View.Height.ToString());
#pragma warning disable CS4014
- ButtonTitle.FadeTo(0.6, 300);
+ ButtonTitle.FadeTo(0.5, 300);
ButtonTitle.TranslateTo(0, 0, 300);
ButtonImage.ScaleTo(1.0, 300);
#pragma warning restore CS4014
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"\r
xmlns:Controls="clr-namespace:TVHome.Controls"\r
x:Class="TVHome.Controls.SubPanelButton">\r
- <RelativeLayout>\r
- <BoxView x:Name = "ButtonBox"\r
- HeightRequest="186"\r
+ <RelativeLayout x:Name="ButtonBox"\r
WidthRequest="138"\r
- Opacity="0"/>\r
+ HeightRequest="186"\r
+ HorizontalOptions="Center">\r
<Image x:Name="ButtonImage"\r
RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0}"\r
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0}"\r
}\r
\r
#pragma warning disable CS4014\r
- ButtonTitle.FadeTo(0.8, 300);\r
+ ButtonTitle.FadeTo(0.99, 300);\r
ButtonTitle.TranslateTo(0, 22, 300);\r
#pragma warning restore CS4014\r
await ButtonImage.ScaleTo(1.3, 300);\r
public override async void OnUnfocused(object sender, FocusEventArgs e)\r
{\r
#pragma warning disable CS4014\r
- ButtonTitle.FadeTo(0.6, 300);\r
+ ButtonTitle.FadeTo(0.5, 300);\r
ButtonTitle.TranslateTo(0, 0, 300);\r
#pragma warning restore CS4014\r
await ButtonImage.ScaleTo(1, 300);\r
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:Controls="clr-namespace:TVHome.Controls"
x:Class="TVHome.Controls.SubPanelReservedButton">
- <RelativeLayout>
- <BoxView x:Name = "ButtonBox"
+ <RelativeLayout x:Name = "ButtonBox"
HeightRequest="186"
WidthRequest="138"
- Opacity="0"/>
+ HorizontalOptions="Center">
<Image x:Name="ButtonBgImage"
RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0}"
}
#pragma warning disable CS4014
- ButtonTitle.FadeTo(0.8, 300);
+ ButtonTitle.FadeTo(0.99, 300);
ButtonTitle.TranslateTo(0, 22, 300);
ButtonImage.ScaleTo(1.3, 300);
#pragma warning restore CS4014
public override async void OnUnfocused(object sender, FocusEventArgs e)
{
#pragma warning disable CS4014
- ButtonTitle.FadeTo(0.8, 300);
+ ButtonTitle.FadeTo(0.5, 300);
ButtonTitle.TranslateTo(0, 0, 300);
ButtonImage.ScaleTo(1, 300);
#pragma warning restore CS4014
PageMainPanel.SelectPanel();\r
});\r
\r
+ AppsSubPanel.OnUnpinCommand = new Command<string>((appId) =>\r
+ {\r
+ UnpinAppShortcutInfo(appId);\r
+ });\r
+\r
SettingsSubPanel.OnFocusedCommand = new Command(() =>\r
{\r
PageMainPanel.SelectPanel();\r
{\r
PageMainPanel.InitialFocusing();\r
}\r
+\r
+ private void UnpinAppShortcutInfo(string appId)\r
+ {\r
+ RemovePinnedApp(appId);\r
+ }\r
+\r
+ private void UpdatePinnedApps(Dictionary<string, string> PinnedApps)\r
+ {\r
+ List<AppShortcutInfo> pinnedAppList = new List<AppShortcutInfo>();\r
+ foreach (var item in PinnedApps)\r
+ {\r
+ pinnedAppList.Add(new AppShortcutInfo()\r
+ {\r
+ AppID = item.Key,\r
+ });\r
+ }\r
+\r
+ TVHomeImpl.GetInstance.AppShortcutControllerInstance.UpdatePinnedApps(pinnedAppList);\r
+ }\r
+\r
+ public void RemovePinnedApp(string AppID)\r
+ {\r
+ Dictionary<string, string> PinnedApps = TVHomeImpl.GetInstance.AppShortcutControllerInstance.GetPinnedAppsAppIDs();\r
+ if (PinnedApps.ContainsKey(AppID))\r
+ {\r
+ PinnedApps.Remove(AppID);\r
+ UpdatePinnedApps(PinnedApps);\r
+ }\r
+ }\r
}\r
}
\ No newline at end of file
set { SetValue(OnFocusedCommandProperty, value); }
}
+ public static readonly BindableProperty OnUnpinCommandProperty = BindableProperty.Create("OnUnpinCommand", typeof(ICommand), typeof(SubPanel));
+
+ public ICommand OnUnpinCommand
+ {
+ get { return (ICommand)GetValue(OnUnpinCommandProperty); }
+ set { SetValue(OnUnpinCommandProperty, value); }
+ }
public static readonly BindableProperty ItemsSourceProperty = BindableProperty.Create("ItemsSource", typeof(IEnumerable<ShortcutInfo>), typeof(MainPanel));
public IEnumerable<ShortcutInfo> ItemsSource
});\r
button.OnClickedCommand = new Command(() =>\r
{\r
- item.DoAction();\r
+ if (item is AppShortcutInfo)\r
+ {\r
+ OnUnpinCommand.Execute((item as AppShortcutInfo).AppID);\r
+ }\r
+ else\r
+ {\r
+ item.DoAction();\r
+ }\r
});\r
PanelButtonStack.Children.Add(button.View);\r
}\r
\r
- HidePanel();\r
+ if (!isFocused)\r
+ {\r
+ HidePanel();\r
+ }\r
+ else\r
+ {\r
+ isFocused = false;\r
+ FocusPanel();\r
+ }\r
+\r
}\r
\r
public override async void HidePanel()\r