Xiamen Customs Trade Pass app News swipe tab drop-down refresh bug fix

Source: Internet
Author: User

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:


    1. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.