@Test public void shouldSetTabsFromPagerAdapterInstance() { IconTabLayout iconTabLayout = new IconTabLayout(RuntimeEnvironment.application); iconTabLayout.setTabsFromPagerAdapter(pagerAdapter); assertThat(iconTabLayout.getTabAt(0)).hasIcon(null).hasText("barbers"); assertThat(iconTabLayout.getTabAt(1)).hasIcon(null).hasText("lumberjacks"); }
@Override public void setTabsFromPagerAdapter(@NonNull PagerAdapter adapter) { super.setTabsFromPagerAdapter( pageTitlesVisible ? adapter : TitleNullifyingPagerAdapter.from(adapter)); if (isLayoutPagerAdapterInstance(adapter)) { setTabIconsFromLayoutPagerAdapter((LayoutViewPager.LayoutPagerAdapter) adapter); } }
IconTabLayout extends TabLayout { @Override public void setTabsFromPagerAdapter(@NonNull PagerAdapter adapter) { super.setTabsFromPagerAdapter( pageTitlesVisible ? adapter : TitleNullifyingPagerAdapter.from(adapter)); if (isLayoutPagerAdapterInstance(adapter)) { setTabIconsFromLayoutPagerAdapter((LayoutViewPager.LayoutPagerAdapter) adapter); } } }
IconTabLayout extends TabLayout { @Override public void setTabsFromPagerAdapter(@NonNull PagerAdapter adapter) { super.setTabsFromPagerAdapter( pageTitlesVisible ? adapter : TitleNullifyingPagerAdapter.from(adapter)); if (isLayoutPagerAdapterInstance(adapter)) { setTabIconsFromLayoutPagerAdapter((LayoutViewPager.LayoutPagerAdapter) adapter); } } IconTabLayout(Context context);  IconTabLayout(Context context, AttributeSet attrs);  IconTabLayout(Context context, AttributeSet attrs, int defStyleAttr); }
IconTabLayout extends TabLayout { @Override public void setTabsFromPagerAdapter(@NonNull PagerAdapter adapter) { super.setTabsFromPagerAdapter( pageTitlesVisible ? adapter : TitleNullifyingPagerAdapter.from(adapter)); if (isLayoutPagerAdapterInstance(adapter)) { setTabIconsFromLayoutPagerAdapter((LayoutViewPager.LayoutPagerAdapter) adapter); } } IconTabLayout(Context context);  IconTabLayout(Context context, AttributeSet attrs);  IconTabLayout(Context context, AttributeSet attrs, int defStyleAttr); @Override void setTabsFromPagerAdapter(@NonNull PagerAdapter adapter); }
IconTabLayout extends TabLayout { @Override public void setTabsFromPagerAdapter(@NonNull PagerAdapter adapter) { super.setTabsFromPagerAdapter( pageTitlesVisible ? adapter : TitleNullifyingPagerAdapter.from(adapter)); if (isLayoutPagerAdapterInstance(adapter)) { setTabIconsFromLayoutPagerAdapter((LayoutViewPager.LayoutPagerAdapter) adapter); } } IconTabLayout(Context context);  IconTabLayout(Context context, AttributeSet attrs);  IconTabLayout(Context context, AttributeSet attrs, int defStyleAttr); @Override void setTabsFromPagerAdapter(@NonNull PagerAdapter adapter);  }