AddViewToRootContainer(contentList_);
}
+void ApplistView::ListStyleOnSetUpView(void)
+{
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::ListStyleOnSetUpView [%d]", __LINE__);
+ uint16_t startIndex = 0;
+ int16_t headY = 0;
+ if (presenter_->GetStartIndex() >= 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 = 68;
+ } else { //如果是从其他页面进入的,那么startIndex = presenter_->GetArcListStartIndex(),headY = presenter_->GetArcListHeadItemY()
+ startIndex = presenter_->GetArcListStartIndex();
+ headY = presenter_->GetArcListHeadItemY();
+ }
+ if (headY == 0) {
+ headY = VERTICAL_RESOLUTION / NUM_2;
+ }
+ }
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "startIndex = %d, headY = %d\n", startIndex, headY);
+ contentList_->SetAdapter(listAdapter_);
+ contentList_->ScrollTo(startIndex);
+ contentList_->ScrollBy(headY);
+ contentList_->RefreshList();
+ return;
+}
+
+
void ApplistView::ResumeWaterFallDraggable()
{
if (waterfallList_ != nullptr) {
ArcScaleListStyleOnSetUpView();
} else if (style == AppListStyle::CIRCLE_LIST_STYLE) {
// 拨号盘
- } else {
- uint16_t startIndex = 0;
- int16_t headY = 0;
- if (presenter_->GetStartIndex() >= presenter_->GetListItemNum()) {
- startIndex = presenter_->GetListItemNum() - 1;
- headY = VERTICAL_RESOLUTION / NUM_2;
- } else {
- startIndex = presenter_->GetStartIndex();
- headY = presenter_->GetHeadItemY();
- if (headY == 0) {
- headY = VERTICAL_RESOLUTION / NUM_2;
- }
- }
- contentList_->SetAdapter(listAdapter_);
- contentList_->ScrollTo(startIndex);
- contentList_->ScrollBy(headY);
- contentList_->RefreshList();
+ } else if (style == AppListStyle::APPLIST_STYLE) {
+ ListStyleOnSetUpView();
}
}