GoslingAllenLee / pull-to-refresh-view

Automatically exported from code.google.com/p/pull-to-refresh-view
0 stars 0 forks source link

小米2GridView不能下拉刷新 #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
用您的控件包裹GridView去实现上下拉,在其他测试机上出色发
挥了效果,但是在小米2上却不能达到下拉刷新的效果,基本�
��难出现下拉刷新,包括你的demo也不能实现效果。

Original issue reported on code.google.com by youzic...@gmail.com on 16 Apr 2013 at 10:08

GoogleCodeExporter commented 9 years ago
你好,问题我已经解决。
if (mAdapterView.getFirstVisiblePosition() == 0
    && Math.abs(top - padding) <= 11) {
    mPullState = PULL_DOWN_STATE;
    return true;
}
小米2这里会得出11。

Original comment by youzic...@gmail.com on 18 Apr 2013 at 1:44

GoogleCodeExporter commented 9 years ago
方便其他人查找位置再:
PullToRefreshView.java 这个文件中,
原来代码是:
if (mAdapterView.getFirstVisiblePosition() == 0
    && Math.abs(top - padding) <= 8) {
    mPullState = PULL_DOWN_STATE;
    return true;
}
楼上这位仁兄把 8 改成了 11,小米2 就ok 了! 
感谢楼上这位仁兄(youzic...@gmail.com)!

Original comment by chuanb...@gmail.com on 27 Apr 2013 at 9:34

GoogleCodeExporter commented 9 years ago
即使是改成11,也有可能在其它手机上出现这个问题,是否应
该考虑通过View.getScrollY()==0来判断更合适些?

Original comment by crazy.bi...@gmail.com on 14 Apr 2014 at 7:18