回退音乐来源界面代码修改
authorluozheng <1732036298@qq.com>
Sat, 5 Oct 2024 10:20:54 +0000 (18:20 +0800)
committerluozheng <1732036298@qq.com>
Sat, 5 Oct 2024 10:20:54 +0000 (18:20 +0800)
code/sdk/application/wearable/fd230app/nativeui/player/src/MusicPlayerSourceView.cpp

index 0b59579..2f67c8d 100644 (file)
@@ -512,7 +512,15 @@ namespace OHOS
         if (bluetoothHeadsetConnectState)\r
         {\r
             bool state = SettingModel::GetInstance().GetEarPhoneConnectStatus();\r
-            bluetoothHeadsetConnectState->SetTextId(state ? STR_CONNECTED : STR_DISCONNECTED);\r
+            List<BluetoothCaseInfo> &bluetoothCaseList = BluetoothModel::GetInstance()->GetConnedDevicesCase();\r
+            if (bluetoothCaseList.IsEmpty()) // 如果已连接设备列表为空,则显示未配对\r
+            {\r
+                bluetoothHeadsetConnectState->SetTextId(STR_NOT_PAIRED);\r
+            }\r
+            else // 否则则显示连接状态\r
+            {\r
+                bluetoothHeadsetConnectState->SetTextId(state ? STR_CONNECTED : STR_DISCONNECTED);\r
+            }\r
             bluetoothHeadsetConnectState->SetTextColor(state ? Color::GetColorFromRGBA(0x4f, 0xc3, 0x4c, 0xff) : Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x7f));\r
             bluetoothHeadsetConnectState->Invalidate();\r
         }\r