Giter VIP home page Giter VIP logo

gridpagersnaphelper's People

Contributors

hanhailong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gridpagersnaphelper's Issues

[bug] 描述如下

假如设置如下:

GridPagerSnapHelper gridPagerSnapHelper = new GridPagerSnapHelper();
gridPagerSnapHelper.setRow(3).setColumn(4);
gridPagerSnapHelper.attachToRecyclerView(mRecyclerView);

这时候,如果mRecyclerView的itemCount不是3*4的整数倍(例如36),则最后一页划不过去

底部indicator不准确的问题

在使用过程中发现,底部的indicator在滑动到最后一页时,底部的indicator的标记展示在倒数第二个上,经过查找代码,发现是在BasePageIndicator的recyclerView的OnScrollListener的事件处理的问题,代码如下:
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
LayoutManager layoutManager = recyclerView.getLayoutManager();
int position = 0;
if (layoutManager instanceof GridLayoutManager) {
GridLayoutManager gridLayoutManager = (GridLayoutManager) layoutManager;
position = gridLayoutManager.findFirstVisibleItemPosition(); //这句代码的问题
int row = gridLayoutManager.getSpanCount();
position = position / (row * mPageColumn);
} else if (layoutManager instanceof LinearLayoutManager) {
LinearLayoutManager linearLayoutManager = (LinearLayoutManager) layoutManager;
position = linearLayoutManager.findFirstVisibleItemPosition();
}
onPageSelected(position);
}
经过测试,发现在gridLayoutManager.findFirstVisibleItemPosition()在获取最后一页的第一个显示的item时的位置是错误的,比正确的position少了2,将该行代码修改如下,以上问题得到解决:
position = gridLayoutManager.findFirstCompletelyVisibleItemPosition();
修改后,得到的position的位置正确,以上问题得到解决。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.