* @Author: luozheng 1732036298@qq.com
* @Date: 2024-04-23 17:29:18
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-07-24 18:03:56
+ * @LastEditTime: 2024-09-14 15:56:07
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h
*/
#ifndef MOTION_RECOGNITION_VIEW_H
UIImageView *MotionRecognitionImage = nullptr;
UILabelExt *MotionRecognitionLabel = nullptr;
UIToggleButton *MotionRecognitionToggleButton = nullptr;
+ UILabelExt *note{nullptr};
bool viewInitStatus{false};
};
}
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-04-23 17:28:52
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-07-24 18:16:10
+ * @LastEditTime: 2024-09-14 16:14:37
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp
*/
#include "motionrecognition/include/MotionRecognitionPresenter.h"
delete MotionRecognitionToggleButton;
MotionRecognitionToggleButton = nullptr;
}
+ if (note != nullptr)
+ {
+ delete note;
+ note = nullptr;
+ }
delete scrollView;
scrollView = nullptr;
/* ----------------------------- onclickListener ---------------------------- */
// MotionRecognitionToggleButton->SetOnClickListener(presenter_);
MotionRecognitionToggleButton->SetOnChangeListener(presenter_);
+ /* -------------------------------------------------------------------------- */
+ if (note == nullptr)
+ {
+ note = new UILabelExt();
+ if (note == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MotionRecognitionView::note can not be nullptr!");
+ return;
+ }
+ }
+ note->SetPosition(63, MotionRecognitionImage->GetY() + MotionRecognitionImage->GetHeight() + 20, 340, 80);
+ note->SetStyle(STYLE_TEXT_FONT, 26);
+ note->SetStyle(STYLE_LINE_HEIGHT, 40);
+ note->SetTextColor(Color::GetColorFromRGBA(0x99, 0x99, 0x99, 0xff));
+ note->SetText("开启后,手表会在检测到你处于运动状态时发出提醒。支持的运动包括:走路、跑步、骑车、划船机、椭圆机。"); /*自动识别*/
+ note->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
+ note->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 26);
+ /* -------------------------------------------------------------------------- */
viewInitStatus = true;
/* -------------------------------------------------------------------------- */
scrollView->Add(MotionRecognitionImage);
scrollView->Add(MotionRecognitionLabel);
scrollView->Add(MotionRecognitionToggleButton);
+ scrollView->Add(note);
container_->Add(scrollView);
Draw();
}