From: hcj <1224667075@qq.com> Date: Sun, 1 Dec 2024 07:35:48 +0000 (+0800) Subject: Mp3增加传输提示 X-Git-Tag: fd230_release_V1.3.102~8 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=7a256994c2c05151a9e878a3eafd6d07cbae84b8;p=mirrors%2FFD230.git Mp3增加传输提示 --- diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h index 847b81495..4612663b8 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h @@ -34,9 +34,9 @@ extern "C" TRANS_DIAL_TRANSMITTING, TRANS_DIAL_SUCC, TRANS_DIAL_FAIL, - TRANS_DIAL_MAX_FAIL, + TRANS_OTA_TRANSMITTING, TRANS_OTA_SUCC, TRANS_OTA_FAIL, @@ -44,6 +44,10 @@ extern "C" TRANS_MP3_TRANSMITTING, TRANS_MP3_SUCC, TRANS_MP3_FAIL, + TRANS_MP3_MAX_FAIL, + + START_CAT1_OTA, + OTA_UPDATA_FAIL, diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c index 65b56fd69..506b47c43 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -7185,8 +7185,9 @@ errcode_t decode_mp3_json(ble_read_data *buffer_handle) // CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1); if(IS_free_save_Mp3(ota_size_json->valueint)==false) { - TRANSMIT_DATA=TRANS_MP3_FAIL; + TRANSMIT_DATA=TRANS_MP3_MAX_FAIL; CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1); + return ERRCODE_FAIL; } else diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp index f8ee4872b..ae2493aff 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp @@ -19,6 +19,7 @@ #include "PhoneService.h" #include "ConfigModelC.h" #include "ConfigModel.h" +#include "languagecode/LanguageInit.h" namespace OHOS { static UIImageView *imageCharge = nullptr; @@ -371,6 +372,61 @@ namespace OHOS UIViewGroup_transmitting->Add(transmitting_img); } + void Creat_CAT1_OTA_Updata() + { + if (Title == nullptr) { + Title = new UILabelExt(); + } + Title->SetPosition(83, 50); // widget's left position and top position + Title->Resize(300, 35); // widget's width and height + Title->SetViewId("label1");// Set style + Title->SetStyle(STYLE_TEXT_FONT, 30); + + // Set additional property + Title->SetText("CAT1 OTA upgradeing"); + Title->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); + Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + Title->SetRollSpeed(0); + Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, 30); + + UIViewGroup_transmitting->Add(Title); + + if (label_ == nullptr) { + label_ = new UILabelExt(); + } + label_->SetPosition(60, 281); // widget's left position and top position + label_->Resize(345, 101); // widget's width and height + label_->SetViewId("label2");// Set style + label_->SetStyle(STYLE_TEXT_FONT, 30); + + // Set additional property + char fail_str[128]={0}; + sprintf_s(fail_str,128,"Do not perform any operation during the upgrade to ensure sufficient power supply %c",' '); + + label_->SetText(fail_str); + label_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); + label_->SetTextColor(Color::GetColorFromRGBA(0xAA, 0xAA, 0xAA, 0xff)); + label_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label_->SetRollSpeed(0); + label_->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, 30); + + UIViewGroup_transmitting->Add(label_); + + //Add ImageView to App + + // if (transmitting_img == nullptr) + // { + // transmitting_img = new UIImageView(); + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemUpdateView::KUMILOGOImage new fail!"); + // } + // transmitting_img->SetPosition(193, 150,80, 80); + // const char *imagesPath = TRANSMITTING_FAIL_PATH; + // transmitting_img->SetSrc(imagesPath); + // UIViewGroup_transmitting->Add(transmitting_img); + } + + + void creat_down_OTA_FAIL() @@ -801,6 +857,78 @@ namespace OHOS + } + + void creat_down_max_MP3_fail() + { + if (Title == nullptr) { + Title = new UILabelExt(); + } + Title->SetPosition(173, 51); // widget's left position and top position + Title->Resize(800, 88); // widget's width and height + Title->SetViewId("label1");// Set style + Title->SetStyle(STYLE_TEXT_FONT, 30); + + // Set additional property + Title->SetTextId(STR_OPERAT_FAIL);//TODO:多国语言 + //Title->SetTextId (STR_DIAL_FAIL_TITLE); + Title->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + Title->SetRollSpeed(0); + Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + + // Add to rootView + UIViewGroup_transmitting->Add(Title); + Title->SetVisible(true); + + + if (label_ == nullptr) { + label_ = new UILabelExt(); + } + label_->SetPosition(60, 281); // widget's left position and top position + label_->Resize(345, 101); // widget's width and height + label_->SetViewId("label2");// Set style + label_->SetStyle(STYLE_TEXT_FONT, 30); + + // Set additional property + + // label_->SetTextId(STR_DIAL_NOTE);//TODO:多国语言 + // + // + if(ConfigModel::GetInstance()->GetLanguage() == ZH_CN) + label_->SetText("本地下载音乐已达到存储上限;请先删除部分歌曲再进行上传"); + else + label_->SetText( + "The storage capacity of locally downloaded music has reached the upper limit.\ + Please delete some songs before uploading"); + + + + + label_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); + label_->SetTextColor(Color::GetColorFromRGBA(0xAA, 0xAA, 0xAA, 0xff)); + label_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label_->SetRollSpeed(0); + label_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + + + + if (transmitting_img == nullptr) + { + transmitting_img = new UIImageView(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemUpdateView::KUMILOGOImage new fail!"); + } + transmitting_img->SetPosition(193, 150,80, 80); + const char *imagesPath = TRANSMITTING_FAIL_PATH; + transmitting_img->SetSrc(imagesPath); + UIViewGroup_transmitting->Add(transmitting_img); + + // Add to rootView + UIViewGroup_transmitting->Add(label_); + label_->SetVisible(true); + + + } void creat_down_Dial_fail() @@ -984,6 +1112,13 @@ namespace OHOS case OTA_UPDATA_FAIL: Creat_OTA_Updata_FAIL(); break; + case START_CAT1_OTA: + Creat_CAT1_OTA_Updata(); + break; + case TRANS_MP3_MAX_FAIL: + creat_down_max_MP3_fail(); + break; + default: break; @@ -1040,7 +1175,10 @@ namespace OHOS bool transmittingViewEventListener::OnClick(UIView& view, const ClickEvent& event) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnClick"); - if(Transmitting_falg!=TRANS_DIAL_TRANSMITTING && Transmitting_falg!=TRANS_OTA_TRANSMITTING && Transmitting_falg!=TRANS_MP3_TRANSMITTING) + if(Transmitting_falg!=TRANS_DIAL_TRANSMITTING + && Transmitting_falg!=TRANS_OTA_TRANSMITTING + && Transmitting_falg!=TRANS_MP3_TRANSMITTING + && Transmitting_falg!=START_CAT1_OTA) { NotificationManager::GetInstance()->StopNotify(); }