MCPcopy Create free account
hub / github.com/9miao/CrossApp / changedFromPullToRefreshView

Method changedFromPullToRefreshView

CrossApp/view/CAScrollView.cpp:1147–1186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1145}
1146
1147void CAScrollView::changedFromPullToRefreshView()
1148{
1149 DSize size = this->getViewSize();
1150 float y = this->getContentOffset().y;
1151
1152 if (m_pHeaderRefreshView)
1153 {
1154 const DLayout& layout = DLayout(DHorizontalLayoutFill, DVerticalLayout_T_H(-128, 128));
1155 if (m_pHeaderRefreshView && m_pHeaderRefreshView->getSuperview() == NULL)
1156 {
1157 m_pHeaderRefreshView->setLayout(layout);
1158 this->addSubview(m_pHeaderRefreshView);
1159 }
1160 if (layout.vertical.top < y)
1161 {
1162 m_pHeaderRefreshView->setPullToRefreshStateType(CAPullToRefreshView::Normal);
1163 }
1164 else
1165 {
1166 m_pHeaderRefreshView->setPullToRefreshStateType(CAPullToRefreshView::Pulling);
1167 }
1168 }
1169 if (m_pFooterRefreshView)
1170 {
1171 const DLayout& layout = DLayout(DHorizontalLayoutFill, DVerticalLayout_B_H(-128, 128));
1172 if (m_pFooterRefreshView && m_pFooterRefreshView->getSuperview() == NULL)
1173 {
1174 m_pFooterRefreshView->setLayout(layout);
1175 this->addSubview(m_pFooterRefreshView);
1176 }
1177 if (size.height - m_obContentSize.height - layout.vertical.bottom > y)
1178 {
1179 m_pFooterRefreshView->setPullToRefreshStateType(CAPullToRefreshView::Normal);
1180 }
1181 else
1182 {
1183 m_pFooterRefreshView->setPullToRefreshStateType(CAPullToRefreshView::Pulling);
1184 }
1185 }
1186}
1187
1188void CAScrollView::detectionFromPullToRefreshView()
1189{

Callers 2

closeToPointMethod · 0.95
ccTouchMovedMethod · 0.95

Calls 7

getContentOffsetMethod · 0.95
addSubviewMethod · 0.95
DVerticalLayout_T_HFunction · 0.85
DVerticalLayout_B_HFunction · 0.85
getSuperviewMethod · 0.80
setLayoutMethod · 0.80

Tested by

no test coverage detected