Visibility of expanding last view in the expandable RecyclerView

送分小仙女□ 提交于 2019-12-06 11:38:06
Vineeth Holla

I have found the solution which I wanted, I used

recyclerView.smoothScrollToPosition(selectedPosition);

after setting the adapter. So now the things in the last expandable item is fully visible when it is clicked.

Just a supplementary: If you use h6ah4i/advrecyclerview, you can use the following code snippet:

    @Override
    public boolean onHookGroupExpand(int groupPosition, boolean fromUser) {
        // NOTE21: collapse all other groups when one item expand.
        mExpMgr.collapseAll();

        // NOTE21: Visibility of expanding last view in the expandable recyclerview
        if (groupPosition == getGroupCount() - 1) {
            mRecyclerView.smoothScrollToPosition(groupPosition + getChildCount(groupPosition));
        }
        return true;
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!