-using System.Collections.Generic;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 Tizen.NUI;
using Apps.Common;
using Apps.Views;
-using Tizen.NUI;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 Tizen.NUI;
using Tizen.System;
namespace Apps.Common
-using System.ComponentModel;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.ComponentModel;
using System.Runtime.CompilerServices;
namespace Apps.Common
-namespace Apps.Common
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 Apps.Common
{
class Resources
{
public static string GetThemePath()
{
return Tizen.Applications.Application.Current.DirectoryInfo.Resource + "themes/";
- }\r
-\r
+ }
+
public static string GetImagePath()
{
return Tizen.Applications.Application.Current.DirectoryInfo.Resource + "images/";
-using Tizen.Applications;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 Tizen.Applications;
namespace Apps.Core
{
-using System;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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;
using System.Collections.Generic;
using Tizen.NUI;
using Apps.Common;
namespace Apps.Models
{
class AppInfoModel : PropertyNotifier
- {\r
+ {
private ImageVisual defaultVisual;
private GradientVisual gradientVisual;
}
else
{
- Tizen.Log.Info(Resources.LogTag, "setting palette color");\r
- SetGradientVisual(stopColor);\r
+ Tizen.Log.Info(Resources.LogTag, "setting palette color");
+ SetGradientVisual(stopColor);
IconBackground = gradientVisual.OutputVisualMap;
}
}
- ~AppInfoModel()\r
- {\r
- Tizen.Log.Info(Resources.LogTag, "Clearing NUI PropertyMap resources");\r
- defaultVisual?.Dispose();\r
- defaultVisual = null;\r
- gradientVisual?.Dispose();\r
- gradientVisual = null;\r
- IconBackground?.Dispose();\r
- IconBackground = null;\r
+ ~AppInfoModel()
+ {
+ Tizen.Log.Info(Resources.LogTag, "Clearing NUI PropertyMap resources");
+ defaultVisual?.Dispose();
+ defaultVisual = null;
+ gradientVisual?.Dispose();
+ gradientVisual = null;
+ IconBackground?.Dispose();
+ IconBackground = null;
}
}
}
-using System;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
-using System.Collections.Generic;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 System.Collections.ObjectModel;
using System.Threading;
using Tizen.Applications;
}
public void CreateData(IEnumerable<ApplicationInfo> list)
- {\r
+ {
Clear();
- if (list == null)\r
- {\r
- return;\r
+ if (list == null)
+ {
+ return;
}
foreach (ApplicationInfo appInfo in list)
{
-using System.Collections;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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;
using System.Collections.Generic;
using System.Windows.Input;
using Tizen.Applications;
-using Tizen.NUI;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 Tizen.NUI;
using Tizen.NUI.Components;
using Tizen.NUI.BaseComponents;
using Apps.Common;
-using System.Windows.Input;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.Windows.Input;
using Tizen.NUI;
using Tizen.NUI.Components;
using Tizen.NUI.BaseComponents;
-using Tizen.NUI;\r
-using Tizen.NUI.BaseComponents;\r
-using Apps.Common;\r
-\r
-namespace Apps.Views\r
-{\r
- class CustomBorder : DefaultBorder\r
- {\r
- private ImageView maximalizeIcon;\r
- private ImageView closeIcon;\r
- private ImageView leftCornerIcon;\r
- private ImageView rightCornerIcon;\r
- private View borderView;\r
-\r
- public CustomBorder() : base()\r
- {\r
- }\r
-\r
- public override void CreateBorderView(View borderView)\r
- {\r
- this.borderView = borderView;\r
- borderView.CornerRadius = new Vector4(0.03f, 0.03f, 0.03f, 0.03f);\r
- borderView.CornerRadiusPolicy = VisualTransformPolicyType.Relative;\r
- borderView.BackgroundColor = new Color(1, 1, 1, 0.3f);\r
- }\r
-\r
- public override bool CreateBottomBorderView(View bottomView)\r
- {\r
- if (bottomView == null)\r
- {\r
- return false;\r
- }\r
- bottomView.Layout = new RelativeLayout();\r
- maximalizeIcon = new ImageView()\r
- {\r
- Focusable = true,\r
- ResourceUrl = Resources.GetImagePath() + "/maximalize.png",\r
- AccessibilityHighlightable = true,\r
- };\r
-\r
- closeIcon = new ImageView()\r
- {\r
- Focusable = true,\r
- ResourceUrl = Resources.GetImagePath() + "/close.png",\r
- AccessibilityHighlightable = true,\r
- };\r
-\r
- leftCornerIcon = new ImageView()\r
- {\r
- Focusable = true,\r
- ResourceUrl = Resources.GetImagePath() + "/leftCorner.png",\r
- AccessibilityHighlightable = true,\r
- };\r
-\r
- rightCornerIcon = new ImageView()\r
- {\r
- Focusable = true,\r
- ResourceUrl = Resources.GetImagePath() + "/rightCorner.png",\r
- AccessibilityHighlightable = true,\r
- };\r
-\r
- RelativeLayout.SetRightTarget(maximalizeIcon, closeIcon);\r
- RelativeLayout.SetRightRelativeOffset(maximalizeIcon, 0.0f);\r
- RelativeLayout.SetHorizontalAlignment(maximalizeIcon, RelativeLayout.Alignment.End);\r
-\r
- RelativeLayout.SetRightTarget(closeIcon, rightCornerIcon);\r
- RelativeLayout.SetRightRelativeOffset(closeIcon, 0.0f);\r
- RelativeLayout.SetHorizontalAlignment(closeIcon, RelativeLayout.Alignment.End);\r
-\r
- RelativeLayout.SetRightRelativeOffset(rightCornerIcon, 1.0f);\r
- RelativeLayout.SetHorizontalAlignment(rightCornerIcon, RelativeLayout.Alignment.End);\r
-\r
- bottomView.Add(leftCornerIcon);\r
- bottomView.Add(maximalizeIcon);\r
- bottomView.Add(closeIcon);\r
- bottomView.Add(rightCornerIcon);\r
-\r
- maximalizeIcon.TouchEvent += OnMaximizeIconTouched;\r
- closeIcon.TouchEvent += OnCloseIconTouched;\r
- leftCornerIcon.TouchEvent += OnLeftBottomCornerIconTouched;\r
- rightCornerIcon.TouchEvent += OnRightBottomCornerIconTouched;\r
-\r
- maximalizeIcon.AccessibilityActivated += (s, e) =>\r
- {\r
- MaximizeBorderWindow();\r
- };\r
-\r
- closeIcon.AccessibilityActivated += (s, e) =>\r
- {\r
- CloseBorderWindow();\r
- };\r
-\r
- maximalizeIcon.AccessibilityNameRequested += (s, e) =>\r
- {\r
- e.Name = "Maximize";\r
- };\r
-\r
- closeIcon.AccessibilityNameRequested += (s, e) =>\r
- {\r
- e.Name = "Close";\r
- };\r
-\r
- leftCornerIcon.AccessibilityNameRequested += (s, e) =>\r
- {\r
- e.Name = "Resize";\r
- };\r
-\r
- rightCornerIcon.AccessibilityNameRequested += (s, e) =>\r
- {\r
- e.Name = "Resize";\r
- };\r
-\r
- maximalizeIcon.SetAccessibilityReadingInfoTypes(Tizen.NUI.BaseComponents.AccessibilityReadingInfoTypes.Name);\r
- closeIcon.SetAccessibilityReadingInfoTypes(Tizen.NUI.BaseComponents.AccessibilityReadingInfoTypes.Name);\r
- leftCornerIcon.SetAccessibilityReadingInfoTypes(Tizen.NUI.BaseComponents.AccessibilityReadingInfoTypes.Name);\r
- rightCornerIcon.SetAccessibilityReadingInfoTypes(Tizen.NUI.BaseComponents.AccessibilityReadingInfoTypes.Name);\r
- return true;\r
- }\r
-\r
- public override void OnResized(int width, int height)\r
- {\r
- if (borderView != null)\r
- {\r
- base.OnResized(width, height);\r
- UpdateIcons();\r
- }\r
- }\r
-\r
- private void UpdateIcons()\r
- {\r
- if (BorderWindow != null && borderView != null)\r
- {\r
- if (BorderWindow.IsMaximized() == true)\r
- {\r
- if (maximalizeIcon != null)\r
- {\r
- maximalizeIcon.ResourceUrl = Resources.GetImagePath() + "/smallwindow.png";\r
- }\r
- }\r
- else\r
- {\r
- if (maximalizeIcon != null)\r
- {\r
- maximalizeIcon.ResourceUrl = Resources.GetImagePath() + "/maximalize.png";\r
- }\r
- }\r
- }\r
- }\r
- }\r
-}\r
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Apps.Common;
+
+namespace Apps.Views
+{
+ class CustomBorder : DefaultBorder
+ {
+ private ImageView maximalizeIcon;
+ private ImageView closeIcon;
+ private ImageView leftCornerIcon;
+ private ImageView rightCornerIcon;
+ private View borderView;
+
+ public CustomBorder() : base()
+ {
+ }
+
+ public override void CreateBorderView(View borderView)
+ {
+ this.borderView = borderView;
+ borderView.CornerRadius = new Vector4(0.03f, 0.03f, 0.03f, 0.03f);
+ borderView.CornerRadiusPolicy = VisualTransformPolicyType.Relative;
+ borderView.BackgroundColor = new Color(1, 1, 1, 0.3f);
+ }
+
+ public override bool CreateBottomBorderView(View bottomView)
+ {
+ if (bottomView == null)
+ {
+ return false;
+ }
+ bottomView.Layout = new RelativeLayout();
+ maximalizeIcon = new ImageView()
+ {
+ Focusable = true,
+ ResourceUrl = Resources.GetImagePath() + "/maximalize.png",
+ AccessibilityHighlightable = true,
+ };
+
+ closeIcon = new ImageView()
+ {
+ Focusable = true,
+ ResourceUrl = Resources.GetImagePath() + "/close.png",
+ AccessibilityHighlightable = true,
+ };
+
+ leftCornerIcon = new ImageView()
+ {
+ Focusable = true,
+ ResourceUrl = Resources.GetImagePath() + "/leftCorner.png",
+ AccessibilityHighlightable = true,
+ };
+
+ rightCornerIcon = new ImageView()
+ {
+ Focusable = true,
+ ResourceUrl = Resources.GetImagePath() + "/rightCorner.png",
+ AccessibilityHighlightable = true,
+ };
+
+ RelativeLayout.SetRightTarget(maximalizeIcon, closeIcon);
+ RelativeLayout.SetRightRelativeOffset(maximalizeIcon, 0.0f);
+ RelativeLayout.SetHorizontalAlignment(maximalizeIcon, RelativeLayout.Alignment.End);
+
+ RelativeLayout.SetRightTarget(closeIcon, rightCornerIcon);
+ RelativeLayout.SetRightRelativeOffset(closeIcon, 0.0f);
+ RelativeLayout.SetHorizontalAlignment(closeIcon, RelativeLayout.Alignment.End);
+
+ RelativeLayout.SetRightRelativeOffset(rightCornerIcon, 1.0f);
+ RelativeLayout.SetHorizontalAlignment(rightCornerIcon, RelativeLayout.Alignment.End);
+
+ bottomView.Add(leftCornerIcon);
+ bottomView.Add(maximalizeIcon);
+ bottomView.Add(closeIcon);
+ bottomView.Add(rightCornerIcon);
+
+ maximalizeIcon.TouchEvent += OnMaximizeIconTouched;
+ closeIcon.TouchEvent += OnCloseIconTouched;
+ leftCornerIcon.TouchEvent += OnLeftBottomCornerIconTouched;
+ rightCornerIcon.TouchEvent += OnRightBottomCornerIconTouched;
+
+ maximalizeIcon.AccessibilityActivated += (s, e) =>
+ {
+ MaximizeBorderWindow();
+ };
+
+ closeIcon.AccessibilityActivated += (s, e) =>
+ {
+ CloseBorderWindow();
+ };
+
+ maximalizeIcon.AccessibilityNameRequested += (s, e) =>
+ {
+ e.Name = "Maximize";
+ };
+
+ closeIcon.AccessibilityNameRequested += (s, e) =>
+ {
+ e.Name = "Close";
+ };
+
+ leftCornerIcon.AccessibilityNameRequested += (s, e) =>
+ {
+ e.Name = "Resize";
+ };
+
+ rightCornerIcon.AccessibilityNameRequested += (s, e) =>
+ {
+ e.Name = "Resize";
+ };
+
+ maximalizeIcon.SetAccessibilityReadingInfoTypes(Tizen.NUI.BaseComponents.AccessibilityReadingInfoTypes.Name);
+ closeIcon.SetAccessibilityReadingInfoTypes(Tizen.NUI.BaseComponents.AccessibilityReadingInfoTypes.Name);
+ leftCornerIcon.SetAccessibilityReadingInfoTypes(Tizen.NUI.BaseComponents.AccessibilityReadingInfoTypes.Name);
+ rightCornerIcon.SetAccessibilityReadingInfoTypes(Tizen.NUI.BaseComponents.AccessibilityReadingInfoTypes.Name);
+ return true;
+ }
+
+ public override void OnResized(int width, int height)
+ {
+ if (borderView != null)
+ {
+ base.OnResized(width, height);
+ UpdateIcons();
+ }
+ }
+
+ private void UpdateIcons()
+ {
+ if (BorderWindow != null && borderView != null)
+ {
+ if (BorderWindow.IsMaximized() == true)
+ {
+ if (maximalizeIcon != null)
+ {
+ maximalizeIcon.ResourceUrl = Resources.GetImagePath() + "/smallwindow.png";
+ }
+ }
+ else
+ {
+ if (maximalizeIcon != null)
+ {
+ maximalizeIcon.ResourceUrl = Resources.GetImagePath() + "/maximalize.png";
+ }
+ }
+ }
+ }
+ }
+}
-Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
+Copyright (c) 2022 Samsung Electronics Co., Ltd. All rights reserved.
Apache License
Version 2.0, January 2004
-using Tizen.NUI;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 Tizen.NUI;
namespace TrayApplication.Common
{
height = Window.Instance.Size.Height;
IsPortrait = width < height;
orientation = Window.Instance.GetCurrentOrientation();
- if(orientation == Window.WindowOrientation.Portrait || orientation == Window.WindowOrientation.PortraitInverse && IsPortrait == false)\r
- {\r
- if (IsPortrait == false)\r
- {\r
- ToggleOrientation();\r
- }\r
+ if(orientation == Window.WindowOrientation.Portrait || orientation == Window.WindowOrientation.PortraitInverse && IsPortrait == false)
+ {
+ if (IsPortrait == false)
+ {
+ ToggleOrientation();
+ }
}
- else if(IsPortrait == true)\r
- {\r
- ToggleOrientation();\r
+ else if(IsPortrait == true)
+ {
+ ToggleOrientation();
}
}
-using ElmSharp;\r
-\r
-namespace TrayApplication.Common\r
-{\r
- public static class InputGeneratorBase\r
- {\r
- const string KeyName = "XF86Back";\r
-\r
- private static InputGenerator inputGenerator;\r
- public static InputGenerator InputGenerator\r
- {\r
- get { return inputGenerator; }\r
- }\r
- public static void InitInputGenerator()\r
- {\r
- inputGenerator = new InputGenerator(InputDeviceType.Keyboard, "TrayApplication");\r
- }\r
-\r
- public static void OnKeyEvent()\r
- {\r
- Tizen.Log.Debug(Resources.LogTag, "KeyEvent Called : " + KeyName);\r
- inputGenerator.GenerateKeyEvent(KeyName, 1);\r
- inputGenerator.GenerateKeyEvent(KeyName, 0);\r
- }\r
-\r
- public static void FinalizeInputGenerator()\r
- {\r
- if (inputGenerator != null)\r
- {\r
- inputGenerator.Dispose();\r
- }\r
- }\r
- }\r
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 ElmSharp;
+
+namespace TrayApplication.Common
+{
+ public static class InputGeneratorBase
+ {
+ const string KeyName = "XF86Back";
+
+ private static InputGenerator inputGenerator;
+ public static InputGenerator InputGenerator
+ {
+ get { return inputGenerator; }
+ }
+ public static void InitInputGenerator()
+ {
+ inputGenerator = new InputGenerator(InputDeviceType.Keyboard, "TrayApplication");
+ }
+
+ public static void OnKeyEvent()
+ {
+ Tizen.Log.Debug(Resources.LogTag, "KeyEvent Called : " + KeyName);
+ inputGenerator.GenerateKeyEvent(KeyName, 1);
+ inputGenerator.GenerateKeyEvent(KeyName, 0);
+ }
+
+ public static void FinalizeInputGenerator()
+ {
+ if (inputGenerator != null)
+ {
+ inputGenerator.Dispose();
+ }
+ }
+ }
}
\ No newline at end of file
-using System.ComponentModel;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.ComponentModel;
using System.Runtime.CompilerServices;
namespace TrayApplication.Common
-using Tizen.NUI;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 Tizen.NUI;
namespace TrayApplication.Common
{
-using System;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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;
using Tizen.Applications;
namespace TrayApplication.Core
-using System;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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;
using System.Collections.Generic;
using Microsoft.Data.Sqlite;
using Tizen.Applications;
{
if (e.State == PackageEventState.Completed)
{
- try\r
- {\r
- Package package = PackageManager.GetPackage(e.PackageId);\r
- foreach (ApplicationInfo appInfo in package.GetApplications())\r
- {\r
- if (appInfo == null || string.IsNullOrEmpty(appInfo.IconPath) || appInfo.IsNoDisplay == true)\r
- {\r
- continue;\r
- }\r
- Tizen.Log.Info(Resources.LogTag, "Updating " + appInfo.ApplicationId);\r
- IncreaseScore(appInfo.ApplicationId, true);\r
- OnDatabaseUpdate.Invoke(null, new EventArgs());\r
+ try
+ {
+ Package package = PackageManager.GetPackage(e.PackageId);
+ foreach (ApplicationInfo appInfo in package.GetApplications())
+ {
+ if (appInfo == null || string.IsNullOrEmpty(appInfo.IconPath) || appInfo.IsNoDisplay == true)
+ {
+ continue;
+ }
+ Tizen.Log.Info(Resources.LogTag, "Updating " + appInfo.ApplicationId);
+ IncreaseScore(appInfo.ApplicationId, true);
+ OnDatabaseUpdate.Invoke(null, new EventArgs());
}
}
catch(Exception ex)
- {\r
- Tizen.Log.Error(Resources.LogTag, "Exception " + ex.Message);\r
+ {
+ Tizen.Log.Error(Resources.LogTag, "Exception " + ex.Message);
}
}
}
{
if (e.Progress == 0)
{
- try\r
- {\r
- Package package = PackageManager.GetPackage(e.PackageId);\r
- foreach (ApplicationInfo appInfo in package.GetApplications())\r
- {\r
- if (appInfo == null || string.IsNullOrEmpty(appInfo.IconPath) || appInfo.IsNoDisplay == true)\r
- {\r
- continue;\r
- }\r
- Tizen.Log.Info(Resources.LogTag, "Updating " + appInfo.ApplicationId);\r
- RemoveAppScore(appInfo.ApplicationId);\r
- OnDatabaseUpdate.Invoke(null, new EventArgs());\r
- }\r
+ try
+ {
+ Package package = PackageManager.GetPackage(e.PackageId);
+ foreach (ApplicationInfo appInfo in package.GetApplications())
+ {
+ if (appInfo == null || string.IsNullOrEmpty(appInfo.IconPath) || appInfo.IsNoDisplay == true)
+ {
+ continue;
+ }
+ Tizen.Log.Info(Resources.LogTag, "Updating " + appInfo.ApplicationId);
+ RemoveAppScore(appInfo.ApplicationId);
+ OnDatabaseUpdate.Invoke(null, new EventArgs());
+ }
}
catch(Exception ex)
- {\r
- Tizen.Log.Error(Resources.LogTag, "Exception " + ex.Message);\r
+ {
+ Tizen.Log.Error(Resources.LogTag, "Exception " + ex.Message);
}
}
}
if (appInfo == null || string.IsNullOrEmpty(appInfo.IconPath) || appInfo.IsNoDisplay == true)
{
return;
- }\r
- IncreaseScore(e.ApplicationRunningContext.ApplicationId, false);\r
+ }
+ IncreaseScore(e.ApplicationRunningContext.ApplicationId, false);
OnDatabaseUpdate.Invoke(null, new EventArgs());
}
- catch (Exception ex)\r
- {\r
- Tizen.Log.Error(Resources.LogTag, "Exception " + ex.Message);\r
+ catch (Exception ex)
+ {
+ Tizen.Log.Error(Resources.LogTag, "Exception " + ex.Message);
}
}
ApplicationInfoFilter appInfoFilter = new ApplicationInfoFilter();
appInfoFilter.Filter.Add(ApplicationInfoFilter.Keys.NoDisplay, "False");
var task = ApplicationManager.GetInstalledApplicationsAsync(appInfoFilter);
- task.Wait();\r
- try\r
- {\r
- IEnumerable<ApplicationInfo> applicationsList = task.Result;\r
- if (applicationsList != null)\r
- {\r
- foreach (ApplicationInfo appInfo in applicationsList)\r
- {\r
- if (appInfo == null || string.IsNullOrEmpty(appInfo.IconPath))\r
- {\r
- continue;\r
- }\r
- sqliteCmd.CommandText = INSERT_VALUES_QUERY + appInfo.ApplicationId + "', 50.00); ";\r
- sqliteCmd.ExecuteNonQuery();\r
+ task.Wait();
+ try
+ {
+ IEnumerable<ApplicationInfo> applicationsList = task.Result;
+ if (applicationsList != null)
+ {
+ foreach (ApplicationInfo appInfo in applicationsList)
+ {
+ if (appInfo == null || string.IsNullOrEmpty(appInfo.IconPath))
+ {
+ continue;
+ }
+ sqliteCmd.CommandText = INSERT_VALUES_QUERY + appInfo.ApplicationId + "', 50.00); ";
+ sqliteCmd.ExecuteNonQuery();
}
}
}
catch (Exception ex)
- {\r
- Tizen.Log.Error(Resources.LogTag, "Error " + ex.Message);\r
+ {
+ Tizen.Log.Error(Resources.LogTag, "Error " + ex.Message);
}
sqliteCmd.Dispose();
}
string appName = sqliteDatareader.GetString(0);
int appScore = sqliteDatareader.GetInt32(1);
Tizen.Log.Info(Resources.LogTag, "appName " + appName + " score " + appScore);
- try\r
- {\r
- appsScoreData.Add(appName, appScore);\r
+ try
+ {
+ appsScoreData.Add(appName, appScore);
}
catch(Exception ex)
- {\r
- Tizen.Log.Error(Resources.LogTag, "Error " + ex.Message);\r
+ {
+ Tizen.Log.Error(Resources.LogTag, "Error " + ex.Message);
}
}
sqliteCmd.Dispose();
-using System;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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;
using System.Collections.Generic;
using System.Windows.Input;
using Tizen.NUI;
namespace TrayApplication.Models
{
class AppInfoModel : PropertyNotifier
- {\r
+ {
private ImageVisual defaultVisual;
private GradientVisual gradientVisual;
Name = name;
ApplicationId = applicationId;
IconUrl = url;
- AppSelectCommand = new Command(OnAppSelect);\r
-\r
- if (Name == "back")\r
- {\r
+ AppSelectCommand = new Command(OnAppSelect);
+
+ if (Name == "back")
+ {
InputGeneratorBase.InitInputGenerator();
}
- }\r
-\r
+ }
+
public AppInfoModel(string name, string url)
{
Name = name;
}
private void OnAppSelect(object selectedItem)
- {\r
- if (Name == "back")\r
- {\r
- InputGeneratorBase.OnKeyEvent();\r
+ {
+ if (Name == "back")
+ {
+ InputGeneratorBase.OnKeyEvent();
}
- else\r
- {\r
- AppLauncher.LaunchApplication(ApplicationId);\r
+ else
+ {
+ AppLauncher.LaunchApplication(ApplicationId);
}
}
PropertyArray stopColor = GetGradientStopColors(palette);
if (stopColor.Count() < 2)
{
- Tizen.Log.Info(Resources.LogTag, "Palette or palatte values not valid, adding default gradient");\r
+ Tizen.Log.Info(Resources.LogTag, "Palette or palatte values not valid, adding default gradient");
SetDefaultImageVisual();
IconBackground = defaultVisual.OutputVisualMap;
}
else
{
Tizen.Log.Info(Resources.LogTag, "setting palette color");
- SetGradientVisual(stopColor);\r
+ SetGradientVisual(stopColor);
IconBackground = gradientVisual.OutputVisualMap;
}
- }\r
-\r
- ~AppInfoModel()\r
- {\r
- Tizen.Log.Info(Resources.LogTag, "Clearing NUI PropertyMap resources");\r
- defaultVisual?.Dispose();\r
- defaultVisual = null;\r
- gradientVisual?.Dispose();\r
- gradientVisual = null;\r
- IconBackground?.Dispose();\r
- IconBackground = null;\r
+ }
+
+ ~AppInfoModel()
+ {
+ Tizen.Log.Info(Resources.LogTag, "Clearing NUI PropertyMap resources");
+ defaultVisual?.Dispose();
+ defaultVisual = null;
+ gradientVisual?.Dispose();
+ gradientVisual = null;
+ IconBackground?.Dispose();
+ IconBackground = null;
}
}
}
-using System;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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;
using System.Collections.Generic;
using Tizen.NUI;
using Tizen.NUI.WindowSystem.Shell;
protected override void OnTerminate()
{
Tizen.Log.Info(Resources.LogTag, "Program OnTerminate");
- AppScoreDataBase.Disconnect();\r
- InputGeneratorBase.FinalizeInputGenerator();\r
+ AppScoreDataBase.Disconnect();
+ InputGeneratorBase.FinalizeInputGenerator();
base.OnTerminate();
}
-using System.Collections;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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;
using System.Collections.Generic;
using System.Threading;
using System.Windows.Input;
-using System.Collections;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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;
using System.Collections.Generic;
using Tizen.NUI;
using TrayApplication.Common;
-using System;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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;
using System.Windows.Input;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
-using System;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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;
using System.Collections.Generic;
using System.Collections;
using System.Windows.Input;
}
private void UpdateRemovePopupWindowDimensions()
- {\r
- popupBaseView.WidthSpecification = removePopupWindow.Size.Width;\r
+ {
+ popupBaseView.WidthSpecification = removePopupWindow.Size.Width;
popupBaseView.HeightSpecification = (int)(0.70f * removePopupWindow.Size.Height);
popupBaseView.Remove(removePopup);
popupBaseView.Add(removePopup);
removePopupWindow.SetTransparency(true);
removePopupWindow.BackgroundColor = Color.Transparent;
- popupBaseView = new View();\r
+ popupBaseView = new View();
removePopupWindow.Add(popupBaseView);
Button cancelButton = new Button("CancelButton");
{
Size2D = new Size2D(252, 48).SpToPx(),
Text = "Delete",
- };\r
+ };
deleteButton.PointSize = 16.SpToPx();
if (removePopup == null)
{
Message = "Do you want to delete this app from the Tray? App won't be uninstalled from your device",
Actions = new List<Button>() { cancelButton, deleteButton },
};
- }\r
- popupBaseView.Add(removePopup);\r
+ }
+ popupBaseView.Add(removePopup);
UpdateRemovePopupWindowDimensions();
removePopupWindow.Resized += OnRemovePopupWindowResized;
private void RemoveConfirmationPopup()
{
- if (removePopup != null)\r
- {\r
- removePopupWindow?.Remove(popupBaseView);\r
- popupBaseView?.Remove(removePopup);\r
- removePopup.Dispose();\r
- removePopup = null;\r
- popupBaseView?.Dispose();\r
- popupBaseView = null;\r
- removePopupWindow?.Dispose();\r
- removePopupWindow = null;\r
+ if (removePopup != null)
+ {
+ removePopupWindow?.Remove(popupBaseView);
+ popupBaseView?.Remove(removePopup);
+ removePopup.Dispose();
+ removePopup = null;
+ popupBaseView?.Dispose();
+ popupBaseView = null;
+ removePopupWindow?.Dispose();
+ removePopupWindow = null;
}
}
-using System;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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;
using System.IO;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
-using System.Collections;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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;
using System.Collections.Generic;
using Tizen.NUI;
using Tizen.NUI.Components;
defaultButtons.Add(button);
button.BindingContext = item;
button.Icon.SetBinding(ImageView.ResourceUrlProperty, "IconUrl");
- button.SetBinding(Control.CommandProperty, "AppSelectCommand");\r
-\r
- Tizen.Log.Info(Resources.LogTag, "Buttons Added");\r
+ button.SetBinding(Control.CommandProperty, "AppSelectCommand");
+
+ Tizen.Log.Info(Resources.LogTag, "Buttons Added");
}
- }\r
-\r
+ }
+
public void OnRemoveModeToggled(bool removeMode)
{
if (removeMode == true)
%files
%defattr(-,root,root,-)
%{preload_tpk_path}/*
+%license LICENSE
\ No newline at end of file