* @Author: luozheng 1732036298@qq.com
* @Date: 2024-04-17 15:26:49
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-22 16:29:35
+ * @LastEditTime: 2024-08-29 09:44:02
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/main/include/PullUpDownView.h
*/
void UpdatePhoneStatus(int status);
void UpdateEarPhoneStatus(int status);
void UpdateBlueToothStatus(int status);
+ void SetPhoneConnectedIsVisible(bool state);
private:
UIImageView *DropDownConnectedStatusImageViweInit(int16_t x, int16_t y, int16_t w, int16_t h);
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-26 18:14:24
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-23 16:42:23
+ * @LastEditTime: 2024-08-29 10:16:29
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp
*/
return SettingModel::GetInstance().GetBlueToothConnectStatus();
}
+ // 设置蓝牙连接状态是否显示
+ void PullUpDownView::SetPhoneConnectedIsVisible(bool state)
+ {
+ if (connectedStatusBackgroundButton && showPhoneConnectedStatus && showEarPhoneConnectedStatus && showBluetoothConnectedStatus)
+ {
+ if (!state)
+ {
+ connectedStatusBackgroundButton->SetPosition(153, 10, 160, 50);
+ int x = connectedStatusBackgroundButton->GetX();
+ int y = connectedStatusBackgroundButton->GetY();
+ showPhoneConnectedStatus->SetVisible(true);
+ showEarPhoneConnectedStatus->SetPosition(x + 68, y + 13);
+ showBluetoothConnectedStatus->SetPosition(x + 110, y + 13);
+ }
+ else
+ {
+ connectedStatusBackgroundButton->SetPosition(178, 10, 110, 50);
+ int x = connectedStatusBackgroundButton->GetX();
+ int y = connectedStatusBackgroundButton->GetY();
+ showPhoneConnectedStatus->SetVisible(false);
+ showEarPhoneConnectedStatus->SetPosition(x + 22, y + 13);
+ showBluetoothConnectedStatus->SetPosition(showEarPhoneConnectedStatus->GetX() + showEarPhoneConnectedStatus->GetWidth() + 18, y + 13);
+ }
+ connectedStatusBackgroundButton->Invalidate();
+ showPhoneConnectedStatus->Invalidate();
+ showEarPhoneConnectedStatus->Invalidate();
+ showBluetoothConnectedStatus->Invalidate();
+ }
+ }
+
// 更新手机连接状态
void PullUpDownView::UpdatePhoneStatus(int status)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showPhoneConnectedStatus nullptr");
return;
}
- showPhoneConnectedStatus->SetSrc(status ? DROPDOWN_PHONECONNECTED_IMAGE : DROPDOWN_PHONEDISCONNECTED_IMAGE);
- showPhoneConnectedStatus->Invalidate();
+ // showPhoneConnectedStatus->SetSrc(status ? DROPDOWN_PHONECONNECTED_IMAGE : DROPDOWN_PHONEDISCONNECTED_IMAGE);
+ // showPhoneConnectedStatus->Invalidate();
+
+ showPhoneConnectedStatus->SetSrc(DROPDOWN_PHONEDISCONNECTED_IMAGE);
+ SetPhoneConnectedIsVisible(status);
if (GetConnectedStatusView() != nullptr)
GetConnectedStatusView()->UpdatePhoneConnectedStatus(status);