From: Wootak Jung Date: Wed, 12 Oct 2022 08:04:57 +0000 (+0900) Subject: Enable device icon X-Git-Tag: accepted/tizen/unified/20221111.105330~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eca85caf9db0c0e85dbe596fbf0cc83cc54be694;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsetting-bluetooth.git Enable device icon Change-Id: I763b005d874cdba090a28ae5a991eac578cbc941 Signed-off-by: Wootak Jung --- diff --git a/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs b/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs index a1d6cd1..7e3d1d7 100644 --- a/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs +++ b/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs @@ -40,55 +40,54 @@ namespace SettingBluetooth mAddress = btDevice.Address; mName = btDevice.Name; mBtDevice = btDevice; - //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; - //} - //mIconDir = mResourcePath + icon; - mIconDir = mResourcePath + "/images/icon.png"; + 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; + } + mIconDir = mResourcePath + icon; } internal BtDevice BtDevice diff --git a/SettingBluetooth/SettingBluetooth/View/BtMainView.cs b/SettingBluetooth/SettingBluetooth/View/BtMainView.cs index 752121a..a926a88 100644 --- a/SettingBluetooth/SettingBluetooth/View/BtMainView.cs +++ b/SettingBluetooth/SettingBluetooth/View/BtMainView.cs @@ -45,6 +45,17 @@ namespace SettingBluetooth item.Label.HorizontalAlignment = HorizontalAlignment.Begin; item.SubLabel.SetBinding(TextLabel.TextProperty, "State"); item.SubLabel.HorizontalAlignment = HorizontalAlignment.Begin; + ImageViewStyle imageViewStyle = new ImageViewStyle() + { + Color = new Selector() + { + Normal = new Color("#17234D"), + Focused = new Color("#17234D"), + Pressed = new Color("#FF6200"), + Disabled = new Color("#CACACA"), + }, + }; + item.Icon = new ImageView(imageViewStyle); item.Icon.SetBinding(ImageView.ResourceUrlProperty, "ImageUrl"); item.Icon.WidthSpecification = 40; item.Icon.HeightSpecification = 40; diff --git a/packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk b/packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk index 8732af3..786e18a 100644 Binary files a/packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk and b/packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk differ