use of android.support.design.widget.TabLayout in project materialistic by hidroh.
the class BaseListActivityLandTest method testToggleItemView.
@Test
public void testToggleItemView() {
activity.onItemSelected(createWebItem());
TabLayout tabLayout = (TabLayout) activity.findViewById(R.id.tab_layout);
assertEquals(2, tabLayout.getTabCount());
assertStoryMode();
tabLayout.getTabAt(0).select();
assertCommentMode();
tabLayout.getTabAt(1).select();
assertStoryMode();
}
use of android.support.design.widget.TabLayout in project materialistic by hidroh.
the class UserActivityTest method testScrollToTop.
@Config(shadows = ShadowRecyclerView.class)
@Test
public void testScrollToTop() {
verify(userManager).getUser(eq("username"), userCaptor.capture());
userCaptor.getValue().onResponse(user);
RecyclerView recyclerView = (RecyclerView) activity.findViewById(R.id.recycler_view);
recyclerView.smoothScrollToPosition(1);
assertThat(customShadowOf(recyclerView).getScrollPosition()).isEqualTo(1);
TabLayout.Tab tab = ((TabLayout) activity.findViewById(R.id.tab_layout)).getTabAt(0);
tab.select();
tab.select();
assertThat(customShadowOf(recyclerView).getScrollPosition()).isEqualTo(0);
}
use of android.support.design.widget.TabLayout in project Timber by naman14.
the class MainFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
Toolbar toolbar = (Toolbar) rootView.findViewById(R.id.toolbar);
((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
ab.setHomeAsUpIndicator(R.drawable.ic_menu);
ab.setDisplayHomeAsUpEnabled(true);
viewPager = (ViewPager) rootView.findViewById(R.id.viewpager);
if (viewPager != null) {
setupViewPager(viewPager);
viewPager.setOffscreenPageLimit(2);
}
TabLayout tabLayout = (TabLayout) rootView.findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager);
return rootView;
}
use of android.support.design.widget.TabLayout in project XposedInstaller by rovo89.
the class DownloadDetailsActivity method setupTabs.
private void setupTabs() {
mPager = (ViewPager) findViewById(R.id.download_pager);
mPager.setAdapter(new SwipeFragmentPagerAdapter(getFragmentManager()));
TabLayout mTabLayout = (TabLayout) findViewById(R.id.sliding_tabs);
mTabLayout.setupWithViewPager(mPager);
}
use of android.support.design.widget.TabLayout in project RecyclerViewPager by lsjwzh.
the class MaterialDemoActivity method initTabLayout.
private void initTabLayout() {
//给TabLayout增加Tab, 并关联ViewPager
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
TabLayoutSupport.setupWithViewPager(tabLayout, mRecyclerView, mAdapter);
}
Aggregations