Resolve "Wrong icons info (i) and bluetooth icon" 11/298911/3
authorAnuj Kumar Singh <anujk.singh@samsung.com>
Thu, 14 Sep 2023 06:00:22 +0000 (11:30 +0530)
committerAnuj Kumar Singh <anujk.singh@samsung.com>
Fri, 15 Sep 2023 06:42:34 +0000 (12:12 +0530)
This patch resolves:
Jira issue:  https://code.sec.samsung.net/jira/browse/TEIGHT-5168

Change-Id: Ie04e9e26d4ac7fc958e8c59dff48703259fd8f63
Signed-off-by: Anuj Kumar Singh <anujk.singh@samsung.com>
SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs
SettingBluetooth/SettingBluetooth/res/allowed/SettingBluetooth/images/bluetooth_icon.png [new file with mode: 0644]
SettingBluetooth/SettingBluetooth/res/allowed/SettingBluetooth/images/bluetooth_info_icon.png [new file with mode: 0644]
packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk

index 074adf4880cf9902dbde7135a481388a115f45d7..490f8d7effed570b62a7d6c7e83fc3f3109b4f1d 100644 (file)
@@ -44,52 +44,7 @@ namespace SettingBluetooth
             mBtDevice = btDevice;
             mRssi = btDevice.Rssi;
             string icon;
-            switch (btDevice.DeviceIcon)
-            {
-                case BtDeviceIcon.Phone:
-                    icon = "/images/icon_mobilephone.png"; // TODO: need to replace image file
-                    break;
-                case BtDeviceIcon.Headset:
-                    icon = "/images/icon_headset.png";
-                    break;
-                case BtDeviceIcon.Headphone:
-                    icon = "/images/icon_headphone.png";
-                    break;
-                case BtDeviceIcon.Computer:
-                    icon = "/images/icon_computer.png";
-                    break;
-                case BtDeviceIcon.Keyboard:
-                    icon = "/images/icon_keyboard.png";
-                    break;
-                case BtDeviceIcon.Mouse:
-                    icon = "/images/icon_mouse.png";
-                    break;
-                case BtDeviceIcon.Printer:
-                    icon = "/images/icon_printer.png";
-                    break;
-                case BtDeviceIcon.Health:
-                    icon = "/images/icon_health.png";
-                    break;
-                case BtDeviceIcon.Network:
-                    icon = "/images/icon_network_infrastructure.png";
-                    break;
-                case BtDeviceIcon.Gaming:
-                    icon = "/images/icon_gaming.png";
-                    break;
-                case BtDeviceIcon.Display:
-                    icon = "/images/icon_display.png";
-                    break;
-                case BtDeviceIcon.Camera:
-                    icon = "/images/icon_camera.png";
-                    break;
-                case BtDeviceIcon.Watch:
-                    icon = "/images/icon_wrist.png";
-                    break;
-                case BtDeviceIcon.Unknown:
-                default:
-                    icon = "/images/icon_unknown.png";
-                    break;
-            }
+            icon = "/images/bluetooth_icon.png";
             mIconDir = mResourcePath + icon;
         }
 
