From: luozheng <1732036298@qq.com> Date: Fri, 30 Aug 2024 08:04:22 +0000 (+0800) Subject: 闹钟退出逻辑改为OnDragEnd X-Git-Tag: release_V1.2.70_20241020_135402~529^2~48 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=9cd532bc665f666b80e330490818595b5563588a;p=mirrors%2FFD230.git 闹钟退出逻辑改为OnDragEnd --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmPresenter.cpp index 4feaa3507..3d4047f41 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmPresenter.cpp @@ -371,23 +371,9 @@ bool AlarmPresenter::OnDragEnd(UIView& view, const DragEvent& event) { if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && X_DRAG_FLAG) { - if(view.GetViewType() == UIViewType::UI_SWIPE_VIEW) - { - view.SetIntercept(false); - } - else - { - MainAlarmView::GetInstance()->DropView(view); - } + MainAlarmView::GetInstance()->DropView(view); X_DRAG_FLAG = false; } - else if(event.GetDragDirection() == DragEvent::DIRECTION_RIGHT_TO_LEFT) - { - if(view.GetViewType() == UIViewType::UI_SWIPE_VIEW) - { - view.SetIntercept(true); - } - } return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/MainAlarmView.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/MainAlarmView.cpp index 023a817db..f2611d0d6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/MainAlarmView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/MainAlarmView.cpp @@ -305,9 +305,10 @@ void MainAlarmView::NewClockCtl(int16_t alarmNum) } // SwipeView_[alarmNum]->SetViewId(ITEM_SWIPE[alarmNum]); SwipeView_[alarmNum]->SetTouchable(true); - SwipeView_[alarmNum]->SetThrowDrag(true); - // SwipeView_[alarmNum]->SetOnSwipeListener(presenter_); - SwipeView_[alarmNum]->SetOnDragListener(presenter_); + // SwipeView_[alarmNum]->SetThrowDrag(true); + SwipeView_[alarmNum]->SetOnSwipeListener(presenter_); + SwipeView_[alarmNum]->SetAnimatorTime(50); // 200:animator drag time(ms) + // SwipeView_[alarmNum]->SetOnDragListener(presenter_); SwipeView_[alarmNum]->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); SwipeView_[alarmNum]->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); SwipeView_[alarmNum]->SetStyle(STYLE_BORDER_RADIUS, 100);