Add missing PreferenceLayouts when querying item type

If a preference object's layout or widget layout changes after it's added
it won't appear in the list of PreferenceLayout objects, so we'll mistakenly
return -1 as the item type and then won't have a clue what to inflate in
onCreatViewHolder. Thus we need to ensure we fill in any missing PreferenceLayout
objects when checking the view type.

The majority of PreferenceLayout objects are still created during hierarchy
refresh, to keep things performant during scrolling etc.

b/24961118

Change-Id: I11be124594eb4ccbf006612238227c96d5b64af8
1 file changed