This is useful for cases when the view (tree) is created programmatically, e.g. because it's just a simple single view, because of dependency injection or for other reasons. The special value 0 was chosen because null already means "no header/footer/...". Passing zero for a layout resource skips the layout inflation and just calls the getXyzViewHolder() function directly. The parent is passed in mostly so that the Section implementation has access to the Context.
While this change does not break any existing use cases, it makes the interface slightly more confusing (should I add documentation?) and slightly less fool-proof (people might accidentally pass 0, though that's unlikely). Let me know what you think.
Hi @Philipp91, I wrote some suggestions regarding to the design in #98 👍
Please open future PRs to merge into develop branch, I will close this one for this reason.
This is useful for cases when the view (tree) is created programmatically, e.g. because it's just a simple single view, because of dependency injection or for other reasons. The special value
0
was chosen becausenull
already means "no header/footer/...". Passing zero for a layout resource skips the layout inflation and just calls thegetXyzViewHolder()
function directly. Theparent
is passed in mostly so that theSection
implementation has access to theContext
.While this change does not break any existing use cases, it makes the interface slightly more confusing (should I add documentation?) and slightly less fool-proof (people might accidentally pass
0
, though that's unlikely). Let me know what you think.