修复主界面切换表盘卡死
authorCaisking <3449750381@qq.com>
Sat, 27 Jul 2024 05:47:58 +0000 (13:47 +0800)
committerCaisking <3449750381@qq.com>
Sat, 27 Jul 2024 05:47:58 +0000 (13:47 +0800)
code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialView.cpp

index 3fd875e..81f72f9 100644 (file)
@@ -88,7 +88,9 @@ namespace OHOS
         std::vector<SetDialInfo> &dialInfo = presenter_->GetDialInfo();
         for (auto iter : dialInfo)
         {
-            bool succ = rollerView_.AddItem(iter.dialName.c_str(), iter.preImageInfo);
+            WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDialView::SetUpRollerView %s",
+                          iter.dialName.c_str());
+            bool succ = rollerView_.AddItem(iter.dialName, iter.preImageInfo);
             rollerItemNum_ += succ ? 1 : 0;
         }
         float scalerCoef = 0.55;
@@ -103,23 +105,10 @@ namespace OHOS
         label_.SetPosition(127, 50, 200, 50);
         label_.SetTextColor(Color::White());
         label_.SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
-
-        if (dialInfo[lastIndex_].dialFlag)
-        {
-            // 切换表盘[表盘名称设置{多国语言需要配置xml里面的表盘描述}]
-            label_.SetText(dialInfo[lastIndex_].description.c_str());
-            WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetText dialName %s",
-                          dialInfo[lastIndex_].description.c_str());
-        }
-        else
-        {
-            label_.SetText(dialInfo[lastIndex_].dialName.c_str());
-        }
-
+        label_.SetText(dialInfo[lastIndex_].dialName.c_str());
         label_.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
         container_->Add(&label_);
     }
-
     void SetDialView::OnSetUpView()
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDialView::OnSetUpView");