[TSEVENDF-4671] Updating new app ids, app background 81/292381/3 accepted/tizen/unified/20230528.171033
authorShivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com>
Thu, 4 May 2023 11:17:34 +0000 (16:47 +0530)
committerShivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com>
Fri, 5 May 2023 03:40:11 +0000 (09:10 +0530)
Change-Id: I0f63724ce42ba65313cc45aa7bd5857137fe4ef2
Signed-off-by: Shivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com>
Apps/Apps.cs
TrayApplication/Models/AppInfoModel.cs
TrayApplication/ViewModels/ApplicationViewModel.cs
TrayApplication/ViewModels/QuickAccessViewModel.cs
TrayApplication/Views/ApplicationsView.cs
packaging/org.tizen.Apps-1.0.0.tpk
packaging/org.tizen.TrayApplication-1.0.0.tpk

index 848a16eddb2f4bb8b5e63b7c62cb0f1fd63ae417..7a0f338918c90e6f4a6e071dfaffedfadfca40b2 100755 (executable)
@@ -92,7 +92,7 @@ namespace Apps
                                 ApplicationId = "org.tizen.Apps",
                                 Operation = AppControlOperations.Send
                             };
-                            appControl?.ExtraData.Add("SelectedApps", selectedApps);
+                            appControl.ExtraData?.Add("SelectedApps", selectedApps);
                             e.ReceivedAppControl.ReplyToLaunchRequest(appControl, AppControlReplyResult.Succeeded);
                             Exit();
                         }
index a908212754d46a56504c92be92e24c2895e096ed..1a4bd6f061ee8e99e9d2e8624df1a9462baec9b7 100755 (executable)
@@ -26,9 +26,6 @@ namespace TrayApplication.Models
 {
     class AppInfoModel : PropertyNotifier
     {
-        private ImageVisual defaultVisual;
-        private GradientVisual gradientVisual;
-
         public AppInfoModel(string name, string applicationId, string url)
         {
             Name = name;
@@ -59,11 +56,11 @@ namespace TrayApplication.Models
             set => SetProperty(ref iconUrl, value);
         }
 
-        private PropertyMap iconBackground;
-        public PropertyMap IconBackground
+        private Color iconBackgroundColor;
+        public Color IconBackgroundColor
         {
-            get => iconBackground;
-            set => SetProperty(ref iconBackground, value);
+            get => iconBackgroundColor;
+            set => SetProperty(ref iconBackgroundColor, value);
         }
 
         private ICommand appSelectCommand;
@@ -85,79 +82,7 @@ namespace TrayApplication.Models
             }
         }
 
-        private void SetDefaultImageVisual()
-        {
-            defaultVisual = new ImageVisual()
-            {
-                URL = Resources.GetImagePath() + "default_gradient.png",
-                CornerRadius = new Vector4(12, 12, 12, 12),
-            };
-        }
-
-        private void SetGradientVisual(PropertyArray stopColor)
-        {
-            gradientVisual = new GradientVisual()
-            {
-                StartPosition = new Vector2(0.0f, -1.0f),
-                EndPosition = new Vector2(0.0f, 1.0f),
-                StopColor = stopColor,
-                SpreadMethod = GradientVisualSpreadMethodType.Pad,
-                CornerRadius = new Vector4(12, 12, 12, 12),
-            };
-        }
-
-        private PropertyArray GetGradientStopColors(Palette palette)
-        {
-            PropertyArray propertyArray = new PropertyArray();
-            if (palette == null)
-            {
-                Tizen.Log.Error(Resources.LogTag, "Color palette from background is null");
-                return propertyArray;
-            }
-
-            Palette.Swatch lightMutedSwatch = palette.GetLightMutedSwatch();
-            Palette.Swatch darkMutedSwatch = palette.GetDarkMutedSwatch();
-            if (lightMutedSwatch != null && darkMutedSwatch != null)
-            {
-                propertyArray.PushBack(new PropertyValue(lightMutedSwatch.GetRgb()));
-                propertyArray.PushBack(new PropertyValue(darkMutedSwatch.GetRgb()));
-                return propertyArray;
-            }
-
-            Palette.Swatch lightVibrantSwatch = palette.GetLightVibrantSwatch();
-            Palette.Swatch darkVibrantSwatch = palette.GetDarkVibrantSwatch();
-            if (lightVibrantSwatch != null && darkVibrantSwatch != null)
-            {
-                propertyArray.PushBack(new PropertyValue(lightVibrantSwatch.GetRgb()));
-                propertyArray.PushBack(new PropertyValue(darkVibrantSwatch.GetRgb()));
-                return propertyArray;
-            }
-
-            Palette.Swatch mutedSwatch = palette.GetMutedSwatch();
-            Palette.Swatch vibrantSwatch = palette.GetVibrantSwatch();
-            if (mutedSwatch != null && vibrantSwatch != null)
-            {
-                propertyArray.PushBack(new PropertyValue(mutedSwatch.GetRgb()));
-                propertyArray.PushBack(new PropertyValue(vibrantSwatch.GetRgb()));
-                return propertyArray;
-            }
-
-            IReadOnlyCollection<Palette.Swatch> swatches = palette.GetSwatches();
-            foreach (Palette.Swatch swatch in swatches)
-            {
-                if (propertyArray.Count() >= 2)
-                {
-                    return propertyArray;
-                }
-                if (swatch != null)
-                {
-                    propertyArray.PushBack(new PropertyValue(swatch.GetRgb()));
-                }
-            }
-            return propertyArray;
-        }
-
-        public void SetExtractedBackground(string path)
+        public void SetBackgroundColor(string path)
         {
             Tizen.Log.Debug(Resources.LogTag, "Path for the color image thumbnail" + path);
             PixelBuffer pixelBuffer = ImageLoader.LoadImageFromFile(path);
@@ -166,34 +91,27 @@ namespace TrayApplication.Models
             {
                 palette = Palette.Generate(pixelBuffer);
             }
-            catchArgumentNullException e)
+            catch (ArgumentNullException e)
             {
                 Tizen.Log.Error(Resources.LogTag, "ArgumentNullException: " + e.Message);
             }
