[library] Handle View class correct on layout inflation

Fixes #6