From: Akash Kumar Date: Tue, 19 Sep 2023 11:32:30 +0000 (+0530) Subject: Resolve bt off message not showing issue X-Git-Tag: accepted/tizen/unified/20230925.091521~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F91%2F299091%2F2;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsetting-bluetooth.git Resolve bt off message not showing issue This Patch: - Resolves https://code.sec.samsung.net/jira/browse/TEIGHT-5167 Change-Id: I69870f9b4d1dc917874f04797b2230ea83882a83 Signed-off-by: Akash Kumar --- diff --git a/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs b/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs index b6e218b..7bb9a8d 100644 --- a/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs +++ b/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs @@ -320,6 +320,7 @@ namespace SettingBluetooth { static CollectionView mDeviceView = null; static DeviceSource mDeviceSource = null; + static View mBtOffMessage = null; private static CollectionView CreateCollectionView(DeviceSource source, bool isPairedDeviceView = false) { @@ -386,12 +387,41 @@ namespace SettingBluetooth { Log.Info(SettingBluetooth.LogTag, "Add device view"); + RemoveBTOffMessage(view); mDeviceSource = new DeviceSource(); mDeviceView = CreateCollectionView(mDeviceSource); view.Add(mDeviceView); BtModel.GetBondedDevices(); } + public static View CreateBTOffMessage() + { + TextLabel messageText = new TextLabel() + { + AccessibilityHidden = true, + ThemeChangeSensitive = true, + Text = Resources.IDS_BT_BODY_TURN_ON_BLUETOOTH_TO_SEE_A_LIST_OF_DEVICES_YOU_CAN_PAIR_WITH_OR_HAVE_ALREADY_PAIRED_WITH, + TextColor = new Color("#CACACA"), + PixelSize = 22.SpToPx(), + }; + + return messageText; + } + + internal static void AddBTOffMessage(View view) + { + mBtOffMessage = CreateBTOffMessage(); + view.Add(mBtOffMessage); + } + internal static void RemoveBTOffMessage(View view) + { + if (mBtOffMessage != null) + { + view.Remove(mBtOffMessage); + mBtOffMessage = null; + } + } + internal static void RemoveDeviceView(View view) { Log.Info(SettingBluetooth.LogTag, "Remove device view"); @@ -401,6 +431,7 @@ namespace SettingBluetooth view.Remove(mDeviceView); mDeviceView = null; } + AddBTOffMessage(view); } internal static void RemoveAllSearchedDevices() diff --git a/SettingBluetooth/SettingBluetooth/View/BtMainView.cs b/SettingBluetooth/SettingBluetooth/View/BtMainView.cs index 9130524..e22071b 100644 --- a/SettingBluetooth/SettingBluetooth/View/BtMainView.cs +++ b/SettingBluetooth/SettingBluetooth/View/BtMainView.cs @@ -93,6 +93,10 @@ namespace SettingBluetooth AdapterController.AutoStart(); } } + else + { + BtDeviceView.AddBTOffMessage(mMainView); + } return mMainView; } diff --git a/SettingBluetooth/SettingBluetooth/View/Resources.cs b/SettingBluetooth/SettingBluetooth/View/Resources.cs index a22fa8e..f2d96f2 100644 --- a/SettingBluetooth/SettingBluetooth/View/Resources.cs +++ b/SettingBluetooth/SettingBluetooth/View/Resources.cs @@ -38,5 +38,7 @@ namespace SettingBluetooth static public string IDS_BT_SK_DISCONNECT = "Disconnect"; static public string IDS_BT_HEADER_DISCONNECT_DEVICE_ABB = "Disconnect device"; static public string IDS_WMGR_POP_THIS_WILL_END_YOUR_CONNECTION_WITH_PS = "This will end your connection with {0}."; + static public string IDS_BT_BODY_TURN_ON_BLUETOOTH_TO_SEE_A_LIST_OF_DEVICES_YOU_CAN_PAIR_WITH_OR_HAVE_ALREADY_PAIRED_WITH + = "Turn on Bluetooth to see a list of devices you can pair with or have already paired with."; } } diff --git a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk index 4f812cc..b89c553 100644 Binary files a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk and b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk differ