https://github.com/scionoftech/materialtabs
A small project for Marerial Design Tabs.
https://github.com/scionoftech/materialtabs
Last synced: 6 months ago
JSON representation
A small project for Marerial Design Tabs.
- Host: GitHub
- URL: https://github.com/scionoftech/materialtabs
- Owner: scionoftech
- License: isc
- Created: 2015-08-10T17:13:11.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-08-14T15:25:43.000Z (over 10 years ago)
- Last Synced: 2025-05-18T05:13:37.538Z (8 months ago)
- Language: Java
- Size: 457 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#MaterialTabs
A small project for Marerial Design Tabs.
This project uses SlidingTabLayout.java & SlidingTabStrip.java from Google I/O [IOsched](https://github.com/google/iosched/tree/master/android/src/main/java/com/google/samples/apps/iosched/ui/widget)
```java
// Creating The ViewPagerAdapter and Passing Fragment Manager, Titles fot the Tabs and Number Of Tabs.
adapter = new ViewPagerAdapter(getSupportFragmentManager(), Titles, Numboftabs);
// Assigning ViewPager View and setting the adapter
pager = (ViewPager) findViewById(R.id.pager);
pager.setAdapter(adapter);
// Assiging the Sliding Tab Layout View
tabs = (SlidingTabLayout) findViewById(R.id.tabs);
tabs.setDistributeEvenly(true); // To make the Tabs Fixed set this true, This makes the tabs Space Evenly in Available width
// Setting Custom Color for the Scroll bar indicator of the Tab View
tabs.setCustomTabColorizer(new SlidingTabLayout.TabColorizer() {
@Override
public int getIndicatorColor(int position) {
return getResources().getColor(R.color.tabsScrollColor);
}
});
// Setting the ViewPager For the SlidingTabsLayout
tabs.setViewPager(pager);
```
[]()
## License
[ISC](LICENSE)