${CMAKE_CURRENT_SOURCE_DIR}/nativeui/respiratorytraining/src/RespiratoryTrainingCompletedView.cpp
${CMAKE_CURRENT_SOURCE_DIR}/nativeui/respiratorytraining/src/RespiratoryTrainingModel.cpp
- #呼吸训练
+ #显示方式
${CMAKE_CURRENT_SOURCE_DIR}/nativeui/themestyle/src/ThemeStyleModel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/nativeui/themestyle/src/ThemeStylePresenter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/nativeui/themestyle/src/ThemeStyleView.cpp
+ #Ai Voice
+ ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/aivoice/src/AiVoiceModel.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/aivoice/src/AiVoicePresenter.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/aivoice/src/AiVoiceView.cpp
+
#声音与震动
${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/SoundAndVibrationView.cpp
VIEW_WATCH_QR_CODE, // 手表二维码
VIEW_RESPIRATORY_TRAINING, // 呼吸训练
VIEW_THEME_STYLE, // 主题样式
+ VIEW_AI_VOICE, // AI Voice(人工智能语音)
/* ----------------------------------- 录音 ----------------------------------- */
VIEW_RECORD,
void InitWatchQRCodeSlice(void);
void InitRespiratoryTrainingSlice(void);
void InitThemeStyleSlice(void);
+ void InitAiVoiceSlice(void);
/* --------------------------------界面------------------------------------ */
void InitRotateSlice(void);
void InitBloodSlice(void);
static constexpr const char *PNG_APPLIST_BREATHE_IMAGE = APP_LIST_PATH "/breathe.bin"; // 呼吸训练
static constexpr const char *PNG_APPLIST_GOAL_IMAGE = APP_LIST_PATH "/sport.bin"; // 每日目标
static constexpr const char *PNG_APPLIST_VOICE_IMAGE = APP_LIST_PATH "/voice.bin"; // 声音
+ static constexpr const char *PNG_APPLIST_AIVOICE_IMAGE = APP_LIST_PATH "/aivoice.bin"; // AI Voice(人工智能语音)
/* ---------------------------------- 快速训练 ---------------------------------- */
static constexpr const char *PNG_TRAING_BOUTTONMORE_IMAGE = APP_RES_PATH "/Training/More.bin";
#include "themestyle/include/ThemeStyleView.h"
#include "themestyle/include/ThemeStylePresenter.h"
+
+#include "aivoice/include/AiVoicePresenter.h"
+#include "aivoice/include/AiVoiceView.h"
/* -------------------------------------------------------------------------- */
#include "traing/include/TraingView.h"
#include "traing/include/TraingPresenter.h"
{VIEW_WATCH_QR_CODE, &NativeLauncher::InitWatchQRCodeSlice}, // 手表二维码界面
{VIEW_RESPIRATORY_TRAINING, &NativeLauncher::InitRespiratoryTrainingSlice}, // 呼吸训练界面
{VIEW_THEME_STYLE, &NativeLauncher::InitThemeStyleSlice}, // 主题样式界面
+ {VIEW_AI_VOICE, &NativeLauncher::InitAiVoiceSlice}, // Ai Voice(人工智能语音)
// {VIEW_SECONDARY_FUNCTION, &NativeLauncher::InitSecondaryFunction},
// {VIEW_FAST_TRAINING, &NativeLauncher::InitFastTrainingSlice},
}
NativeAbility::GetInstance().AddSliceProxy(VIEW_THEME_STYLE, ThemeStyle);
}
+
+ /*Ai Voice(人工智能语音)*/
+ void NativeLauncher::InitAiVoiceSlice(void)
+ {
+ SliceProxy *AiVoice = new AbilitySliceProxy<AiVoiceView, AiVoicePresenter>;
+ if (AiVoice == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoice");
+ return;
+ }
+ NativeAbility::GetInstance().AddSliceProxy(VIEW_AI_VOICE, AiVoice);
+ }
/* -------------------------------------------------------------------------- */
void NativeLauncher::InitSetDesktopSlice(void)
{
--- /dev/null
+/*
+ * @Author: luozheng 1732036298@qq.com
+ * @Date: 2024-06-20 15:14:43
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-06-20 20:13:47
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h
+ */
+#ifndef AI_VOICE_MODEL_H
+#define AI_VOICE_MODEL_H
+
+namespace OHOS
+{
+ class AiVoiceModel
+ {
+ public:
+ static AiVoiceModel &GetInstance(void);
+
+ private:
+ AiVoiceModel();
+ ~AiVoiceModel();
+ AiVoiceModel(const AiVoiceModel &) = delete;
+ AiVoiceModel &operator=(const AiVoiceModel &) = delete;
+ };
+}
+
+#endif
\ No newline at end of file
--- /dev/null
+/*
+ * @Author: luozheng 1732036298@qq.com
+ * @Date: 2024-06-20 14:44:22
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-06-20 15:25:08
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoicePresenter.h
+ */
+#ifndef AI_VOICE_PRESENTER_H
+#define AI_VOICE_PRESENTER_H
+
+#include "Presenter.h"
+#include "View.h"
+
+namespace OHOS
+{
+ class AiVoiceView;
+ class AiVoiceModel;
+ class AiVoicePresenter : public Presenter<AiVoiceView>,
+ public UIView::OnClickListener,
+ public UIView::OnDragListener,
+ public RootView::OnKeyActListener
+ {
+ public:
+ AiVoicePresenter();
+ virtual ~AiVoicePresenter();
+ static AiVoicePresenter *GetInstance();
+
+ void OnStart() override;
+ void OnPause() override;
+ void OnResume() override;
+ void OnStop() override;
+
+
+ private:
+ bool OnClick(UIView &view, const ClickEvent &event) override;
+ bool OnDrag(UIView &view, const DragEvent &event) override;
+ bool OnDragEnd(UIView &view, const DragEvent &event) override;
+ bool OnKeyAct(UIView &view, const KeyEvent &event) override; // 增加按键事件
+
+ AiVoiceModel *model;
+ bool X_DRAG_FLAG{false};
+ };
+}
+
+#endif
\ No newline at end of file
--- /dev/null
+/*
+ * @Author: luozheng 1732036298@qq.com
+ * @Date: 2024-06-08 09:36:01
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-06-20 19:53:13
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/respiratorytraining/include/AiVoiceView.h
+ */
+#ifndef AI_VOICE_VIEW_H
+#define AI_VOICE_VIEW_H
+
+#include "BaseView.h"
+#include "View.h"
+#include "components/ui_label_ext.h"
+#include "components/ui_button.h"
+
+namespace OHOS
+{
+ class AiVoicePresenter;
+ class AiVoiceView : public View<AiVoicePresenter>
+ {
+
+ public:
+ struct LabelConfig
+ {
+ int16_t left;
+ int16_t top;
+ int16_t width;
+ int16_t height;
+ int16_t fontSize;
+ int16_t lineHeigh;
+ uint16_t textId;
+ uint8_t lineBreakMode;
+ };
+
+ struct ButtonConfig
+ {
+ int16_t x;
+ int16_t y;
+ int16_t w;
+ int16_t h;
+ const char *ViewId;
+ };
+
+ AiVoiceView();
+ ~AiVoiceView();
+ static AiVoiceView *GetInstance(void);
+
+ void OnStart() override;
+ void OnSetUpView() override;
+ void OnTearDownView() override;
+ void OnStop() override;
+
+ private:
+ UILabelExt *AiVoiceViewLabelInit(LabelConfig &labelconfig);
+ UIButton *AiVoiceViewLabelButtonInit(ButtonConfig &buttonconfig);
+ bool CreateAiVoiceViewLabel(void);
+ bool CreateAiVoiceViewButton(void);
+ void CreateAiVoiceView(void);
+ void ClearAll(void);
+ UILabelExt *title{nullptr};
+ UILabelExt *startChatLabel{nullptr};
+ UIButton *startChatButton{nullptr};
+
+ bool viewInitStatus{false};
+ };
+}
+#endif
\ No newline at end of file
--- /dev/null
+/*
+ * @Author: luozheng 1732036298@qq.com
+ * @Date: 2024-06-20 15:14:50
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-06-20 15:25:15
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp
+ */
+#include "aivoice/include/AiVoiceModel.h"
+#include "wearable_log.h"
+
+namespace OHOS
+{
+ AiVoiceModel::AiVoiceModel() {}
+
+ AiVoiceModel::~AiVoiceModel() {}
+
+ AiVoiceModel &AiVoiceModel::GetInstance()
+ {
+ static AiVoiceModel instance;
+ return instance;
+ }
+
+}
--- /dev/null
+/*
+ * @Author: luozheng 1732036298@qq.com
+ * @Date: 2024-06-20 15:11:17
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-06-20 16:52:30
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp
+ */
+#include "AppViewIDs.h"
+#include "NativeAbility.h"
+#include "aivoice/include/AiVoicePresenter.h"
+#include "aivoice/include/AiVoiceView.h"
+#include "aivoice/include/AiVoiceModel.h"
+#include "common/key_code.h"
+#include <custom_utils.h>
+#include "UiConfig.h"
+
+namespace OHOS
+{
+
+ // 当前Presenter属性实例化的内存指针
+ static AiVoicePresenter *g_pAiVoicePresenter = nullptr;
+
+ AiVoicePresenter::AiVoicePresenter()
+ {
+ model = &AiVoiceModel::GetInstance();
+ g_pAiVoicePresenter = this;
+ }
+
+ AiVoicePresenter::~AiVoicePresenter()
+ {
+ g_pAiVoicePresenter = nullptr;
+ }
+
+ AiVoicePresenter *AiVoicePresenter::GetInstance()
+ {
+ return g_pAiVoicePresenter;
+ }
+
+ void AiVoicePresenter::OnStart()
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnStart");
+ Presenter<AiVoiceView>::OnStart();
+ }
+
+ void AiVoicePresenter::OnPause(void)
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnPause");
+ Presenter<AiVoiceView>::OnPause();
+ }
+
+ void AiVoicePresenter::OnResume(void)
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnResume");
+ Presenter<AiVoiceView>::OnResume();
+ if (view_ == nullptr)
+ {
+ return;
+ }
+ RootView::GetInstance()->SetOnKeyActListener(this);
+ }
+
+ void AiVoicePresenter::OnStop(void)
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnStop");
+ Presenter<AiVoiceView>::OnStop();
+ }
+
+ bool AiVoicePresenter::OnClick(UIView &view, const ClickEvent &event)
+ {
+ UNUSED(event);
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnClick");
+ return true;
+ }
+
+ bool AiVoicePresenter::OnDrag(UIView &view, const DragEvent &event)
+ {
+ UNUSED(view);
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnDrag");
+ if ((event.GetDeltaX() > X_DRAG_OFFSET) && (event.GetDeltaX() > (DOUBLES * MATH_ABS(event.GetDeltaY())))) // 拖动过程中判断是否是水平滑动
+ {
+ AiVoicePresenter::X_DRAG_FLAG = true;
+ }
+ return true;
+ }
+
+ bool AiVoicePresenter::OnDragEnd(UIView &view, const DragEvent &event)
+ {
+ UNUSED(view);
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnDragEnd");
+ if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && AiVoicePresenter::X_DRAG_FLAG)
+ {
+ NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS);
+ AiVoicePresenter::X_DRAG_FLAG = false;
+ }
+ return true;
+ }
+
+ bool AiVoicePresenter::OnKeyAct(UIView &view, const KeyEvent &event) // 增加按键事件
+ {
+ UNUSED(view);
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnKeyAct");
+ uint16_t keyID = event.GetKeyId();
+ uint16_t keyState = event.GetState();
+ // 如果是power键,且是亮屏状态,按键释放就返回上一级
+ if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 0 && uapi_get_screen_state() == 0)
+ {
+ NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS);
+ }
+ return true;
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * @Author: luozheng 1732036298@qq.com
+ * @Date: 2024-05-07 11:25:58
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-06-20 20:22:36
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AiVoiceView.cpp
+ */
+#include "aivoice/include/AiVoicePresenter.h"
+#include "aivoice/include/AiVoiceView.h"
+#include "wearable_log.h"
+#include "language/font/ui_resource_string.h"
+namespace OHOS
+{
+
+ static AiVoiceView *g_pAiVoiceView{nullptr};
+
+ AiVoiceView::AiVoiceView()
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceView::AiVoiceView");
+ g_pAiVoiceView = this;
+ }
+
+ AiVoiceView::~AiVoiceView()
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceView::~AiVoiceView");
+ g_pAiVoiceView = nullptr;
+ }
+
+ AiVoiceView *AiVoiceView::GetInstance()
+ {
+ return g_pAiVoiceView;
+ }
+
+ void AiVoiceView::ClearAll(void)
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceView::ClearAll");
+ if (viewInitStatus)
+ {
+ if (container_ != nullptr)
+ {
+ container_->RemoveAll();
+ delete container_;
+ container_ = nullptr;
+ }
+ }
+ }
+
+ UILabelExt *AiVoiceView::AiVoiceViewLabelInit(LabelConfig &labelconfig)
+ {
+ UILabelExt *label = new UILabelExt();
+ if (label == nullptr)
+ {
+ return nullptr;
+ }
+ label->SetPosition(labelconfig.left, labelconfig.top, labelconfig.width, labelconfig.height);
+ label->SetStyle(STYLE_TEXT_FONT, labelconfig.fontSize);
+ label->SetStyle(STYLE_LINE_HEIGHT, labelconfig.lineHeigh);
+ label->SetTextId(labelconfig.textId);
+ label->SetLineBreakMode(labelconfig.lineBreakMode);
+ label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelconfig.fontSize);
+ return label;
+ }
+
+ UIButton *AiVoiceView::AiVoiceViewLabelButtonInit(ButtonConfig &buttonconfig)
+ {
+ UIButton *button = new UIButton();
+ if (button == nullptr)
+ {
+ return nullptr;
+ }
+ button->SetPosition(buttonconfig.x, buttonconfig.y, buttonconfig.w, buttonconfig.h);
+ button->SetViewId(buttonconfig.ViewId);
+ button->SetStyle(STYLE_BACKGROUND_COLOR, 0xff4fc34c);
+ button->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
+ button->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff191919, UIButton::PRESSED);
+ button->SetOnClickListener(presenter_);
+
+ return button;
+ }
+
+ bool AiVoiceView::CreateAiVoiceViewLabel(void)
+ {
+ LabelConfig labelConfig = {
+ .left = 83,
+ .top = 52,
+ .width = 300,
+ .height = 35,
+ .fontSize = 30,
+ .lineHeigh = 35,
+ .textId = STR_AI_INTELLIGENT_ASSISTANT,
+ .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
+ };
+ title = AiVoiceViewLabelInit(labelConfig);
+ if (title == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "title new fail!");
+ return false;
+ }
+
+ labelConfig = {
+ .left = 133,
+ .top = 368,
+ .width = 200,
+ .height = 35,
+ .fontSize = 30,
+ .lineHeigh = 35,
+ .textId = STR_START_CHAT,
+ .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
+ };
+ startChatLabel = AiVoiceViewLabelInit(labelConfig);
+ if (startChatLabel == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "startChatLabel new fail!");
+ return false;
+ }
+
+ return true;
+ }
+
+ bool AiVoiceView::CreateAiVoiceViewButton(void)
+ {
+ ButtonConfig buttonconfig = {
+ .x = 93,
+ .y = 340,
+ .w = 280,
+ .h = 90,
+ .ViewId = "StartChat",
+ };
+ startChatButton = AiVoiceViewLabelButtonInit(buttonconfig);
+ if (startChatButton == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "startChatButton new fail!");
+ return false;
+ }
+
+ return true;
+ }
+
+ void AiVoiceView::CreateAiVoiceView(void)
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceView::CreateAiVoiceView");
+ if (!CreateAiVoiceViewLabel() || !CreateAiVoiceViewButton())
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceView::CreateAiVoiceView fail!");
+ return;
+ }
+ container_->Add(title);
+ container_->Add(startChatButton);
+ container_->Add(startChatLabel);
+ }
+
+ void AiVoiceView::OnStart()
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceView::OnStart");
+ View<AiVoicePresenter>::OnStart();
+ SetContainerView(new UIViewGroup());
+ container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight());
+ container_->SetOnDragListener(presenter_);
+ container_->SetTouchable(true);
+ container_->SetDraggable(true);
+
+ if (!viewInitStatus)
+ {
+ CreateAiVoiceView();
+ viewInitStatus = true;
+ }
+
+ return;
+ }
+
+ void AiVoiceView::OnSetUpView()
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceView::OnSetUpView");
+ View<AiVoicePresenter>::OnSetUpView();
+ Draw();
+ return;
+ }
+
+ void AiVoiceView::OnTearDownView()
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceView::OnTearDownView");
+ View<AiVoicePresenter>::OnTearDownView();
+ return;
+ }
+
+ void AiVoiceView::OnStop()
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceView::OnStop");
+ View<AiVoicePresenter>::OnStop();
+ RootView::GetInstance()->ClearOnKeyActListener();
+ ClearAll();
+ return;
+ }
+}
\ No newline at end of file
{VIEW_THEME_STYLE, PNG_APPLIST_THEME_IMAGE, PNG_APPLIST_THEME_IMAGE, "显示方式", STR_DISPLAY_MODE, nullptr},
{VIEW_SET_CARD, PNG_APPLIST_CARDSET_IMAGE, PNG_APPLIST_CARDSET_IMAGE, "卡片管理", STR_CARD_MANAGEMENT, nullptr},
{VIEW_SET_DIAL, PNG_APPLIST_CHANGEDIAL_IMAGE, PNG_APPLIST_CHANGEDIAL_IMAGE, "更换表盘", STR_WATCH_FACE, nullptr},
- {VIEW_SOUND_VIBRATION, PNG_APPLIST_VOICE_IMAGE, PNG_APPLIST_VOICE_IMAGE, "声音", STR_WATCH_FACE, nullptr},
+ {VIEW_SOUND_VIBRATION, PNG_APPLIST_VOICE_IMAGE, PNG_APPLIST_VOICE_IMAGE, "声音", STR_SOUND, nullptr},
{VIEW_CLASSIC_BLUETOOTH, PNG_APPLIST_BLUETOOTH_IMAGE, PNG_APPLIST_BLUETOOTH_IMAGE, "蓝牙", STR_BLUETOOTH, nullptr},
{VIEW_DNOTDISTURB, PNG_APPLIST_DISTURB_IMAGE, PNG_APPLIST_DISTURB_IMAGE, "勿扰模式", STR_DO_NOT_DISTURB, nullptr},
{VIEW_FLASHLIGHT, PNG_APPLIST_FLASHLIGHT_IMAGE, PNG_APPLIST_FLASHLIGHT_IMAGE, "手电筒", STR_FLASHLIGHT, nullptr},
{VIEW_MESSAGE, PNG_APPLIST_MESSAGE_IMAGE, PNG_APPLIST_MESSAGE_IMAGE, "消息通知", STR_MESSAGE_NOTIFICATION, nullptr},
{VIEW_TAKEPHOTOS, PNG_APPLIST_TACKEPHOTOS_IMAGE, PNG_APPLIST_TACKEPHOTOS_IMAGE, "遥控拍照", STR_REMOTE_SHOOTING, nullptr},
{VIEW_RESPIRATORY_TRAINING, PNG_APPLIST_BREATHE_IMAGE, PNG_APPLIST_BREATHE_IMAGE, "呼吸训练", STR_BREATH_TRAINING, nullptr},
+ //{VIEW_AI_VOICE, PNG_APPLIST_AIVOICE_IMAGE, PNG_APPLIST_AIVOICE_IMAGE, "AI Voice", STR_AI_VOICE, nullptr},
#ifdef SUPPORT_ALIPAY_SEC
{VIEW_MAIN_ALIPAY, PNG_APPLIST_ALIPAY_IMAGE, PNG_APPLIST_ALIPAY_IMAGE, "支付宝", STR_ALIPAY, nullptr},
#endif
void ApplistPresenter::OnPause()
{
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistPresenter::OnPause");
Presenter<ApplistView>::OnPause();
}
void ApplistPresenter::OnStop(void)
{
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistPresenter::OnStop");
Presenter<ApplistView>::OnStop();
}
container_ = nullptr;
}
RootView::GetInstance()->ClearOnKeyActListener();
- FocusManager::GetInstance()->ClearFocus();
+ //FocusManager::GetInstance()->ClearFocus();
return;
}
STR_CELLULAR_DISPLAY$蜂窝显示\r
STR_RECORDING_LIST$录音列表\r
STR_CRLEMPTY$当前录音列表为空\r
-STR_CALL_VOLUME$通话音量
\ No newline at end of file
+STR_CALL_VOLUME$通话音量\r
+STR_AI_VOICE$AI Voice\r
+STR_AI_INTELLIGENT_ASSISTANT$AI智能助手\r
+STR_START_CHAT$开始对话\r
+STR_BOOT_FAILED$启动失败\r
+STR_ENABLE_MOBILE_DATA_FIRST$请先开启移动数据 \r
+STR_ENABLE_BLUETOOTH_FIRST$请先开启蓝牙\r
+STR_LISTENING$正在聆听...\r
+STR_FINISH_SPEAKING$说话完毕\r
+STR_THINKING$正在思考\r
+STR_CANCEL$取消\r
+STR_CONNECT_TIMEOUT$连接超时\r
+STR_PLEASE_RESTART_CHAT$请开始重新对话\r
+STR_CONTINUE_CHAT$继续对话
\ No newline at end of file
<lanstr id="STR_RECORDING_LIST" value="录音列表"/>
<lanstr id="STR_CRLEMPTY" value="当前录音列表为空"/>
<lanstr id="STR_CALL_VOLUME" value="通话音量"/>
+ <lanstr id="STR_AI_VOICE" value="AI Voice"/>
+ <lanstr id="STR_AI_INTELLIGENT_ASSISTANT" value="AI智能助手"/>
+ <lanstr id="STR_START_CHAT" value="开始对话"/>
+ <lanstr id="STR_BOOT_FAILED" value="启动失败"/>
+ <lanstr id="STR_ENABLE_MOBILE_DATA_FIRST" value="请先开启移动数据"/>
+ <lanstr id="STR_ENABLE_BLUETOOTH_FIRST" value="请先开启蓝牙"/>
+ <lanstr id="STR_LISTENING" value="正在聆听..."/>
+ <lanstr id="STR_FINISH_SPEAKING" value="说话完毕"/>
+ <lanstr id="STR_THINKING" value="正在思考"/>
+ <lanstr id="STR_CANCEL" value="取消"/>
+ <lanstr id="STR_CONNECT_TIMEOUT" value="连接超时"/>
+ <lanstr id="STR_PLEASE_RESTART_CHAT" value="请开始重新对话"/>
+ <lanstr id="STR_CONTINUE_CHAT" value="继续对话"/>
</language>
STR_RECORDING_LIST = 470,\r
STR_CRLEMPTY = 471,\r
STR_CALL_VOLUME = 472,\r
- STR_MAX_ID = 473,\r
+ STR_AI_VOICE = 473,\r
+ STR_AI_INTELLIGENT_ASSISTANT = 474,\r
+ STR_START_CHAT = 475,\r
+ STR_BOOT_FAILED = 476,\r
+ STR_ENABLE_MOBILE_DATA_FIRST = 477,\r
+ STR_ENABLE_BLUETOOTH_FIRST = 478,\r
+ STR_LISTENING = 479,\r
+ STR_FINISH_SPEAKING = 480,\r
+ STR_THINKING = 481,\r
+ STR_CANCEL = 482,\r
+ STR_CONNECT_TIMEOUT = 483,\r
+ STR_PLEASE_RESTART_CHAT = 484,\r
+ STR_CONTINUE_CHAT = 485,\r
+ STR_MAX_ID = 486,\r
}; // UIResourceTextId\r
enum FontLanguageId : uint8_t {
* @Author: luozheng 1732036298@qq.com\r
* @Date: 2024-02-19 10:39:11\r
* @LastEditors: luozheng 1732036298@qq.com\r
- * @LastEditTime: 2024-06-19 15:40:58\r
+ * @LastEditTime: 2024-06-20 18:02:46\r
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp\r
*/\r
\r
\r
void SoundAndVibrationPresenter::OnStart()\r
{\r
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationPresenter::OnStart");\r
Presenter<SoundAndVibrationView>::OnStart();\r
}\r
\r
void SoundAndVibrationPresenter::OnPause(void)\r
{\r
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationPresenter::OnPause");\r
Presenter<SoundAndVibrationView>::OnPause();\r
}\r
\r
void SoundAndVibrationPresenter::OnResume(void)\r
{\r
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationPresenter::OnResume");\r
Presenter<SoundAndVibrationView>::OnResume();\r
if (view_ == nullptr)\r
{\r
\r
void SoundAndVibrationPresenter::OnStop(void)\r
{\r
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationPresenter::OnStop");\r
Presenter<SoundAndVibrationView>::OnStop();\r
}\r
\r
* @Author: luozheng 1732036298@qq.com\r
* @Date: 2024-02-19 10:39:14\r
* @LastEditors: luozheng 1732036298@qq.com\r
- * @LastEditTime: 2024-06-19 17:46:53\r
+ * @LastEditTime: 2024-06-20 18:03:01\r
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationView.cpp\r
*/\r
#include "soundandvibration/include/SoundAndVibrationView.h"\r
container_->SetDraggable(true);\r
\r
CreateSoundAndVibrationView();\r
-\r
- RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::SoundAndVibrationPresenter::GetInstance();\r
- RootView::GetInstance()->SetOnKeyActListener(keyactListener);\r
+ RootView::GetInstance()->SetOnKeyActListener(presenter_);\r
}\r
\r
void SoundAndVibrationView::OnSetUpView()\r
#include "graphic_service.h"
#include "abilityms_slite_client.h"
#include "common/input_device_manager.h"
-
+#include "dock/focus_manager.h"
namespace OHOS {
/*
* @brief 负责将一个SliceProxy对象添加到Ability对象中,如果传入的sliceId是无效的或者代理对象proxy为空,则不执行任何操作。
*/
bool useTransition = sliceTransition_.SetTransitionType(type);
bool isCurSnapshotEnabled = sliceTransition_.IsCurrentSnapshotEnabled();
+ FocusManager::GetInstance()->ClearFocus();
if (!useTransition) {
StopSlice();
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:fd2acea8d7166abd98536687c9a59a37e66dcadf5dc0152bb6185e04ce9fa13d
+size 1560
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:96e2af6c30df028b9c9c0e032325f1e45d8b872aaffe8712215d3d2262ea9c0e
+size 1560
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:72c650a3bf3f61a231a466b92b72c75322b158da9bb966dd72d37619fb79830f
+size 408
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:2aac78100175b3b8cf9b5fc04ac3c41611825058e88601847a0f03263248b771
+size 5544
STR_RECORDING_LIST = 470,\r
STR_CRLEMPTY = 471,\r
STR_CALL_VOLUME = 472,\r
- STR_MAX_ID = 473,\r
+ STR_AI_VOICE = 473,\r
+ STR_AI_INTELLIGENT_ASSISTANT = 474,\r
+ STR_START_CHAT = 475,\r
+ STR_BOOT_FAILED = 476,\r
+ STR_ENABLE_MOBILE_DATA_FIRST = 477,\r
+ STR_ENABLE_BLUETOOTH_FIRST = 478,\r
+ STR_LISTENING = 479,\r
+ STR_FINISH_SPEAKING = 480,\r
+ STR_THINKING = 481,\r
+ STR_CANCEL = 482,\r
+ STR_CONNECT_TIMEOUT = 483,\r
+ STR_PLEASE_RESTART_CHAT = 484,\r
+ STR_CONTINUE_CHAT = 485,\r
+ STR_MAX_ID = 486,\r
}; // UIResourceTextId\r
enum FontLanguageId : uint8_t {
void ConfigModel::SetSilentMode(bool state)
{
set_condigData_Bool(CONFIGMODEL_ITEM_SILENT_MODE,state);
+ uapi_setSilentMode(state);
}
/*获取静音模式是否开启*/
void ConfigModel::SetSystemVolume(int value)
{
set_condigData_Int(CONFIGMODEL_ITEM_SYSTEM_VOLUME,value);
+ uapi_systemVolumeSet(value);
}
//获取系统音量
void ConfigModel::SetCallVolume(int value)
{
set_condigData_Int(CONFIGMODEL_ITEM_CALL_VOLUME,value);
+ uapi_callVolumeSet(value);
}
//获取通话音量