Add dynamic tab support to TabLayout

TabLayout will now automatically invalidate
and re-populate itself when the linked PagerAdapter
has it's data set changed.

Two objects Pools are used to minimize churn when the
adapter is updated.

A small change had to be made to ViewPager + PagerAdapter's
observing functionality. Observable will always dispatch
changed events in reverse added order, which means that
ViewPager is the last to know. This means that any later
added Observer can't update the ViewPager (since it
doesn't know about the data set change yet). This is fixed
by moving ViewPager's observer out of the Observable and
always calling it first.

BUG: 20908355

Change-Id: I631620ff186047ae57e928db78f5ca77a0b80306
4 files changed