#include "wearable_log.h"
#include "ui_resource_string.h"
#include "ConfigModel.h"
+#include "findphone/include/FindPhoneModel.h"
#ifdef SUPPORT_BLE_SERVICE
#include "bleEvent.h"
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ble phone connect stat = %d", ble_connect_stat);
if (ble_connect_stat == 0) {
- //蓝牙未连接,跳转到查找手机Slice显示蓝牙未连接提示
+ //蓝牙未连接,跳转到查找手机Slice显示蓝牙未连接提示(隐藏「查找手机」标题)
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Bluetooth not connected, jump to find phone slice");
+ FindPhoneModel::GetInstance().SetHideTitle(true);
OHOS::AbilityNavigation::EnterSlice(VIEW_FIND_PHONE);
return true;
}
void SetBlueToothConnectedState(bool state);
bool GetBlueToothConnectedState();
void start_or_stop_find_phone(uint8_t val);
+ /* 从星历下载等场景跳转时隐藏「查找手机」标题 */
+ void SetHideTitle(bool hide);
+ bool GetHideTitle() const;
private:
FindPhoneModel() {}
~FindPhoneModel() {}
const FindPhoneModel &operator=(const FindPhoneModel &) = delete;
bool isBlueToothConnected{false}; // 蓝牙是否连接
+ bool hideTitle_{false}; // 是否隐藏标题
};
}
#endif
\ No newline at end of file
return false;
}
+ void FindPhoneModel::SetHideTitle(bool hide)
+ {
+ hideTitle_ = hide;
+ }
+
+ bool FindPhoneModel::GetHideTitle() const
+ {
+ return hideTitle_;
+ }
+
// 开始或停止查找手机
void FindPhoneModel::start_or_stop_find_phone(uint8_t val)
{
void FindPhonePresenter::OnStop(void)
{
+ FindPhoneModel::GetInstance().SetHideTitle(false);
#ifdef SUPPORT_BLE_SERVICE
FindPhoneModel::GetInstance().start_or_stop_find_phone(FINDPHONE_STOP); // 发送指令停止震动
if (FindPhoneModel::GetInstance().GetBlueToothConnectedState() &&
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);
+ }
/* ----------------------- FindPhoneImageView ---------------------- */
FindPhoneImageView = new UIImageView();
if (FindPhoneImageView == nullptr)