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

TypedViewHolder.inflate may cause ClassCastException #325

Open
taig opened this issue Nov 16, 2017 · 1 comment
Open

TypedViewHolder.inflate may cause ClassCastException #325

taig opened this issue Nov 16, 2017 · 1 comment

Comments

@taig
Copy link
Member

taig commented Nov 16, 2017

TypedViewHolder.inflate forwards to LayoutInflater.inflate for the heavy lifting. Unfortunately the wrapper does not respect the quirky return value behavior of that method:

The root View of the inflated hierarchy. If root was supplied and attachToRoot is true, this is root; otherwise it is the root of the inflated XML file.

If the root View and the inflated layout have different View types, the cast in TypedViewHolder.inflate is illegal:

ev.create(inflater.inflate(layout.id, parent, attach).asInstanceOf[ev.V])
@taig
Copy link
Member Author

taig commented Nov 16, 2017

I will look into submitting a fix later, just leaving this here as a reminder

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

1 participant