Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecyclerViewStateUtils #11

Closed
WxSmile opened this issue Mar 17, 2016 · 1 comment
Closed

RecyclerViewStateUtils #11

WxSmile opened this issue Mar 17, 2016 · 1 comment

Comments

@WxSmile
Copy link

WxSmile commented Mar 17, 2016

` public static LoadingFooter.State getFooterViewState(RecyclerView recyclerView) {

    RecyclerView.Adapter outerAdapter = recyclerView.getAdapter();
    if (outerAdapter != null && outerAdapter instanceof HeaderAndFooterRecyclerViewAdapter) {
        if (((HeaderAndFooterRecyclerViewAdapter) outerAdapter).getFooterViewsCount() > 0) {
            LoadingFooter footerView = (LoadingFooter) ((HeaderAndFooterRecyclerViewAdapter) outerAdapter).getFooterView();
            return footerView.getState();
        }
    }

    return LoadingFooter.State.Normal;
}`

你好,当我添加了一个不是LoadingFooter类型的FootView时,loadNextPage时 调用 LoadingFooter footerView = (LoadingFooter) ((HeaderAndFooterRecyclerViewAdapter) 强制转换会出问题。

@Neacy
Copy link

Neacy commented Apr 28, 2016

@WxSmile 这肯定会出问题的 若要使用自己的FootView需要修改他的源码。

@cundong cundong closed this as completed Apr 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants