-/***
+/***
* @Date: 2024-08-19 19:20:08
* @LastEditors: Caisking 3449750381@qq.com
* @LastEditTime: 2024-08-30 18:57:30
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-08-03 11:09:56
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-19 16:19:42
+ * @LastEditTime: 2024-08-31 15:11:11
* @FilePath: /xts_origin/FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceConnectingView.h
*/
int16_t width;
int16_t height;
ImageAnimatorInfo *imageInfoArray;
- const char *const *pathsArray;
+ const ImageInfo **pathsArray;
uint8_t numFrames;
int delay;
};
static AiVoiceConnectingView *GetInstance(void);
UIScrollView *CreateAiVoiceConnectingView(void);
UIScrollView *CreateAiVoiceConnectingView(uint8_t);
+
private:
UIImageAnimatorView *connectingImageAnimatorInit(ImageAnimatorConfig &imageanimatorconfig);
UILabelExt *AiVoiceConnectingViewLabelInit(LabelConfig &labelconfig);
UIButton *cancelButton{nullptr};
UIImageAnimatorView *connectingAnimatorView{nullptr};
ImageAnimatorInfo connectingImageInfo[AIVOICE_CONNECTING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES];
- const char **connectingPathsArray{nullptr};
+ const ImageInfo **connectingPathsArray{nullptr};
};
}
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-20 15:14:43
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-28 17:45:47
+ * @LastEditTime: 2024-08-31 16:14:37
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h
*/
#ifndef AI_VOICE_MODEL_H
static AiVoiceModel &GetInstance(void); // 获取单例实例
bool ChangeToReturnResultTextView(void);
bool ChangeToAIVoiceListeningView(bool value);
+ bool ChangeToAIVoiceConnectTimeoutView();
void FunctionKeyOnClickToChangeAIModel(void);
// 初始化和状态管理
bool CreateIfNotExists();
void SetAiVoiceConnectStatus(bool state);
void QuerySelectedAiModelIsConnect();
void CancelCurAIChat(void);
+ int GetAIResponseType(void);
+ std::string GetErrnote(void);
+ void SetCurView(int16_t viewNum);
+ int GetCurView(void);
// 聊天内容管理
bool InitchatContentItems(void);
std::map<int, std::pair<int, int>> selectAiModelToTextId; // pair的参数类型<模型的textid,查询模型是否可用id>
bool AiVoiceConnectStatus{false}; //与AI模型的连接状态
uint8_t AIResponseType;
+ std::string errnote; //错误信息
+ int16_t curView{0};
};
}
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-20 14:44:22
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-09 19:52:53
+ * @LastEditTime: 2024-08-31 16:13:42
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoicePresenter.h
*/
#ifndef AI_VOICE_PRESENTER_H
bool JumpToReturnResultTextView(void);
bool ChangeToAIVoiceListeningView(bool val);
+ bool ChangeToAIVoiceConnectTimeoutView();
bool ChangeViewAndLogicOperator(int16_t hideView, int16_t showView);
void FunctionKeyOnClickToChangeAIModel(void);
void DragLeftToRightChangeAIModel(void);
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-22 16:46:26
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-06-22 17:00:33
+ * @LastEditTime: 2024-08-31 16:14:01
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AivoiceConnectTimeoutView.h
*/
~AivoiceConnectTimeoutView();
static AivoiceConnectTimeoutView *GetInstance(void);
UIScrollView *CreateAivoiceConnectTimeoutView(void);
-
+ void UpdateTitleTextId(int textId);
+ void UpdateNoteText();
private:
void ClearAll(void);
UILabelExt *AivoiceConnectTimeoutLabelInit(LabelConfig &labelconfig);
UIScrollView *scrollView{nullptr};
UILabelExt *title{nullptr};
UIImageView *attentionImage{nullptr};
- UILabelExt *label[2]{nullptr};
+ UILabelExt *NoteLabel{nullptr};
UILabelExt *ensure{nullptr};
UIButton *ensureButton{nullptr};
};
-/***
+/***
* @Date: 2024-06-26 16:59:51
* @LastEditors: Caisking 3449750381@qq.com
* @LastEditTime: 2024-08-30 18:57:36
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-22 16:46:26
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-06-25 15:39:07
+ * @LastEditTime: 2024-08-31 14:56:06
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AivoiceListeningView.h
*/
int16_t y;
int16_t width;
int16_t height;
- ImageAnimatorInfo* imageInfoArray;
- const char* const* pathsArray;
+ ImageAnimatorInfo *imageInfoArray;
+ const ImageInfo **pathsArray;
uint8_t numFrames;
int delay;
};
UIButton *finishSpeakButton{nullptr};
UIImageAnimatorView *AiVoiceListeningImageAnimatorView{nullptr};
ImageAnimatorInfo AiVoiceListeningImageInfo[AIVOICE_LISTENING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES];
- const char **AiVoiceListeningPathsArray{nullptr};
+ const ImageInfo **AiVoiceListeningPathsArray{nullptr};
};
}
#endif
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-22 16:46:26
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-07-31 11:33:33
+ * @LastEditTime: 2024-08-31 15:08:52
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AivoiceThinkingView.h
*/
int16_t width;
int16_t height;
ImageAnimatorInfo *imageInfoArray;
- const char *const *pathsArray;
+ const ImageInfo **pathsArray;
uint8_t numFrames;
int delay;
};
UIButton *cancelThinkButton{nullptr};
UIImageAnimatorView *AiVoiceThinkingImageAnimatorView{nullptr};
ImageAnimatorInfo AiVoiceThinkingImageInfo[AIVOICE_THINKING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES];
- const char **AiVoiceThinkingPathsArray{nullptr};
+ const ImageInfo **AiVoiceThinkingPathsArray{nullptr};
};
}
#endif
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-08-03 11:10:08
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-19 16:41:43
+ * @LastEditTime: 2024-08-31 15:11:39
* @FilePath: /xts_origin/FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceConnectingView.cpp
*/
#include "aivoice/include/AiVoiceConnectingView.h"
connectingAnimatorView->Stop();
delete connectingAnimatorView;
connectingAnimatorView = nullptr;
- FreeImagePathsArray(connectingPathsArray, AIVOICE_CONNECTING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ FreeImageInfoArray(connectingPathsArray, AIVoiceListeningImagePaths, AIVOICE_CONNECTING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+
}
if (cancelLabel)
{
for (uint8_t i = 0; i < imageanimatorconfig.numFrames; i++)
{
- // imageanimatorconfig.imageInfoArray[i].imageInfo = ImageCacheManager::GetInstance().LoadSingleRes(imageanimatorconfig.pathsArray[i]);
- // imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_IMAGE_INFO;
- imageanimatorconfig.imageInfoArray[i].imagePath = (imageanimatorconfig.pathsArray[i]);
- imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_FILE_PATH;
+ imageanimatorconfig.imageInfoArray[i].imageInfo = (imageanimatorconfig.pathsArray[i]);
+ imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_IMAGE_INFO;
+ // imageanimatorconfig.imageInfoArray[i].imagePath = (imageanimatorconfig.pathsArray[i]);
+ // imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_FILE_PATH;
imageanimatorconfig.imageInfoArray[i].pos.x = imageanimatorconfig.x;
imageanimatorconfig.imageInfoArray[i].pos.y = imageanimatorconfig.y;
imageanimatorconfig.imageInfoArray[i].width = imageanimatorconfig.width;
bool AiVoiceConnectingView::CreateAivoiceConnectingImageAnimator(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceConnectingView::CreateAivoiceConnectingImageAnimator");
- connectingPathsArray = CreateImagePathsArray(AIVoiceListeningImagePaths, AIVOICE_CONNECTING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ connectingPathsArray = CreateImageInfoArray(AIVoiceListeningImagePaths, AIVOICE_CONNECTING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
if (connectingPathsArray == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceConnectingView::connectingPathsArray is nullptr!!");
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-20 15:14:50
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-28 17:46:07
+ * @LastEditTime: 2024-08-31 16:13:29
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp
*/
#include "aivoice/include/AiVoiceModel.h"
return instance;
}
+ // 跳转到返回结果界面
bool AiVoiceModel::ChangeToReturnResultTextView(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::ChangeToReturnResultTextView");
return true;
}
+ // 切换到AI回应错误界面
+ bool AiVoiceModel::ChangeToAIVoiceConnectTimeoutView()
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::ChangeToAIVoiceConnectTimeoutView");
+ AiVoicePresenter *Aipresenter_ = AiVoicePresenter::GetInstance();
+ if (Aipresenter_ == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::GetInstance() fail!!");
+ return false;
+ }
+ Aipresenter_->ChangeToAIVoiceConnectTimeoutView();
+ return true;
+ }
+
+ // 功能键切换模型
void AiVoiceModel::FunctionKeyOnClickToChangeAIModel(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::FunctionKeyOnClickToChangeAIModel");
}
}
- /*取消当前AI对话*/
+ /*取消当前AI对话*/
void AiVoiceModel::CancelCurAIChat(void)
{
cancel_AI_cur_chat();
}
+ int AiVoiceModel::GetAIResponseType(void)
+ {
+ return AIResponseType;
+ }
+
+ std::string AiVoiceModel::GetErrnote(void)
+ {
+ return errnote;
+ }
+
+ /*设置当前哪个子视图是可见的*/
+ void AiVoiceModel::SetCurView(int16_t viewNum)
+ {
+ curView = viewNum;
+ }
+
+ /*获取当前哪个子视图是可见的*/
+ int AiVoiceModel::GetCurView(void)
+ {
+ return curView;
+ }
+
/*列表数量*/
uint8_t AiVoiceModel::GetChatContentListCount(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::UpdateUserQuestionStr");
RemoveLastTwoItemsOrClear();
+ /* -------------------------------------------------------------------------- */
+ ScreenTurnOn(5 * 1000); // 有消息来就亮屏5秒
+ /* -------------------------------------------------------------------------- */
if (!AddUserQuestionToChatItems())
{
std::string AiVoiceModel::GetAiAnswerStr(void)
{
// aiAnswerStr = "春风化雨,时光荏苒。百年之内,生命如白驹过隙,转瞬即逝。唯有心存善念,用爱化解芥蒂,用智慧建构未来,才是人生的真正意义。让我们携手共进,用每一分时光去关爱他人,用每一滴汗水去创造奇迹,用每一个眼神去传递温暖。让这个世界因我们的存在而变得更加美好。生命短暂,但只要我们怀着虔诚的心,坚韧前行,我们就一定能在有限的时光里留下无限的可能。";
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GetAiAnswerStr:%s\n", aiAnswerStr.c_str());
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GetAiAnswerStr:%s", aiAnswerStr.c_str());
return aiAnswerStr;
}
void AiVoiceModel::SetAiAnswerStrStr(std::string str, uint8_t type)
{
- aiAnswerStr += str;
AIResponseType = type;
+ errnote = str;
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AIResponseType = %d,errnote = %s\n", AIResponseType, errnote.c_str());
+ if (AIResponseType == AiVoiceModel::AI_RECORDING_PARSING_ERROR || AIResponseType == AiVoiceModel::AI_RESPONSE_ERROR)
+ {
+ SendMsgToUIService(UI_AI_JUMP_TO_RESPONDERR_VIEW, 0, (void *)errnote.c_str(), errnote.length());
+ ScreenTurnOn(5 * 1000); // 有消息来就亮屏5秒
+ return;
+ }
+ aiAnswerStr += str;
SendMsgToUIService(UI_UPDATE_AI_ANSWER_STR, 0, nullptr, 0);
}
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AIVoice_TimerCallbackProc,AiModelConnectTimeout = %d", AiModelConnectTimeout);
AiModelConnectTimeout--;
- if (AiModelConnectTimeout < 0)
+ if (AiModelConnectTimeout < 0) // 模型连接失败有5秒超时
{
AiVoiceModel::GetInstance().AIVoice_StopTimer();
AiVoiceView *view_ = AiVoiceView::GetInstance();
if (Time == 30)
{
AiVoiceModel::GetInstance().CheckFileAndSendAIIsReady();
+ AiVoiceModel::GetInstance().AIVoice_StopTimer();
+ return;
}
if (Time < 0) // 如果思考时间超时30s,进入连接超时界面
{
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-20 15:11:17
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-28 17:46:50
+ * @LastEditTime: 2024-08-31 16:13:34
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp
*/
#include "AppViewIDs.h"
return true;
}
+ bool AiVoicePresenter::ChangeToAIVoiceConnectTimeoutView()
+ {
+ if ((view_->GetAiVoiceScrollView(AIVOICE_THINKING_VIEWID) != nullptr) &&
+ (view_->GetAiVoiceScrollView(AIVOICE_THINKING_VIEWID)->IsVisible()))
+ {
+ ChangeViewAndLogicOperator(AiVoiceModel::GetInstance().GetCurView(), AIVOICE_CONNECT_TIMEOUT_VIEWID);
+ AivoiceConnectTimeoutView *p_AivoiceConnectTimeoutView = AivoiceConnectTimeoutView::GetInstance();
+ if (p_AivoiceConnectTimeoutView)
+ {
+ p_AivoiceConnectTimeoutView->UpdateNoteText();
+ }
+ }
+ return true;
+ }
+
void AiVoicePresenter::FunctionKeyOnClickToChangeAIModel(void)
{
int index = model->GetSelectAiModel() + 1;
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-05-07 11:25:58
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-28 17:47:15
+ * @LastEditTime: 2024-08-31 14:32:02
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AiVoiceView.cpp
*/
#include "aivoice/include/AiVoicePresenter.h"
AiVoiceScrollView[showView]->SetVisible(true);
Draw();
DestroyTempView(hideView);
+ AiVoiceModel::GetInstance().SetCurView(showView);
return;
}
{
p_AivoiceMobileDataFailedStartView->UpdateTitleTextId(textId);
}
+ if (p_AivoiceConnectTimeoutView)
+ {
+ p_AivoiceConnectTimeoutView->UpdateTitleTextId(textId);
+ }
}
}
\ No newline at end of file
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-05-07 11:25:58
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-02 15:44:02
+ * @LastEditTime: 2024-08-31 16:13:53
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AivoiceConnectTimeoutView.cpp
*/
#include "aivoice/include/AiVoicePresenter.h"
#include "aivoice/include/AivoiceConnectTimeoutView.h"
+#include "aivoice/include/AiVoiceModel.h"
#include "wearable_log.h"
#include "ui_resource_string.h"
#include <UiConfig.h>
if (scrollView != nullptr)
{
scrollView->RemoveAll();
-
if (title != nullptr)
{
delete title;
title = nullptr;
}
-
if (attentionImage != nullptr)
{
delete attentionImage;
attentionImage = nullptr;
}
-
- for (int i = 0; i < 2; i++)
+ if (NoteLabel != nullptr)
{
- if (label[i] != nullptr)
- {
- delete label[i];
- label[i] = nullptr;
- }
+ delete NoteLabel;
+ NoteLabel = nullptr;
}
-
if (ensure != nullptr)
{
delete ensure;
ensure = nullptr;
}
-
if (ensureButton != nullptr)
{
delete ensureButton;
ensureButton = nullptr;
}
-
delete scrollView;
scrollView = nullptr;
}
label->SetStyle(STYLE_LINE_HEIGHT, labelconfig.lineHeigh);
label->SetTextId(labelconfig.textId);
label->SetLineBreakMode(labelconfig.lineBreakMode);
- label->SetRollSpeed(70);
label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelconfig.fontSize);
label->SetRollSpeed(LABEL_ROLL_SPEED);
.height = 35,
.fontSize = 30,
.lineHeigh = 35,
- .textId = STR_AI_INTELLIGENT_ASSISTANT,
+ .textId = AiVoiceModel::GetInstance().GetAiModelTextId(),
.lineBreakMode = UILabel::LINE_BREAK_OSCILLATION,
};
title = AivoiceConnectTimeoutLabelInit(labelconfig);
return false;
}
/* -------------------------------------------------------------------------- */
- labelconfig.left = 53;
- labelconfig.width = 360;
- int textId[] = {STR_CONNECT_TIMEOUT, STR_PLEASE_RESTART_CHAT};
- for (int i = 0; i < 2; i++)
+ NoteLabel = new UILabelExt();
+ if (NoteLabel == nullptr)
{
- labelconfig.top = 222 + i * labelconfig.height;
- labelconfig.textId = textId[i];
- label[i] = AivoiceConnectTimeoutLabelInit(labelconfig);
- if (label[i] == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AivoiceConnectTimeoutView::label[%d] is nullptr!", i);
- return false;
- }
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "NoteLabel is nullptr!");
+ return false;
}
+ NoteLabel->SetPosition(53, 222, 360, 70);
+ NoteLabel->SetStyle(STYLE_TEXT_FONT, 30);
+ NoteLabel->SetStyle(STYLE_LINE_HEIGHT, 35);
+ NoteLabel->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION);
+ NoteLabel->SetRollSpeed(70);
+ NoteLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ NoteLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
/* -------------------------------------------------------------------------- */
labelconfig = {
.left = 133,
}
scrollView->Add(title);
scrollView->Add(attentionImage);
- scrollView->Add(label[0]);
- scrollView->Add(label[1]);
+ scrollView->Add(NoteLabel);
scrollView->Add(ensureButton);
scrollView->Add(ensure);
}
return scrollView;
}
+ void AivoiceConnectTimeoutView::UpdateTitleTextId(int textId)
+ {
+ if (title)
+ {
+ title->SetTextId(textId);
+ title->ForceResetText();
+ }
+ }
+
+ // 更新错误信息内容
+ void AivoiceConnectTimeoutView::UpdateNoteText()
+ {
+ if (NoteLabel)
+ {
+ NoteLabel->SetText("");
+ std::string text = AiVoiceModel::GetInstance().GetErrnote();
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "text = %s", text.c_str());
+ NoteLabel->SetText(text.c_str());
+ NoteLabel->Invalidate();
+ }
+ }
}
\ No newline at end of file
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-05-07 11:25:58
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-02 15:44:32
+ * @LastEditTime: 2024-08-31 15:12:44
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AivoiceListeningView.cpp
*/
#include "aivoice/include/AiVoicePresenter.h"
delete AiVoiceListeningImageAnimatorView;
AiVoiceListeningImageAnimatorView = nullptr;
- FreeImagePathsArray(AiVoiceListeningPathsArray, AIVOICE_LISTENING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ FreeImageInfoArray(AiVoiceListeningPathsArray, AIVoiceListeningImagePaths, AIVOICE_LISTENING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
}
if (finishSpeak != nullptr)
for (uint8_t i = 0; i < imageanimatorconfig.numFrames; i++)
{
- // imageanimatorconfig.imageInfoArray[i].imageInfo = ImageCacheManager::GetInstance().LoadSingleRes(imageanimatorconfig.pathsArray[i]);
- imageanimatorconfig.imageInfoArray[i].imagePath = (imageanimatorconfig.pathsArray[i]);
- imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_FILE_PATH;
+ imageanimatorconfig.imageInfoArray[i].imageInfo = imageanimatorconfig.pathsArray[i];
+ // imageanimatorconfig.imageInfoArray[i].imagePath = (imageanimatorconfig.pathsArray[i]);
+ // imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_FILE_PATH;
+ imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_IMAGE_INFO;
imageanimatorconfig.imageInfoArray[i].pos.x = imageanimatorconfig.x;
imageanimatorconfig.imageInfoArray[i].pos.y = imageanimatorconfig.y;
imageanimatorconfig.imageInfoArray[i].width = imageanimatorconfig.width;
bool AivoiceListeningView::CreateAivoiceListeningImageAnimator(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AivoiceListeningView::CreateAivoiceListeningImageAnimator");
- AiVoiceListeningPathsArray = CreateImagePathsArray(AIVoiceListeningImagePaths, AIVOICE_LISTENING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ AiVoiceListeningPathsArray = CreateImageInfoArray(AIVoiceListeningImagePaths, AIVOICE_LISTENING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
if (AiVoiceListeningPathsArray == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AivoiceListeningView::AiVoiceListeningPathsArray is nullptr!!");
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-05-07 11:25:58
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-02 15:44:41
+ * @LastEditTime: 2024-08-31 15:09:13
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AivoiceThinkingView.cpp
*/
#include "aivoice/include/AiVoicePresenter.h"
delete AiVoiceThinkingImageAnimatorView;
AiVoiceThinkingImageAnimatorView = nullptr;
- FreeImagePathsArray(AiVoiceThinkingPathsArray, AIVOICE_THINKING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ // FreeImagePathsArray(AiVoiceThinkingPathsArray, AIVOICE_THINKING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ FreeImageInfoArray(AiVoiceThinkingPathsArray, AIVoiceThinkingImagePaths, AIVOICE_THINKING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
}
if (cancelThink != nullptr)
for (uint8_t i = 0; i < imageanimatorconfig.numFrames; i++)
{
- // imageanimatorconfig.imageInfoArray[i].imageInfo = ImageCacheManager::GetInstance().LoadSingleRes(imageanimatorconfig.pathsArray[i]);
- imageanimatorconfig.imageInfoArray[i].imagePath = (imageanimatorconfig.pathsArray[i]);
- imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_FILE_PATH;
+ imageanimatorconfig.imageInfoArray[i].imageInfo = (imageanimatorconfig.pathsArray[i]);
+ // imageanimatorconfig.imageInfoArray[i].imagePath = (imageanimatorconfig.pathsArray[i]);
+ // imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_FILE_PATH;
+ imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_IMAGE_INFO;
imageanimatorconfig.imageInfoArray[i].pos.x = imageanimatorconfig.x;
imageanimatorconfig.imageInfoArray[i].pos.y = imageanimatorconfig.y;
imageanimatorconfig.imageInfoArray[i].width = imageanimatorconfig.width;
bool AivoiceThinkingView::CreateAivoiceThinkingImageAnimator(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AivoiceThinkingView::CreateAivoiceThinkingImageAnimator");
- AiVoiceThinkingPathsArray = CreateImagePathsArray(AIVoiceThinkingImagePaths, AIVOICE_THINKING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ AiVoiceThinkingPathsArray = CreateImageInfoArray(AIVoiceThinkingImagePaths, AIVOICE_THINKING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
if (AiVoiceThinkingPathsArray == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AivoiceThinkingView::AiVoiceThinkingPathsArray is nullptr!!");
+/*
+ * @Author: luozheng 1732036298@qq.com
+ * @Date: 2024-08-31 09:52:34
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-08-31 16:38:04
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/findphone/include/FindPhoneView.h
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
#ifndef FIND_PHONE_VIEW_H
#define FIND_PHONE_VIEW_H
UIImageAnimatorView *FindPhoneImageAnimator = nullptr;
UILabelButtonExt *FindPhoneLabelButton = nullptr;
UIImageView *FindPhoneImageView{nullptr};
- const char **FindPhonePathsArray{nullptr};
+ const ImageInfo **FindPhonePathsArray{nullptr};
ImageAnimatorInfo FindPhoneImageInfo[FINDPHONE_IMAGE_ANIMATOR_VIEW_NUM_FRAMES];
bool viewInitStatus{false};
};
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-03-27 10:47:40
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-06-07 18:21:37
+ * @LastEditTime: 2024-08-31 16:43:28
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhonePresenter.cpp
*/
#include "AppViewIDs.h"
}
return true;
}
-
+
bool FindPhonePresenter::OnDragEnd(UIView &view, const DragEvent &event)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "FindPhonePresenter::OnDragEnd");
if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && FindPhonePresenter::X_DRAG_FLAG)
{
NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS);
+ // 发送指令停止震动
+ if (FindPhoneModel::GetInstance().GetBlueToothConnectedState())
+ {
+ senfindphoneSend(FINDPHONE_STOP);
+ }
FindPhonePresenter::X_DRAG_FLAG = false;
}
return true;
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-03-27 10:47:46
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-06-19 15:36:22
+ * @LastEditTime: 2024-08-31 16:40:57
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneView.cpp
*/
#include "findphone/include/FindPhoneView.h"
{
static FindPhoneView *g_pFindPhoneView{nullptr};
+ static constexpr const char *FIND_PONE_IMAGE_SRC = "/user/res/findphone/";
FindPhoneView::FindPhoneView()
{
FindPhoneImageAnimator->Stop();
delete FindPhoneImageAnimator;
FindPhoneImageAnimator = nullptr;
- FreeImagePathsArray(FindPhonePathsArray, FINDPHONE_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ // FreeImagePathsArray(FindPhonePathsArray, FINDPHONE_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ FreeImageInfoArray(FindPhonePathsArray, FIND_PONE_IMAGE_SRC, FINDPHONE_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
}
if (FindPhoneLabel != nullptr)
FindPhoneTitleLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
FindPhoneTitleLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
/* ----------------------- FindPhoneImageAnimator ---------------------- */
- FindPhonePathsArray = CreateImagePathsArray("/user/res/findphone/",FINDPHONE_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ FindPhonePathsArray = CreateImageInfoArray(FIND_PONE_IMAGE_SRC, FINDPHONE_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
if (FindPhoneImageAnimator == nullptr)
{
FindPhoneImageAnimator = new UIImageAnimatorView();
}
for (uint8_t i = 0; i < FINDPHONE_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; i++)
{
- FindPhoneImageInfo[i].imagePath = (FindPhonePathsArray[i]);
- FindPhoneImageInfo[i].imageType = IMG_SRC_FILE_PATH;
+ // FindPhoneImageInfo[i].imagePath = (FindPhonePathsArray[i]);
+ // FindPhoneImageInfo[i].imageType = IMG_SRC_FILE_PATH;
+ FindPhoneImageInfo[i].imageInfo = (FindPhonePathsArray[i]);
+ FindPhoneImageInfo[i].imageType = IMG_SRC_IMAGE_INFO;
FindPhoneImageInfo[i].pos.x = FINDPHONE_IMAGE_ANIMATOR_VIEW_X;
FindPhoneImageInfo[i].pos.y = FINDPHONE_IMAGE_ANIMATOR_VIEW_Y;
FindPhoneImageInfo[i].width = FINDPHONE_IMAGE_ANIMATOR_VIEW_W;
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-08-21 11:54:00
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-28 20:38:05
+ * @LastEditTime: 2024-08-31 11:05:12
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/main/src/dropdown/DropDownCardPage1.cpp
*/
#include "main/include/dropdown/DropDownCardPage1.h"
}
else
{
+#if defined(A5133_DEMO_CLIENT) || defined(A5133_DEMO_SERVER)
+ uapi_set4GCapability(true);
+#else
+ uapi_set4GCapability(false);
+#endif
state = toggleButton[DropDownCardPage1::toggleButton_4G]->GetState();
- Updat4GState(state);
- ConfigModel::GetInstance()->SetCat1_4Gability(state);
+ Updat4GState(uapi_cat1_get_power_stat());
+ ConfigModel::GetInstance()->SetCat1_4Gability(uapi_cat1_get_power_stat());
}
}
else if (viewId == DROPDOWN_ALIPAY_TOGGLEBUTTON_VIEWID) // 支付宝
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-12 11:44:04
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-29 18:44:06
+ * @LastEditTime: 2024-08-31 14:20:21
* @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/uiservice/include/ui_service.h
*/
/*
UI_AI_JUMP_TO_RESULT_VIEW, //跳转到返回结果视图
UI_AI_JUMP_TO_LISTENING_VIEW,//跳转到AI聆听界面
+ UI_AI_JUMP_TO_RESPONDERR_VIEW,//处理跳转AI回应错误界面
UI_UPDATE_USER_QUESTION_STR,//更新用户问题的字符串
UI_UPDATE_AI_ANSWER_STR, //更新AI答案的字符串
UI_HAND_WATCH_FIRST_PAIRED, //手表已配对:给第一次手表启动用配对成功调用
static void HandleUpdateMusicPlayerList(Request *request);
static void HandleAiJumpToResultView(Request *request);
static void HandleAiJumpToListeningMessage(Request *request);
+ static void HandleAiJumpToRespondErrMessage(Request *request);
static void HandleUpdateUserQuestionStr(Request *request);
static void HandleUpdateAIAnswerStr(Request *request);
static void HandleWatchFirstPaired(Request *request);
{UI_HAND_WATCH_FIRST_PAIRED, HandleWatchFirstPaired},
{UI_UPDATE_OBU_MESSAGE, HandleUpdateOBUMessage},
{UI_AI_JUMP_TO_LISTENING_VIEW, HandleAiJumpToListeningMessage},
+ {UI_AI_JUMP_TO_RESPONDERR_VIEW, HandleAiJumpToRespondErrMessage},
{UI_UPDATE_RECORDPROCESS, HandleUpdateRecordProcess},
{UI_UPDATE_PLAYERPROCESS, HandleUpdatePlayerProcess},
std::bind(&OHOS::AiVoiceModel::ChangeToAIVoiceListeningView, &OHOS::AiVoiceModel::GetInstance(), state));
}
+ // 处理更新查询AI模型是否连接成功的状态
+ void HandleAiJumpToRespondErrMessage(Request *request)
+ {
+ WEARABLE_LOGI(WEARABLE_LOG_MODULE_UI_SERVICE, "HandleAiJumpToRespondErrMessage");
+ GraphicService::GetInstance()->PostGraphicEvent(
+ std::bind(&OHOS::AiVoiceModel::ChangeToAIVoiceConnectTimeoutView, &OHOS::AiVoiceModel::GetInstance()));
+ }
+
//处理更新录音进度条
void HandleUpdateRecordProcess(Request *request)
{
UIImageAnimatorView *WindSpeedImageAnimatorView{nullptr}; // 风速动画\r
UIImageAnimatorView *HumidityImageAnimatorView{nullptr}; // 湿度动画\r
\r
- const char **UVPathsArray{nullptr};\r
- const char **WindSpeedPathsArray{nullptr};\r
- const char **HumidityPathsArray{nullptr};\r
+ const ImageInfo **UVPathsArray{nullptr};\r
+ const ImageInfo **WindSpeedPathsArray{nullptr};\r
+ const ImageInfo **HumidityPathsArray{nullptr};\r
bool viewInitStatus{false};\r
};\r
} // namespace OHOS\r
delete HumidityImageAnimatorView;\r
HumidityImageAnimatorView = nullptr;\r
\r
- FreeImagePathsArray(UVPathsArray, UV_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);\r
+ // FreeImagePathsArray(UVPathsArray, UV_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);\r
\r
- FreeImagePathsArray(WindSpeedPathsArray, WINDSPEED_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);\r
+ // FreeImagePathsArray(WindSpeedPathsArray, WINDSPEED_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);\r
\r
- FreeImagePathsArray(HumidityPathsArray, HUMIDITY_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);\r
+ // FreeImagePathsArray(HumidityPathsArray, HUMIDITY_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);\r
+\r
+ FreeImageInfoArray(UVPathsArray, UVPaths, UV_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);\r
+ FreeImageInfoArray(UVPathsArray, WindSpeedPaths, WINDSPEED_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);\r
+ FreeImageInfoArray(HumidityPathsArray, HumidityPaths, HUMIDITY_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);\r
}\r
}\r
\r
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WeatherReportView::WeatherReportViewImageAnimatorViewInit");\r
\r
/* ----------------------------- UVImageAnimatorView---------------------------- */\r
- UVPathsArray = CreateImagePathsArray(UVPaths, UV_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);\r
+ UVPathsArray = CreateImageInfoArray(UVPaths, UV_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);\r
if (UVImageAnimatorView == nullptr)\r
{\r
UVImageAnimatorView = new UIImageAnimatorView();\r
}\r
for (uint8_t i = 0; i < UV_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; i++)\r
{\r
- UVimageAnimatorInfo[i].imagePath = UVPathsArray[i];\r
- UVimageAnimatorInfo[i].imageType = IMG_SRC_FILE_PATH;\r
+ // UVimageAnimatorInfo[i].imagePath = UVPathsArray[i];\r
+ // UVimageAnimatorInfo[i].imageType = IMG_SRC_FILE_PATH;\r
+ UVimageAnimatorInfo[i].imageInfo = UVPathsArray[i];\r
+ UVimageAnimatorInfo[i].imageType = IMG_SRC_IMAGE_INFO;\r
UVimageAnimatorInfo[i].pos.x = UV_IMAGE_ANIMATOR_VIEW_X;\r
UVimageAnimatorInfo[i].pos.y = UV_IMAGE_ANIMATOR_VIEW_Y;\r
UVimageAnimatorInfo[i].width = UV_IMAGE_ANIMATOR_VIEW_W;\r
UVImageAnimatorView->Start();\r
}\r
/* ----------------------- WindSpeedImageAnimatorView ----------------------- */\r
- WindSpeedPathsArray = CreateImagePathsArray(WindSpeedPaths, WINDSPEED_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);\r
+ WindSpeedPathsArray = CreateImageInfoArray(WindSpeedPaths, WINDSPEED_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);\r
if (WindSpeedImageAnimatorView == nullptr)\r
{\r
WindSpeedImageAnimatorView = new UIImageAnimatorView();\r
}\r
for (uint8_t i = 0; i < WINDSPEED_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; i++)\r
{\r
- WindSpeedimageAnimatorInfo[i].imagePath = WindSpeedPathsArray[i];\r
- WindSpeedimageAnimatorInfo[i].imageType = IMG_SRC_FILE_PATH;\r
+ // WindSpeedimageAnimatorInfo[i].imagePath = WindSpeedPathsArray[i];\r
+ // WindSpeedimageAnimatorInfo[i].imageType = IMG_SRC_FILE_PATH;\r
+ WindSpeedimageAnimatorInfo[i].imageInfo = WindSpeedPathsArray[i];\r
+ WindSpeedimageAnimatorInfo[i].imageType = IMG_SRC_IMAGE_INFO;\r
WindSpeedimageAnimatorInfo[i].pos.x = WINDSPEED_IMAGE_ANIMATOR_VIEW_X;\r
WindSpeedimageAnimatorInfo[i].pos.y = UV_IMAGE_ANIMATOR_VIEW_Y;\r
WindSpeedimageAnimatorInfo[i].width = UV_IMAGE_ANIMATOR_VIEW_W;\r
WindSpeedImageAnimatorView->Start();\r
}\r
/* ------------------------ HumidityImageAnimatorView ----------------------- */\r
- HumidityPathsArray = CreateImagePathsArray(HumidityPaths, HUMIDITY_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);\r
+ HumidityPathsArray = CreateImageInfoArray(HumidityPaths, HUMIDITY_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);\r
if (HumidityImageAnimatorView == nullptr)\r
{\r
HumidityImageAnimatorView = new UIImageAnimatorView();\r
}\r
for (uint8_t i = 0; i < HUMIDITY_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; i++)\r
{\r
- HumidityimageAnimatorInfo[i].imagePath = HumidityPathsArray[i];\r
- HumidityimageAnimatorInfo[i].imageType = IMG_SRC_FILE_PATH;\r
+ // HumidityimageAnimatorInfo[i].imagePath = HumidityPathsArray[i];\r
+ // HumidityimageAnimatorInfo[i].imageType = IMG_SRC_FILE_PATH;\r
+ HumidityimageAnimatorInfo[i].imageInfo = HumidityPathsArray[i];\r
+ HumidityimageAnimatorInfo[i].imageType = IMG_SRC_IMAGE_INFO;\r
HumidityimageAnimatorInfo[i].pos.x = HUMIDITY_IMAGE_ANIMATOR_VIEW_X;\r
HumidityimageAnimatorInfo[i].pos.y = UV_IMAGE_ANIMATOR_VIEW_Y;\r
HumidityimageAnimatorInfo[i].width = UV_IMAGE_ANIMATOR_VIEW_W;\r
/*
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-03-22 10:04:36
- * @LastEditors: SnickerSun snickersun@163.com
- * @LastEditTime: 2024-08-02 19:27:15
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-08-31 16:49:39
* @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/src/notify/pairing_notification.cpp
*/
#include "notification_manager.h"
static constexpr int UNBIND_IMAGE_ANIMATOR_VIEW_H = 80;
static constexpr int UNBIND_IMAGE_ANIMATOR_VIEW_TIMEOFUPDATE = 100;
static constexpr int UNBIND_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 25; // 解绑动画帧数
- const char **UnBindPathsArray{nullptr};
+ const ImageInfo **UnBindPathsArray{nullptr};
ImageAnimatorInfo UnBindImageInfo[UNBIND_IMAGE_ANIMATOR_VIEW_NUM_FRAMES];
UIViewGroup *DeviceUnbindingRequestGroupView{nullptr};
DeviceUnBindingView->SetDraggable(true);
DeviceUnBindingView->SetTouchable(true);
/* ----------------------- DeviceUnBindingAnimatorView ---------------------- */
- UnBindPathsArray = CreateImagePathsArray("/user/res/remind/unbind/", UNBIND_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ UnBindPathsArray = CreateImageInfoArray("/user/res/remind/unbind/", UNBIND_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
if (DeviceUnBindingAnimatorView == nullptr)
{
DeviceUnBindingAnimatorView = new UIImageAnimatorView();
}
for (uint8_t i = 0; i < UNBIND_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; i++)
{
- UnBindImageInfo[i].imagePath = (UnBindPathsArray[i]);
- UnBindImageInfo[i].imageType = IMG_SRC_FILE_PATH;
+ UnBindImageInfo[i].imageInfo = (UnBindPathsArray[i]);
+ UnBindImageInfo[i].imageType = IMG_SRC_IMAGE_INFO;
UnBindImageInfo[i].pos.x = UNBIND_IMAGE_ANIMATOR_VIEW_X;
UnBindImageInfo[i].pos.y = UNBIND_IMAGE_ANIMATOR_VIEW_Y;
UnBindImageInfo[i].width = UNBIND_IMAGE_ANIMATOR_VIEW_W;
delete DeviceUnBindingViewTitleLabel;
DeviceUnBindingViewTitleLabel = nullptr;
- FreeImagePathsArray(UnBindPathsArray, UNBIND_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ FreeImageInfoArray(UnBindPathsArray, "/user/res/remind/unbind/", UNBIND_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
DeviceUnBindingAnimatorView->Stop();
delete DeviceUnBindingAnimatorView;
#include "custom_utils.h"
#include "components/ui_image_animator.h"
#include "wearable_log.h"
+#include "uicomponents/UIComponents.h"
#ifdef __cplusplus
extern "C" {
static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_Y = 0;
static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_W = 466;
static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_H = 466;
-const char **ReBootPathsArray{nullptr}; // 开机图片路径数组
+const OHOS::ImageInfo **ReBootPathsArray{nullptr}; // 开机图片路径数组
static OHOS::UIImageAnimatorView::AnimatorStopListener *bootStoplistener{nullptr};
static bool boot_animation_flag = false;
static app_task_definition_t taskcfg={0};
bootStoplistener = nullptr;
}
- FreeImagePathsArray(ReBootPathsArray, REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ // FreeImagePathsArray(ReBootPathsArray, REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ OHOS::FreeImageInfoArray(ReBootPathsArray, ReBootPaths, REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
delete group;
group = nullptr;
bool ShowReBootAnimatorView()
{
- ReBootPathsArray = CreateImagePathsArray(ReBootPaths, "bin", REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ ReBootPathsArray = OHOS::CreateImageInfoArray(ReBootPaths, REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
if (ReBootImageAnimatorView == nullptr)
{
}
for (uint8_t i = 0; i < REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; i++)
{
- ReBootImageInfo[i].imagePath = (ReBootPathsArray[i]);
- ReBootImageInfo[i].imageType = OHOS::IMG_SRC_FILE_PATH;
+ ReBootImageInfo[i].imageInfo = (ReBootPathsArray[i]);
+ ReBootImageInfo[i].imageType = OHOS::IMG_SRC_IMAGE_INFO;
ReBootImageInfo[i].pos.x = REBOOT_IMAGE_ANIMATOR_VIEW_X;
ReBootImageInfo[i].pos.y = REBOOT_IMAGE_ANIMATOR_VIEW_Y;
ReBootImageInfo[i].width = REBOOT_IMAGE_ANIMATOR_VIEW_W;