uint16_t GetStartIndex(void);
void SetHeadItemY(int index);
int GetHeadItemY(void);
+ void SetArcListStartIndex(uint16_t index);
+ uint16_t GetArcListStartIndex(void);
+ void GetArcListHeadItemY(int y);
+ int GetArcListHeadItemY(void);
void ApplistUpdate(void);
void SetPresenter(ApplistPresenter *p);
AppListStyle GetCurrentStyle(void);
int32 bundleLen = 0;
uint8 appLen = 0;
- uint16_t startIndex = 0;
- int headItemY = 0;
+ uint16_t arcListstartIndex = 0; // 圆弧列表起始位置
+ int arcListheadItemY = 0; // 圆弧列表头部位置
+ uint16_t startIndex = 0; // 列表起始位置
+ int headItemY = 0; // 列表头部位置
bool initFlag{false};
};
}
ArcScaleList_->SetPosition(ARC_SCALE_LIST_X, ARC_SCALE_LIST_Y, ARC_SCALE_LIST_WIDTH, ARC_SCALE_LIST_HEIGHT);
ArcScaleList_->SetItemTransformFunc(&TransformItemBaseOnPosition);
- ArcScaleList_->SetAdapter(ArcScaleListAdapter_);
+ // ArcScaleList_->SetAdapter(ArcScaleListAdapter_);
ArcScaleList_->SetDraggable(true);
ArcScaleList_->SetThrowDrag(true);
ArcScaleList_->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT);
startIndex = presenter_->GetListItemNum() - 1;
headY = VERTICAL_RESOLUTION / NUM_2;
} else {
- startIndex = presenter_->GetStartIndex();
- headY = presenter_->GetHeadItemY();
+ uint16_t presliceId = NativeAbility::GetInstance().GetPreSliceId();
+ if (presliceId == VIEW_MAIN) //如果是从主页进入的,那么startIndex = 0,headY = 0
+ {
+ startIndex = 0;
+ headY = 0;
+ } else {
+ startIndex = presenter_->GetStartIndex();
+ headY = presenter_->GetHeadItemY();
+ }
if (headY == 0) {
headY = VERTICAL_RESOLUTION / NUM_2;
}
void ApplistView::ArcScaleListStyleOnSetUpView(void)
{
- // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ApplistView::ArcScaleListStyleOnSetUpView [%d]", __LINE__);
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::ArcScaleListStyleOnSetUpView [%d]", __LINE__);
+ if (ArcScaleList_ == nullptr || ArcScaleListAdapter_ == nullptr) {
+ return;
+ }
+
+ uint16_t startIndex = 0;
+ int16_t headY = 0;
+ if (presenter_->GetArcListStartIndex() >= presenter_->GetListItemNum()) {
+ startIndex = presenter_->GetListItemNum() - 1;
+ headY = VERTICAL_RESOLUTION / NUM_2;
+ } else {
+ uint16_t presliceId = NativeAbility::GetInstance().GetPreSliceId();
+ if (presliceId == VIEW_MAIN) //如果是从主页进入的,那么startIndex = 0,headY = 0
+ {
+ startIndex = 0;
+ headY = 0;
+ } else { //如果是从其他页面进入的,那么startIndex = presenter_->GetArcListStartIndex(),headY = presenter_->GetArcListHeadItemY()
+ startIndex = presenter_->GetArcListStartIndex();
+ headY = presenter_->GetArcListHeadItemY();
+ }
+ if (headY == 0) {
+ headY = VERTICAL_RESOLUTION / NUM_2;
+ }
+ }
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[%d],startIndex = %d,headY = %d", __LINE__,startIndex,headY);
+ ArcScaleList_->SetStartIndex(startIndex);//设置起始索引。
+ ArcScaleList_->SetAdapter(ArcScaleListAdapter_);
+ ArcScaleList_->ScrollBy(headY);//滚动到指定的 headY 位置。
+ return;
}
void ApplistView::OnTearDownView()
// WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ApplistView::ArcScaleListStyleOnStop [%d]", __LINE__);
ArcScaleListGroup_->RemoveAll();
}
+ int16_t arclistHeadY = ArcScaleList_->GetChildrenHead()->GetY();
+ int16_t arclistHeadIndex = ArcScaleList_->GetChildrenHead()->GetViewIndex();
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[%d],listHeadY = %d,listHeadIndex = %d", __LINE__,arclistHeadY,arclistHeadIndex);
+ presenter_->SetArcListHeadItemY(arclistHeadY); //设置头部Y坐标
+ presenter_->SetArcListStartIndex(arclistHeadIndex); //设置头部Index
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::ListStyleOnStop end...");
}
void ApplistView::AddAppItemToList(const AppItem &item)