DevLight-Mobile-Agency / NavigationTabBar
- вторник, 5 апреля 2016 г. в 03:12:17
Java
Navigation tab bar with colorful interactions.
Navigation tab bar with colorful interactions.
Horizontal NTB | Vertical NTB | NTB Samples |
---|---|---|
U can check the sample app here.
You can download a .aar` from GitHub's releases page.
Or use Gradle jCenter:
dependencies {
repositories {
mavenCentral()
maven {
url 'http://dl.bintray.com/gigamole/maven/'
}
}
compile 'com.github.devlight.navigationtabbar:library:+'
}
Or Gradle Maven Central:
compile 'com.github.devlight.navigationtabbar:library:1.0.0'
Or Maven:
<dependency>
<groupId>com.github.devlight.navigationtabbar</groupId>
<artifactId>library</artifactId>
<version>1.0.0</version>
<type>aar</type>
</dependency>
NavigationTabBar requires a minimum sdk version of 11.
For NTB you can set such parameters as:
models:
allows you to set NTB models, where you set icon color. Can be set up only via code.
view pager:
allows you to connect NTB with ViewPager. If you want your can also set OnPageChangeListener.
corners radius:
allows you to set corners radius of pointer.
animation duration:
allows you to set animation duration.
inactive color:
allows you to set inactive icon color.
active color:
allows you to set active icon color.
tab bar listener:
allows you to set listener which triggering on start or on end when you set model index.
preview colors:
allows you to set preview colors, which generate count of models equals to count of colors.
Orientation automatically detected according to view size.
If your set ViewPager you can action down on active pointer and do like drag.
Check out in code init:
final NavigationTabBar navigationTabBar = (NavigationTabBar) findViewById(R.id.ntb);
final ArrayList<NavigationTabBar.Model> models = new ArrayList<>();
models.add(new NavigationTabBar.Model(
getResources().getDrawable(R.drawable.ic_first), colors[0]));
models.add(new NavigationTabBar.Model(
getResources().getDrawable(R.drawable.ic_second), colors[1]));
models.add(new NavigationTabBar.Model(
getResources().getDrawable(R.drawable.ic_third), colors[2]));
models.add(new NavigationTabBar.Model(
getResources().getDrawable(R.drawable.ic_fourth), colors[3]));
models.add(new NavigationTabBar.Model(
getResources().getDrawable(R.drawable.ic_fifth), colors[4]));
navigationTabBar.setModels(models);
navigationTabBar.setViewPager(viewPager, 2);
Other methods check out in sample.
And XML init:
<com.gigamole.library.NavigationTabBar
android:id="@+id/ntb"
android:layout_width="match_parent"
android:layout_height="50dp"
app:ntb_animation_duration="400"
app:ntb_preview_colors="@array/colors"
app:ntb_corners_radius="10dp"
app:ntb_active_color="#fff"
app:ntb_inactive_color="#000"/>
To report a specific problem or feature request, open a new issue on Github.
Apache 2.0 and MIT. See LICENSE file for details.
Tapbar interections | Circle interactions |
---|---|
model with title
model with badge
Made in DevLight Mobile Agency
Created by Basil Miller - @gigamole