修复电话界面动画问题
authorhcj <1224667075@qq.com>
Sat, 19 Oct 2024 11:01:12 +0000 (19:01 +0800)
committerhcj <1224667075@qq.com>
Sat, 19 Oct 2024 11:01:12 +0000 (19:01 +0800)
code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhoneView.cpp

index 2f7a118..78495ec 100644 (file)
@@ -67,6 +67,8 @@ namespace OHOS
 
     void MainPhoneView::ClearAll(void)
     {
+        //container_->RemoveAll();
+
         if (MainPhoneViewScrollView != nullptr)
         {
             MainPhoneViewScrollView->RemoveAll();
@@ -147,14 +149,8 @@ namespace OHOS
             }
       
      
-            for(int i=0;i<CALL_LOG_MAX_NUM;i++)
-            {
-                if(info[i])
-                {
-                    UIFree(info[i]);
-                    info[i]=nullptr;
-                }
-            }
+           
+
             if(button_delete_all_calllog)
             {
                 delete button_delete_all_calllog;
@@ -179,6 +175,15 @@ namespace OHOS
                 p_LanguageSwitchListAdapter = nullptr;
             }
 
+            for(int i=0;i<CALL_LOG_MAX_NUM;i++)
+            {
+                if(info[i])
+                {
+                    UIFree(info[i]);
+                    info[i]=nullptr;
+                }
+            }
+
             
 
             delete MainPhoneViewScrollView;
@@ -224,8 +229,8 @@ namespace OHOS
         //CalllogList->SetReboundSize(30);
         //CalllogList->SetScrollBlankSize(20);
         CalllogList->SetStartIndex(0);
-        FocusManager::GetInstance()->RequestFocus(CalllogList);
-        FocusManager::GetInstance()->RequestFocusByDirection(FOCUS_DIRECTION_UP);
+        // FocusManager::GetInstance()->RequestFocus(CalllogList);
+        // FocusManager::GetInstance()->RequestFocusByDirection(FOCUS_DIRECTION_UP);
         CalllogList->SetRotateFactor(1.0);
 
         CalllogList->SetAdapter(p_LanguageSwitchListAdapter);
@@ -734,8 +739,11 @@ namespace OHOS
                 //    Init_button_calllog_SwipeView(info[i-1],y);
                 //    y++;
                 // }
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainPhoneViewListViewInit__");
                 MainPhoneViewListViewInit();
-               
+
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainPhoneViewListViewInit_end");
+
                MainPhoneView_ButtonConfig_ext_t buttonParam = {
                     .x = 38,
                     .y =  365+num*124,
@@ -828,8 +836,8 @@ namespace OHOS
         MainPhoneViewScrollView->Add(TelephoneLineImageView);
         MainPhoneViewScrollView->Add(NoCallsLabel);
         
-
-        RootView::GetInstance()->Add(MainPhoneViewScrollView);
+        container_=MainPhoneViewScrollView;
+        RootView::GetInstance()->Add(container_);
         Draw();
     }