namespace OHOS {
SetTimeFormatView::SetTimeFormatView() {}
-SetTimeFormatView::~SetTimeFormatView() {}
+SetTimeFormatView::~SetTimeFormatView()
+{
+ group_.RemoveAll();
+}
void SetTimeFormatView::OnStart() {
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HeartResultView::InitHeartView fail");
}
-
- GetRootContainer()->SetDraggable(true);
- GetRootContainer()->SetPosition(0, 0, 466, 466);
- GetRootContainer()->SetOnDragListener(presenter_);
-
- GetRootContainer()->SetTouchable(true);
}
-bool SetTimeFormatView::SetTimeFormatInit() {
+bool SetTimeFormatView::SetTimeFormatInit()
+{
+ group_.SetPosition(0, 0, 466, 466);
+ group_.SetStyle(STYLE_BACKGROUND_OPA, 0);
+ group_.SetTouchable(true);
+ group_.SetDraggable(true);
+ group_.SetOnDragListener(presenter_);
+ AddViewToRootContainer(&group_);
Format24H_Image_.SetPosition(43, 120, 380, 100);
Format24H_Image_.SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
Format24H_Image_.SetStyle(STYLE_BACKGROUND_OPA, 0xff);
Format24H_Image_.SetStyle(STYLE_BORDER_RADIUS, 100);
- AddViewToRootContainer(&Format24H_Image_);
+ group_.Add(&Format24H_Image_);
labelTitle_.SetPosition(83, 50, 300, 60);
labelTitle_.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
labelTitle_.SetTextId(STR_TIME_SET); // TODO:多国语言
labelTitle_.SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); // 居中
labelTitle_.SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
- AddViewToRootContainer(&labelTitle_);
+ group_.Add(&labelTitle_);
labelFormat24H_.SetPosition(90, 153, 200, 60);
labelFormat24H_.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
labelFormat24H_.SetTextId(STR_FORMAT); // TODO:多国语言
labelFormat24H_.SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION);
labelFormat24H_.SetRollSpeed(23);
- AddViewToRootContainer(&labelFormat24H_);
+ group_.Add(&labelFormat24H_);
+
+
btnFormat24H_.SetPosition(298, 145, 100, 50);
btnFormat24H_.SetImages(PNG_TOGGLEBUTTON_ON_IMAGE,
PNG_TOGGLEBUTTON_OFF_IMAGE);
- AddViewToRootContainer(&btnFormat24H_);
+ group_.Add(&btnFormat24H_);
labelNote_.SetPosition(53, 240, 360, 100);
labelNote_.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20);
labelNote_.SetTextId(STR_FORMAT_NOTE);
- AddViewToRootContainer(&labelNote_);
+ group_.Add(&labelNote_);
const TimeFormat style = SetTimeFormatModel::GetInstance().GetTimeStyle();
if (style == TimeFormat::TIME_FORMAT_24H) {