WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ble phone connect stat = %d", ble_connect_stat);
if (ble_connect_stat == 0) {
- //蓝牙未连接,跳转到查找手机Slice显示蓝牙未连接提示(隐藏「查找手机」标题)
+ //蓝牙未连接,跳转到查找手机页;标题显示「请连接手机」
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Bluetooth not connected, jump to find phone slice");
- FindPhoneModel::GetInstance().SetHideTitle(true);
+ FindPhoneModel::GetInstance().SetTitleConnectPhone(true);
OHOS::AbilityNavigation::EnterSlice(VIEW_FIND_PHONE);
return true;
}
}
//根据下载状态更新视图
switch (EphemerisDownloadModel::GetInstance().GetEphemerisDownloadStatus()) {
- case EphemerisDownloadStatus::DOWNLOADING:
- if (EphemerisDownloadView::GetInstance()) {
- if (EphemerisDownloadView::GetInstance()->GetDownloadLabel()) {
- //判断连接状态
- //连接成功
- //连接失败
- //显示下载进度等
- if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() == -1)
- {
- if(ConfigModel::GetInstance()->GetLanguage() == 0)
- EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText("优化失败");
- else
- EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText("Optimization Failed");
- }
- else if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() == 0)
- {
- if(ConfigModel::GetInstance()->GetLanguage() == 0)
- EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText("正在链接网络");
- else
- EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText("Connecting to Network");
- //设置下载按键
- EphemerisDownloadView::GetInstance()->UpdateDownloadButton();
- }
- else if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() > 0)
- {
- // 进度需要*10
- int progress = EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() * 10;
- if(progress > 100)
- {
- progress = 100;
- }
- std::string progress_str = "正在优化"+std::to_string(progress)+"%";
- EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText(progress_str.c_str());
- //设置下载按键
- EphemerisDownloadView::GetInstance()->UpdateDownloadButton();
- }
- else if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() == 10)
- {
- //更新有效期
- if(EphemerisDownloadView::GetInstance()->GetValidityPeriodLabel()) {
- EphemerisDownloadView::GetInstance()->GetValidityPeriodLabel()->SetText(
- EphemerisDownloadModel::GetInstance().GetEphemerisValidityPeriod().c_str());
- }
- }
- }
- }
- break;
+ // case EphemerisDownloadStatus::DOWNLOADING:
+ // if (EphemerisDownloadView::GetInstance()) {
+ // if (EphemerisDownloadView::GetInstance()->GetDownloadLabel()) {
+ // //判断连接状态
+ // //连接成功
+ // //连接失败
+ // //显示下载进度等
+ // if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() == -1)
+ // {
+ // if(ConfigModel::GetInstance()->GetLanguage() == 0)
+ // EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText("优化失败");
+ // else
+ // EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText("Optimization Failed");
+ // }
+ // else if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() == 0)
+ // {
+ // if(ConfigModel::GetInstance()->GetLanguage() == 0)
+ // EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText("正在链接网络");
+ // else
+ // EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText("Connecting to Network");
+ // //设置下载按键
+ // EphemerisDownloadView::GetInstance()->UpdateDownloadButton();
+ // }
+ // else if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() > 0)
+ // {
+ // // 进度需要*10
+ // int progress = EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() * 10;
+ // if(progress > 100)
+ // {
+ // progress = 100;
+ // }
+ // std::string progress_str = "正在优化"+std::to_string(progress)+"%";
+ // EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText(progress_str.c_str());
+ // //设置下载按键
+ // EphemerisDownloadView::GetInstance()->UpdateDownloadButton();
+ // }
+ // else if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() == 10)
+ // {
+ // //更新有效期
+ // if(EphemerisDownloadView::GetInstance()->GetValidityPeriodLabel()) {
+ // EphemerisDownloadView::GetInstance()->GetValidityPeriodLabel()->SetText(
+ // EphemerisDownloadModel::GetInstance().GetEphemerisValidityPeriod().c_str());
+ // }
+ // }
+ // }
+ // }
+ // break;
case EphemerisDownloadStatus::DOWNLOADED:
if (EphemerisDownloadView::GetInstance()) {
if (EphemerisDownloadView::GetInstance()->GetDownloadLabel()) {
void SetBlueToothConnectedState(bool state);
bool GetBlueToothConnectedState();
void start_or_stop_find_phone(uint8_t val);
- /* 从星历下载等场景跳转时隐藏「查找手机」标题 */
- void SetHideTitle(bool hide);
- bool GetHideTitle() const;
+ /* 从星历下载等场景跳转:标题显示「请连接手机」而非「查找手机」 */
+ void SetTitleConnectPhone(bool enable);
+ bool GetTitleConnectPhone() const;
private:
FindPhoneModel() {}
~FindPhoneModel() {}
const FindPhoneModel &operator=(const FindPhoneModel &) = delete;
bool isBlueToothConnected{false}; // 蓝牙是否连接
- bool hideTitle_{false}; // 是否隐藏标题
+ bool titleConnectPhone_{false}; // 标题是否显示「请连接手机」
};
}
#endif
\ No newline at end of file
#include "UiConfig.h"
#include "ui_resource_string.h"
#include "uicomponents/UIComponents.h"
+#include "ConfigModel.h"
#ifdef SUPPORT_BLE_SERVICE
#include "bleInstruct.h"
FindPhoneTitleLabel->SetPosition(83, 50, 300, 35);
FindPhoneTitleLabel->SetStyle(STYLE_TEXT_FONT, 30);
FindPhoneTitleLabel->SetStyle(STYLE_LINE_HEIGHT, 35);
- FindPhoneTitleLabel->SetTextId(STR_FIND_PHONE); // 查找手机
FindPhoneTitleLabel->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION);
FindPhoneTitleLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
FindPhoneTitleLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
- if (FindPhoneModel::GetInstance().GetHideTitle()) {
- FindPhoneTitleLabel->SetVisible(false);
+ if (FindPhoneModel::GetInstance().GetTitleConnectPhone()) {
+ if (ConfigModel::GetInstance()->GetLanguage() == 0) {
+ FindPhoneTitleLabel->SetText("请连接手机");
+ } else {
+ FindPhoneTitleLabel->SetText("Connect Phone");
+ }
+ } else {
+ FindPhoneTitleLabel->SetTextId(STR_FIND_PHONE); // 查找手机
}
/* ----------------------- FindPhoneImageView ---------------------- */
FindPhoneImageView = new UIImageView();