You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 30, 2020. It is now read-only.
It requires 14+ API and android support v7 (Toolbar)
IMPORTANT NOTICE
This library is no longer supported.
I have not enough time to continue developing at this time and the android design support library implements the tabs features in the better way, so I think it is useless now. If anyone wants to keep alive this library they can send pull requests AFTER testing the code and exmplaining what they have changed and why. Thanks to all contributors
Dependency: Android-UI Reveal Color View
If you are using MaterialTabs in your app and would like to be listed here, please let me know via email!
How to use:
define it in xml layout with custom attributes
```xml
```
( I'm working on use wrap_content instead 48dp)
Connect to java code and add to viewPager
MaterialTabHosttabHost;
@OverrideprotectedvoidonCreate(BundlesavedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tabHost = (MaterialTabHost) this.findViewById(R.id.materialTabHost);
pager = (ViewPager) this.findViewById(R.id.viewpager);
// init view pagerpagerAdapter = newViewPagerAdapter(getSupportFragmentManager());
pager.setAdapter(pagerAdapter);
pager.setOnPageChangeListener(newViewPager.SimpleOnPageChangeListener() {
@OverridepublicvoidonPageSelected(intposition) {
// when user do a swipe the selected tab changetabHost.setSelectedNavigationItem(position);
}
});
// insert all tabs from pagerAdapter datafor (inti = 0; i < pagerAdapter.getCount(); i++) {
tabHost.addTab(
tabHost.newTab()
.setIcon(getIcon(i))
.setTabListener(this)
);
}
}
@OverridepublicvoidonTabSelected(MaterialTabtab) {
// when the tab is clicked the pager swipe content to the tab positionpager.setCurrentItem(tab.getPosition());
}
N.B. Your activity must extends ActionBarActivity implements MaterialTabListener