弧形列表优化 1297/1 1297/head
authorluozheng <1732036298@qq.com>
Wed, 30 Oct 2024 10:04:18 +0000 (18:04 +0800)
committerluozheng <1732036298@qq.com>
Wed, 30 Oct 2024 10:04:18 +0000 (18:04 +0800)
code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistView.cpp

index 285147d..4e92699 100644 (file)
@@ -207,44 +207,25 @@ void ApplistView::ListStyleOnStart()
 
 static bool TransformItemBaseOnPosition(UITransformList* list, UIView* item)
 {
-    // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TransformItemBaseOnPosition [%d]", __LINE__);
     if (list == nullptr || item == nullptr) {
         return false;
     }
     if (item->GetViewType() != UI_TRANSFORM_GROUP) {
         return false;
     }
-    ArcScaleListItemView * group = dynamic_cast<ArcScaleListItemView*>(item);
+    UITransformGroup* group = dynamic_cast<UITransformGroup*>(item);
     if (group == nullptr) {
         return false;
     }
-    if(group->GetImage() == nullptr)
-    {
-        return false;
-    }
-    if(group->GetLabel() == nullptr)
-    {
-        return false;
-    }
-
-    // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TransformItemBaseOnPosition [%d]", __LINE__);
     int16_t w = group->GetWidth();
     int16_t h = group->GetHeight();
-    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "TransformItemBaseOnPosition [%d] %d %d", __LINE__,w,h);
     if (list->GetDirection() == UIList::VERTICAL) {
         int16_t midY = list->GetY() + (list->GetHeight() >> 1);
         int16_t y = group->GetY();
         int offset = (y + (h >> 1) - midY);
-        // group->Scale(Vector2<float>(scale, scale), Vector2<float>((w>>1),  h >> 1));
-
-        int img_temp = EasingEquation::SineEaseIn(0, ARC_SCALE_LIST_SCALE_FACTOR, abs(offset), ARC_SCALE_LIST_SCALE_FACTOR);
-        float img_scale = 1.0 - (static_cast<float>(img_temp) / ARC_SCALE_LIST_SCALE_FACTOR);
-        group->GetImage()->Scale(Vector2<float>(img_scale, img_scale), Vector2<float>((w>>1),  h >> 1));
-
-        int label_temp = EasingEquation::SineEaseIn(0, ARC_SCALE_LIST_SCALE_FACTOR/2, abs(offset), ARC_SCALE_LIST_SCALE_FACTOR);
-        float label_scale = 1.0 - (static_cast<float>(label_temp) / ARC_SCALE_LIST_SCALE_FACTOR);
-        group->GetLabel()->Scale(Vector2<float>(label_scale, label_scale), Vector2<float>((w>>1),  h >> 1));
-        
+        int temp = EasingEquation::SineEaseIn(0, ARC_SCALE_LIST_SCALE_FACTOR, abs(offset), ARC_SCALE_LIST_SCALE_FACTOR);
+        float scale = 1.0 - (static_cast<float>(temp) / ARC_SCALE_LIST_SCALE_FACTOR);
+        group->Scale(Vector2<float>(scale, scale), Vector2<float>(w >> 1,  h >> 1));
         if ((y <= midY) && (y + group->GetHeight() >= midY)) {
             return true;
         }