-            PropertyArray stopColor = GetGradientStopColors(palette);
-            if (stopColor.Count() < 2)
+            if (palette == null || palette.GetDominantSwatch() == null)
             {
-                Tizen.Log.Info(Resources.LogTag, "Palette or palatte values not valid, adding default gradient");
-                SetDefaultImageVisual();
-                IconBackground = defaultVisual.OutputVisualMap;
+                IconBackgroundColor = Color.Transparent;
             }
             else
             {
-                Tizen.Log.Info(Resources.LogTag, "setting palette color");
-                SetGradientVisual(stopColor);
-                IconBackground = gradientVisual.OutputVisualMap;
+                IconBackgroundColor = palette.GetDominantSwatch().GetRgb();
             }
+            pixelBuffer.Dispose();
         }
 
         ~AppInfoModel()
         {
-            Tizen.Log.Info(Resources.LogTag, "Clearing NUI PropertyMap resources");
-            defaultVisual?.Dispose();
-            defaultVisual = null;
-            gradientVisual?.Dispose();
-            gradientVisual = null;
-            IconBackground?.Dispose();
-            IconBackground = null;
+            if (Name == "back")
+            {
+                InputGeneratorBase.FinalizeInputGenerator();
+            }
         }
     }
 }
index 6b0caff418154aab72616b6dcda64b72ac2ad7e7..78e96e2c79bef04dc143b7aa4476f85aa9c96084 100755 (executable)
@@ -65,7 +65,7 @@ namespace TrayApplication.ViewModels
         private void AddAppsApplication()
         {
             AppInfoModel appsApp = new AppInfoModel("Apps", AppsId, Resources.GetCurrentThemePath() + "apps.png");
-            appsApp.SetExtractedBackground(string.Empty);
+            appsApp.SetBackgroundColor(string.Empty);
             appInfoModelDictionary.Add(AppsId, appsApp);
         }
 
@@ -73,7 +73,7 @@ namespace TrayApplication.ViewModels
         {
             ApplicationInfo appInfo = new ApplicationInfo(appId);
             AppInfoModel appInfoModel = new AppInfoModel(appInfo.Label, appId, appInfo.IconPath);
-            appInfoModel.SetExtractedBackground(appInfoModel.IconUrl);
+            appInfoModel.SetBackgroundColor(appInfoModel.IconUrl);
             appInfoModelDictionary.Add(appId, appInfoModel);
             appInfo.Dispose();
         }
index 4039d0d01a1db631ec2de25eb8dd89c9fbc04f8f..afc0d6f32d5fe1fe55c2ad76287454ca3f234dfb 100755 (executable)
@@ -48,9 +48,9 @@ namespace TrayApplication.ViewModels
             ((List<object>)ButtonsInfo).Clear();
             List<object> buttons = new List<object>
             {
-                new AppInfoModel(AppNames[0], "org.tizen.homescreen-efl", imagePath + AppNames[0] + ".png"),
+                new AppInfoModel(AppNames[0], "org.tizen.homescreen-nui", imagePath + AppNames[0] + ".png"),
                 new AppInfoModel(AppNames[1], "org.tizen.SettingView", imagePath + AppNames[1] + ".png"),
-                new AppInfoModel(AppNames[2], "org.tizen.volume", imagePath + AppNames[2] + ".png"),
+                new AppInfoModel(AppNames[2], "org.tizen.volume-nui", imagePath + AppNames[2] + ".png"),
                 new AppInfoModel(AppNames[3], string.Empty, imagePath + AppNames[3] + ".png"),
                 //new AppInfoModel(AppNames[3], "org.tizen.quickpanel", imagePath + AppNames[3] + ".png"), //Will be added Later
                 //new AppInfoModel(AppNames[5], "org.tizen.powerkey-syspopup", imagePath + AppNames[5] + ".png") //Will be added Later
index e0fc01218e00374980bb099839ab5c79a96a679f..2a55caea23f688e69e630c7912468da582d68838 100755 (executable)
@@ -156,7 +156,7 @@ namespace TrayApplication.Views
                 itemView.Icon.SetBinding(ImageView.ResourceUrlProperty, "IconUrl");
                 itemView.Label.SetBinding(TextLabel.TextProperty, "Name");
                 itemView.SetBinding(AppItemView.AppSelectCommandProperty, "AppSelectCommand");
-                itemView.IconBackground.SetBinding(BackgroundProperty, "IconBackground");
+                itemView.IconBackground.SetBinding(BackgroundColorProperty, "IconBackgroundColor");
             }
             currentAppsCount = totalCount;
             if (removeMode == true)
index d279654cde3230422781953e43920eae72664699..0a8b9c4d9f286f8393c02cc035870c98b644daf4 100755 (executable)
Binary files a/packaging/org.tizen.Apps-1.0.0.tpk and b/packaging/org.tizen.Apps-1.0.0.tpk differ
index 02152a7fc6e0eb80905b808f2fa030a42a6887b3..c61298c6863741b9998532b723b41fd95a0fdcb0 100755 (executable)
Binary files a/packaging/org.tizen.TrayApplication-1.0.0.tpk and b/packaging/org.tizen.TrayApplication-1.0.0.tpk differ