In the Xiamen Customs trade and trade app phase close to the end of the stage, found a bug: Sliding tab to refresh the page, when the news ListView slide down, and then slide down, can not be slippery, but directly refresh the bug, such as.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/72/85/wKiom1XlXtSCNXLRAAG2qSSIVg0202.jpg "title=" Customs Project News dropdown refresh Bug "alt=" Wkiom1xlxtscnxlraag2qssivg0202.jpg "/>
Solve:
Adapter, activity, fragment three files in a number of log after the problem locked in
The last return value of Checkcandorefresh () in Viewpagerfragment is always true. 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/72/86/wKiom1XlX_bCYSqLAAR3AcqapeA064.jpg "title=" 2015090101.png "alt=" wkiom1xlx_bcysqlaar3acqapea064.jpg "/> Targeted log Discovery Getfirstvisiblposition and Getchildat (0). GetTop (), this two value is always 0, which is estimated to be an event that intercepts both properties of the ListView.
2. Then monitor the Mlistview scrolling event in the Initview
Mlistview.setonscrolllistener (New Onscrolllistener () {
@Override
public void onscrollstatechanged (Abslistview view, int scrollstate) {
TODO auto-generated Method Stub
LOG.E ("viewpagerfragment_scrollstatechanged", "Scrollstate:" +scrollstate);
LOG.E ("viewpagerfragment_scrollstatechanged", "Mlistview.getchildat (0). GetTop ():" +mlistview.getchildat (0). GetTop ());
Gettop=mlistview.getchildat (0). GetTop ();
}
@Override
public void Onscroll (Abslistview view, int firstvisibleitem,
int visibleitemcount, int totalitemcount) {
Mfirstvisibleitem=firstvisibleitem;
Then use the member shaping variables Mfirstvisibleitem, GetTop, instead of Getfirstvisiblposition and Getchildat (0). GetTop (), problem solving.
The sliding drop-down Refresh tab prototype reference my blog 100+android Open source project Subtotal One (boutique) The third Open source project Android-ultra-pull-to-refresh.
Xiamen Customs Trade Pass app News swipe tab drop-down refresh bug fix