From: xue <2144439972@qq.com> Date: Wed, 22 Oct 2025 01:44:44 +0000 (+0800) Subject: 增加特殊发型的映射 X-Git-Tag: V1.0.9_20251128_194606_LN~186 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=6cb999cf80ea1ab5604d326d7b4b4a1700c23c6d;p=mirrors%2FFD230.git 增加特殊发型的映射 --- diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdAdjustView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdAdjustView.cpp index ce4f6aeee..421442e92 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdAdjustView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdAdjustView.cpp @@ -248,6 +248,28 @@ namespace OHOS if (TextLabel) { TextLabel->SetText(text); } } } + void ThunderBirdAdjustView::ShowUnbindWarning() + { + if (TextLabel) + { + TextLabel->SetPosition(0, 148, 360, 42); + TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + TextLabel->SetText("设备已解绑"); + TextLabel->SetVisible(true); + } + if (RemindLabel) + { + RemindLabel->SetPosition(0, 230, 360, 28); + RemindLabel->SetText("等待设备重启"); + RemindLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 25); + RemindLabel->SetVisible(true); + } + if (RemindIcon) { RemindIcon->SetVisible(false);} + if (RemindIcon2) { RemindIcon2->SetVisible(false);} + if (RemindIcon3) { RemindIcon3->SetVisible(false);} + + } } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp index c5c645990..91ab067c1 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp @@ -222,7 +222,7 @@ namespace OHOS ThunderBirdMainView::GetInstance()->OpenBackGround(); if (TextLabel) { - TextLabel->SetPosition(60, 64, 250, 84); + TextLabel->SetPosition(60, 68, 250, 84); TextLabel->SetText("换角色、挑声音、\n哄睡...扫码尽享!"); TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);//自动换行 TextLabel->SetVisible(true); @@ -271,6 +271,14 @@ namespace OHOS qrcode_->Invalidate();//刷新 } } + + void ThunderBirdGuideView::UpdateTextLabel(const char* text) + { + if (TextLabel) + { + TextLabel->SetText(text); + } + } } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp index 2949e9bd2..9bb5d20bd 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp @@ -1210,7 +1210,14 @@ cJSON *hairColor = cJSON_GetObjectItem(characterAvatar, "hairColor"); if (hairColor && cJSON_IsString(hairColor)) { - hairColor_ = std::string(hairColor->valuestring); + if(strcmp(hairColor->valuestring, "warm-orange") == 0)//特殊颜色映射 + { + hairColor_ = "orange"; + } + else//正常颜色映射 + { + hairColor_ = std::string(hairColor->valuestring); + } WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::ParseCharacterConfigData: hairColor = %s", hairColor_.c_str()); } @@ -1497,8 +1504,15 @@ // 检查是否是警告界面,需要返回原任务 else if (currentView == THUNDERBIRD_ADJUSTVIEW && currentSubView == ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_WARNING) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "警告界面超时,返回原任务"); - view->GoBackToPreviousView(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "警告界面超时,检查是否为解绑警告"); + // 检查是否为解绑警告,如果是则恢复出厂设置 + if (bind_status == true) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "解绑警告界面超时,恢复出厂设置"); + restore_factory_settings(); + } else { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "普通警告界面超时,返回原任务"); + view->GoBackToPreviousView(); + } } // 检查是否是任务提醒界面,需要返回原任务 else if (currentView == THUNDERBIRD_REMINDERVIEW && @@ -2137,11 +2151,18 @@ // 检查屏幕状态,如果息屏则自动亮屏 uapi_set_screen_on_api(); // 亮屏 + // 处理特殊颜色映射 + std::string mappedHairColor = hairColor; + if(mappedHairColor == "warm-orange")//特殊颜色映射 + { + mappedHairColor = "orange"; + } + // 构建发型文件路径:/user/res/hair/{hairShape}/{hairColor}.bin std::string hairPath = "/user/res/hair/"; hairPath += hairShape; hairPath += "/"; - hairPath += hairColor; + hairPath += mappedHairColor; hairPath += ".bin"; WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::SwitchHair: switching to %s", hairPath.c_str()); @@ -2210,8 +2231,15 @@ { if(bind_status == true) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "恢复出厂"); - restore_factory_settings(); + //增加设备解绑提示 + int currentView = ThunderBirdMainView::GetInstance()->GetCurrentView(); //获取当前视图 + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleBindAndUnbind: 设备已解绑,显示解绑警告"); + ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_ADJUSTVIEW, ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_WARNING); + if(ThunderBirdAdjustView::GetInstance()) + { + ThunderBirdAdjustView::GetInstance()->ShowUnbindWarning(); + } + ThunderBirdModel::GetInstance()->StartCountUpTimer(1); // 2秒后恢复出厂设置 return; } }