通讯录修改
authorhcj <1224667075@qq.com>
Thu, 24 Oct 2024 06:47:13 +0000 (14:47 +0800)
committerhcj <1224667075@qq.com>
Thu, 24 Oct 2024 06:47:13 +0000 (14:47 +0800)
code/sdk/application/wearable/fd230app/nativeui/phone/include/CallLogAdapter.h
code/sdk/application/wearable/fd230app/nativeui/phone/src/CallLogAdapter.cpp
code/sdk/application/wearable/fd230app/nativeui/phone/src/CallLogItem.cpp

index c2181a0..2d29122 100644 (file)
 #include <list>
 #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<CallLogInfo> listData;
index 7846be3..d3dc7a3 100644 (file)
@@ -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
index 43e78c8..61a5b7d 100644 (file)
@@ -186,8 +186,8 @@ namespace OHOS
 
             button_calllog_SwipeView->SetAnimatorTime(50);           // 200:animator drag time(ms)
 
-            UIView::OnDragListener *dragListener = static_cast<UIView::OnDragListener *>(MainPhonePresenter::GetInstance());
-            button_calllog_SwipeView->SetOnDragListener(dragListener);
+            // UIView::OnDragListener *dragListener = static_cast<UIView::OnDragListener *>(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);