ReButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xffFF8A36); // 设置按键颜色
ReButton->SetOnClickListener(presenter_);
- AddViewToRootContainer(StButton);
- AddViewToRootContainer(ReButton);
+ group->Add(StButton);
+ group->Add(ReButton);
return true;
}
/***
noteLabel->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION);
noteLabel->SetRollSpeed(23);
- AddViewToRootContainer(titleLabel);
- AddViewToRootContainer(noteLabel);
+ group->Add(titleLabel);
+ group->Add(noteLabel);
return true;
}
/***
noteimage->SetPosition(193, 120, 80, 80);
noteimage->SetSrc(BLOOD_PATH_NOTE);
- AddViewToRootContainer(noteimage);
+ group->Add(noteimage);
return true;
}
/***
bool CheckAbnormalView::CheckAbnormalViewInit()
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bool CheckAbnormalView::InitView()");
+ group = new UIViewGroup();
+ if (group == nullptr)
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[FindPhoneViewInit_BlueToothConnected] group new fail!!");
+ return false;
+ }
+ group->SetPosition(0, 0, 466, 466);
+ group->SetStyle(STYLE_BACKGROUND_OPA, 0);
+ group->SetTouchable(true);
+ group->SetDraggable(true);
+ group->SetOnDragListener(presenter_);
+ AddViewToRootContainer(group);
+
if (!Initbackground())
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Initbackground error!");
*/
void CheckAbnormalView::DeInit()
{
+ if(group!=nullptr)
+ {
+ group->RemoveAll();
+ delete group;
+ group = nullptr;
+ }
if (StButton != nullptr)
{
delete StButton;
{
custom_VibratorFunc_int(0);
}
-
-
- GetRootContainer()->SetDraggable(true);
- GetRootContainer()->SetTouchable(true);
- GetRootContainer()->SetOnDragListener(presenter_);
- //RootView::GetInstance()->SetOnKeyActListener(presenter_);
}
}
return false;
}
+
+bool HrvPresenter::OnDrag(UIView &view, const DragEvent &event)
+{
+ return true;
+}
+
bool HrvPresenter::OnDragEnd(OHOS::UIView &view, const OHOS::DragEvent &event)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HrvPresenter::OnDragEnd");
if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT)
{
- if (event.GetPreLastPoint().x - event.GetStartPoint().x > 100)
- NativeAbility::GetInstance().Back();
- }
- if (event.GetDragDirection() == DragEvent::DIRECTION_BOTTOM_TO_TOP)
- {
- // 上拉更新HRV数据
- HrvView::GetInstance()->update_hrv_data(1);
- }
- if (event.GetDragDirection() == DragEvent::DIRECTION_TOP_TO_BOTTOM)
- {
- // 下拉刷新HRV数据
- HrvView::GetInstance()->update_hrv_data(2);
+ NativeAbility::GetInstance().Back();
}
+ // if (event.GetDragDirection() == DragEvent::DIRECTION_BOTTOM_TO_TOP)
+ // {
+ // // 上拉更新HRV数据
+ // HrvView::GetInstance()->update_hrv_data(1);
+ // }
+ // if (event.GetDragDirection() == DragEvent::DIRECTION_TOP_TO_BOTTOM)
+ // {
+ // // 下拉刷新HRV数据
+ // HrvView::GetInstance()->update_hrv_data(2);
+ // }
return true;
}
group->SetPosition(0, 0, 466, 466);
group->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
group->SetStyle(STYLE_BACKGROUND_OPA, 0xD0);
+ group->SetTouchable(true);
+ group->SetDraggable(true);
group->SetOnDragListener((UIView::OnDragListener *)OHOS::HrvPresenter::GetInstance());
AddViewToRootContainer(group);