Resolve bt off message not showing issue 91/299091/2
authorAkash Kumar <akash1.kumar@samsung.com>
Tue, 19 Sep 2023 11:32:30 +0000 (17:02 +0530)
committerAkash Kumar <akash1.kumar@samsung.com>
Wed, 20 Sep 2023 05:16:48 +0000 (10:46 +0530)
This Patch:
 - Resolves https://code.sec.samsung.net/jira/browse/TEIGHT-5167

Change-Id: I69870f9b4d1dc917874f04797b2230ea83882a83
Signed-off-by: Akash Kumar <akash1.kumar@samsung.com>
SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs
SettingBluetooth/SettingBluetooth/View/BtMainView.cs
SettingBluetooth/SettingBluetooth/View/Resources.cs
packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk

index b6e218bd9fbaa1cb8132a52f2b184fd1361a2b80..7bb9a8d51c24266b508506bcc64945d3a4802789 100644 (file)
@@ -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()
index 91305243261244a041d550dc9c5e7afb4e19af38..e22071bb49390c5ba83d2a8af5de7cc5a1c5b648 100644 (file)
@@ -93,6 +93,10 @@ namespace SettingBluetooth
                     AdapterController.AutoStart();
                 }
             }
+            else
+            {
+                BtDeviceView.AddBTOffMessage(mMainView);
+            }
 
             return mMainView;
         }
index a22fa8ec1d1af23c508125e0a05c5ca666b159f5..f2d96f24466e43df0d031150564bc79360c8fe06 100644 (file)
@@ -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.";
     }
 }
index 4f812ccb725c28f99a9c78720e1c7437bf2acc57..b89c5530f9639b2fa3d050722929a845f043e58e 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