@@ -387,7 +342,7 @@ namespace SettingBluetooth
                     {
                         Color = new Selector<Color>()
                         {
-                            Normal = new Color("#17234D"),
+                            Normal = new Color("#FFFFFF"),
                             Focused = new Color("#17234D"),
                             Pressed = new Color("#FF6200"),
                             Disabled = new Color("#CACACA"),
@@ -395,27 +350,11 @@ namespace SettingBluetooth
                     };
                     item.Icon = new ImageView(imageViewStyle);
                     item.Icon.SetBinding(ImageView.ResourceUrlProperty, "ImageUrl");
-                    item.Icon.WidthSpecification = 40;
-                    item.Icon.HeightSpecification = 40;
+                    item.Icon.WidthSpecification = 12;
+                    item.Icon.HeightSpecification = 20;
                     item.Clicked += DeviceController.DeviceItemClicked;
                     item.IsSelectable = false;
-
-                    //if (isPairedDeviceView == true) // TODO: need to use DataTemplateExtension and DataTemplateSelector
-                    //{
-                    var detailButton = new Button // TODO: need to use other type instead of Button
-                        {
-                            Text = "i"
-                        };
-                        detailButton.WidthSpecification = 40;
-                        detailButton.Clicked += (obj, ev) =>
-                        {
-                            Button button = (Button)obj;
-                            var device = button.BindingContext as Device;
-                            Log.Debug(SettingBluetooth.LogTag, "Button clicked. Name: " + device.Name);
-                            BtDetailView.CreateDetailView(device);
-                        };
-                        item.Extra = detailButton;
-                    //}
+                    item.Extra = GetInfoButton();
 
                     return item;
                 }),
@@ -494,6 +433,51 @@ namespace SettingBluetooth
             mScanButton.Text = text;
         }
 
+        internal static Selector<Color> GetDefaultColorSelector()
+        {
+            return new Selector<Color>()
+            {
+                Normal = new Color("#17234D"),
+                Focused = new Color("#17234D"),
+                Pressed = new Color("#FF6200"),
+                Disabled = new Color("#CACACA"),
+            };
+        }
+
+        internal static void OnInfoClicked(object obj, ClickedEventArgs e)
+        {
+            Button button = (Button)obj;
+            var device = button.BindingContext as Device;
+            Log.Debug(SettingBluetooth.LogTag, "Button clicked. Name: " + device.Name);
+            BtDetailView.CreateDetailView(device);
+        }
+
+        internal static Button GetInfoButton()
+        {
+            int buttonSize = 25;
+
+            ButtonStyle style = new ButtonStyle()
+            {
+                IsSelectable = true,
+                CornerRadius = 50,
+                BackgroundColor = GetDefaultColorSelector(),
+            };
+
+            Button infoButton = new Button(style)
+            {
+                WidthSpecification = buttonSize,
+                HeightSpecification = buttonSize,
+                IconURL = Resources.GetPath() + "/images/bluetooth_info_icon.png",
+                IsSelectable = false,
+            };
+
+            infoButton.Icon.WidthSpecification = buttonSize;
+            infoButton.Icon.HeightSpecification = buttonSize;
+            infoButton.Clicked += OnInfoClicked;
+
+            return infoButton;
+        }
+
         internal static void BtModelDeviceChanged(object obj, BtDeviceChangedEventArgs ev)
         {
             Log.Debug(SettingBluetooth.LogTag, "BtModelDeviceChanged. Address: " + ev.BtDevice.Address + ", State: " + ev.BtDevice.DeviceState);
diff --git a/SettingBluetooth/SettingBluetooth/res/allowed/SettingBluetooth/images/bluetooth_icon.png b/SettingBluetooth/SettingBluetooth/res/allowed/SettingBluetooth/images/bluetooth_icon.png
new file mode 100644 (file)
index 0000000..964f1f2
Binary files /dev/null and b/SettingBluetooth/SettingBluetooth/res/allowed/SettingBluetooth/images/bluetooth_icon.png differ
diff --git a/SettingBluetooth/SettingBluetooth/res/allowed/SettingBluetooth/images/bluetooth_info_icon.png b/SettingBluetooth/SettingBluetooth/res/allowed/SettingBluetooth/images/bluetooth_info_icon.png
new file mode 100644 (file)
index 0000000..d4b03eb
Binary files /dev/null and b/SettingBluetooth/SettingBluetooth/res/allowed/SettingBluetooth/images/bluetooth_info_icon.png differ
index 0f4f953ffea2ea8332dbd492f7abfd013132cf77..a384edde0b4ba93c8f0fed4c0e9d9814af4dbd09 100644 (file)
Binary files a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk and b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk differ