From: hcj <1224667075@qq.com> Date: Thu, 24 Oct 2024 06:47:13 +0000 (+0800) Subject: 通讯录修改 X-Git-Tag: fd230_release_V1.3.102~193^2~1^2~2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=ab85758fee09d8e5755159dbd3d073e98051ad83;p=mirrors%2FFD230.git 通讯录修改 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/include/CallLogAdapter.h b/code/sdk/application/wearable/fd230app/nativeui/phone/include/CallLogAdapter.h index c2181a088..2d29122e2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/include/CallLogAdapter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/include/CallLogAdapter.h @@ -16,14 +16,16 @@ #include #include "languagecode/LanguageInit.h" #include "PhoneService.h" +#include "components/ui_swipe_view.h" namespace OHOS { class CallLogListAdapter : public AbstractAdapter, - public UIView::OnClickListener - { + public UIView::OnClickListener, + public UISwipeView::OnSwipeListener + { public: explicit CallLogListAdapter(); virtual ~CallLogListAdapter(); @@ -57,6 +59,7 @@ namespace OHOS } bool OnClick(UIView &view, const ClickEvent &event); + void OnSwipe(UISwipeView &view); private: std::list listData; diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/src/CallLogAdapter.cpp b/code/sdk/application/wearable/fd230app/nativeui/phone/src/CallLogAdapter.cpp index 7846be311..d3dc7a32b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/src/CallLogAdapter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/src/CallLogAdapter.cpp @@ -107,8 +107,10 @@ namespace OHOS // } //item->SetOnClickListener(this); + // item->Getbutton_calllog()->->SetOnSwipeListener(this); item->Getbutton_calllog()->SetOnClickListener(this); item->GetDeleteButton()->SetOnClickListener(this); + item->Getbutton_calllog_SwipeView()->SetOnSwipeListener(this); // item->GetUILabelButtonExt()->SetOnClickListener(itemClickListener); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GetView, id = %s", item->GetUILabelButtonExt()->GetViewId()); @@ -174,6 +176,15 @@ namespace OHOS listData.push_back(item); } + void CallLogListAdapter::OnSwipe(UISwipeView &view) + { + UNUSED(view); + + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmPresenter::OnSwipe "); + view.SetIntercept((0 == view.GetCurrentPage()) ? false : true); + } + + } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/src/CallLogItem.cpp b/code/sdk/application/wearable/fd230app/nativeui/phone/src/CallLogItem.cpp index 43e78c89c..61a5b7dbe 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/src/CallLogItem.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/src/CallLogItem.cpp @@ -186,8 +186,8 @@ namespace OHOS button_calllog_SwipeView->SetAnimatorTime(50); // 200:animator drag time(ms) - UIView::OnDragListener *dragListener = static_cast(MainPhonePresenter::GetInstance()); - button_calllog_SwipeView->SetOnDragListener(dragListener); + // UIView::OnDragListener *dragListener = static_cast(MainPhonePresenter::GetInstance()); + // button_calllog_SwipeView->SetOnDragListener(dragListener); button_calllog_SwipeView->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); button_calllog_SwipeView->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); @@ -207,7 +207,8 @@ namespace OHOS button_calllog_SwipeView->SetLoopState(false); button_calllog_SwipeView->SetVisible(true); - + button_calllog_SwipeView->SetReboundSize(0); + button_calllog_SwipeView->SetBlankSize(0); //button_calllog_SwipeView[i]->SetDirection(); //button_calllog_SwipeView->SetDraggable(false);