星历未下载时,跳转查找手机slice,不显示标题
authorxue <2144439972@qq.com>
Mon, 25 May 2026 11:45:02 +0000 (19:45 +0800)
committerxue <2144439972@qq.com>
Mon, 25 May 2026 11:45:02 +0000 (19:45 +0800)
code/sdk/application/wearable/fd272/nativeapp/nativeui/ephemeris_download/src/EphemerisDownloadPresenter.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/findphone/include/FindPhoneModel.h
code/sdk/application/wearable/fd272/nativeapp/nativeui/findphone/src/FindPhoneModel.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/findphone/src/FindPhonePresenter.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/findphone/src/FindPhoneView.cpp

index 06e8842..63081d9 100644 (file)
@@ -15,6 +15,7 @@
 #include "wearable_log.h"
 #include "ui_resource_string.h"
 #include "ConfigModel.h"
+#include "findphone/include/FindPhoneModel.h"
 
 #ifdef SUPPORT_BLE_SERVICE
 #include "bleEvent.h"
@@ -120,8 +121,9 @@ bool EphemerisDownloadPresenter::OnClick(UIView &view,
     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;
     }
index 92cffcc..b9dcf17 100644 (file)
@@ -18,6 +18,9 @@ namespace OHOS
         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() {}
@@ -25,6 +28,7 @@ namespace OHOS
         const FindPhoneModel &operator=(const FindPhoneModel &) = delete;
 
         bool isBlueToothConnected{false}; // 蓝牙是否连接
+        bool hideTitle_{false};           // 是否隐藏标题
     };
 }
 #endif
\ No newline at end of file
index cf1dd93..4760c2a 100644 (file)
@@ -41,6 +41,16 @@ namespace OHOS
             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)
     {
index 2948515..3570571 100644 (file)
@@ -76,6 +76,7 @@ namespace OHOS
 
     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() &&
index 0eff9a4..7d77916 100644 (file)
@@ -118,6 +118,9 @@ namespace OHOS
             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)