Navigation tab bar with colorful interactions.

Overview

Devlight


NavigationTabBar

Navigation tab bar with colorful interactions.

Android Arsenal       Android       Download       License       Codacy

You can check the sample app here.

Warn

This library is not more supported. 
If you want to add new feature or fix a bug, grab source code and do it. 
If you think your fix or feature would be useful to other developers, 
I can add link of your repository to this README file. 
Thank you for using our libraries.

Download

You can download a .aar from GitHub's releases page.

You can use Gradle:

compile 'devlight.io:navigationtabbar:1.2.5'

Or Maven:

<dependency>
    <groupId>devlight.io</groupId>
    <artifactId>navigationtabbar</artifactId>
    <version>1.2.5</version>
    <type>aar</type>
</dependency>

Or Ivy:

<dependency org='devlight.io' name='navigationtabbar' rev='1.2.5'>
  <artifact name='$AID' ext='pom'></artifact>
</dependency>

Android SDK Version

NavigationTabBar requires a minimum SDK version of 11.

Sample

Parameters

For NTB you can set such parameters as:

  • models:
    allows you to set NTB models, where you set icon and color. Can be set up only via code.

  • behavior:
    allows you to set bottom translation behavior.

  • view pager:
    allows you to connect NTB with ViewPager. If you want your can also set OnPageChangeListener.

  • background color:
    allows you to set background to NTB which automatically set with offset relative to badge gravity and corners radius.

  • model selected icon:
    allows you to set selected icon when current model is active.

  • model title:
    allows you to enable title in you model.

  • model badge:
    allows you to enable badge in you model.

  • use custom typeface on badge:
    allows you to handle set of custom typeface in your badge.

  • title mode:
    allows you to handle mode of the model title show. Can show all or only active.

  • title size:
    allows you to set titles size.

  • scale mode:
    allows you to handle mode of the model icon and title scale.

  • tint mode:
    allows you to enable or disable icon tinting.

  • badge size:
    allows you to set badges size.

  • badge position:
    allows you to set the badge position in you model. Can be: left(25%), center(50%) and right(75%).

  • badge gravity:
    allows you to set the badge gravity in NTB. Can be top or bottom.

  • badge colors:
    allows you to set the badge bg and title colors.

  • typeface:
    allows you to set custom typeface to your title.

  • corners radius:
    allows you to set corners radius of pointer.

  • icon size fraction:
    allows you to set icon size fraction relative to smaller model side.

  • 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.

Tips

Creation of models occurs through Builder pattern.
ModelBuilder requires two fields: icon and color. Title, badge title and selected icon is optional.

You can set selected icon. Resize and scale of selected icon equals to original icon.
Orientation automatically detected according to View size.

By default badge bg color is the active model color and badge title color is the model bg color. To reset colors just set AUTO_COLOR value to badge bg and title color.
By default badge sizes and title sizes is auto fit. To reset calculation just set AUTO_SIZE value to badge size and title size.
By default icon size fraction is 0.5F (half of smaller side of NTB model). To reset scale fraction of icon to automatic just put in method AUTO_SCALE value.

If your set ViewPager and enable swipe you can action down on active pointer and do like drag.

Init

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.Builder(
                getResources().getDrawable(R.drawable.ic_first),
                Color.parseColor(colors[0])
        ).title("Heart")
                .badgeTitle("NTB")
                .build()
);
models.add(
        new NavigationTabBar.Model.Builder(
                getResources().getDrawable(R.drawable.ic_second),
                Color.parseColor(colors[1])
        ).title("Cup")
                .badgeTitle("with")
                .build()
);
models.add(
        new NavigationTabBar.Model.Builder(
                getResources().getDrawable(R.drawable.ic_third),
                Color.parseColor(colors[2])
        ).title("Diploma")
                .badgeTitle("state")
                .build()
);
models.add(
        new NavigationTabBar.Model.Builder(
                getResources().getDrawable(R.drawable.ic_fourth),
                Color.parseColor(colors[3])
        ).title("Flag")
                .badgeTitle("icon")
                .build()
);
models.add(
        new NavigationTabBar.Model.Builder(
                getResources().getDrawable(R.drawable.ic_fifth),
                Color.parseColor(colors[4])
        ).title("Medal")
                .badgeTitle("777")
                .build()
);
navigationTabBar.setModels(models);
navigationTabBar.setViewPager(viewPager, 2);

navigationTabBar.setTitleMode(NavigationTabBar.TitleMode.ACTIVE);
navigationTabBar.setBadgeGravity(NavigationTabBar.BadgeGravity.BOTTOM);
navigationTabBar.setBadgePosition(NavigationTabBar.BadgePosition.CENTER);
navigationTabBar.setTypeface("fonts/custom_font.ttf");
navigationTabBar.setIsBadged(true);
navigationTabBar.setIsTitled(true);
navigationTabBar.setIsTinted(true);
navigationTabBar.setIsBadgeUseTypeface(true);
navigationTabBar.setBadgeBgColor(Color.RED);
navigationTabBar.setBadgeTitleColor(Color.WHITE);
navigationTabBar.setIsSwiped(true);
navigationTabBar.setBgColor(Color.BLACK);
navigationTabBar.setBadgeSize(10);
navigationTabBar.setTitleSize(10);
navigationTabBar.setIconSizeFraction(0.5);

If your models is in badge mode you can set title, hide, show, toggle and update badge title like this:

model.setTitle("Here some title to model");
model.hideBadge();
model.showBadge();
model.toggleBadge();
model.updateBadgeTitle("Here some title like NEW or some integer value");

To enable behavior translation inside CoordinatorLayout when at bottom of screen:

navigationTabBar.setBehaviorEnabled(true);

To deselect active index and reset pointer:

navigationTabBar.deselect();

Other methods check out in sample.

And XML init:

<devlight.io.library.ntb.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"
   app:ntb_badged="true"
   app:ntb_titled="true"
   app:ntb_scaled="true"
   app:ntb_tinted="true"
   app:ntb_title_mode="all"
   app:ntb_badge_position="right"
   app:ntb_badge_gravity="top"
   app:ntb_badge_bg_color="#ffff0000"
   app:ntb_badge_title_color="#ffffffff"
   app:ntb_typeface="fonts/custom_typeface.ttf"
   app:ntb_badge_use_typeface="true"
   app:ntb_swiped="true"
   app:ntb_bg_color="#000"
   app:ntb_icon_size_fraction="0.5"
   app:ntb_badge_size="10sp"
   app:ntb_title_size="10sp"/>

XML属性中文详解:

<devlight.io.library.ntb.NavigationTabBar 各属性详解
    全局:
    app:ntb_bg_color="#000"             ntb的背景颜色                可自定义
    app:ntb_active_color="#000"         ntb活动时的图标+标题颜色      可自定义
    app:ntb_inactive_color="#0f0"       ntb不活动时的图标+标题颜色    可自定义
    app:ntb_corners_radius="10dp"       ntb切换时的动画弧度大小       可自定义
    app:ntb_animation_duration="1000"   ntb切换时的动画时间           单位:ms
    图标相关:
    app:ntb_icon_size_fraction="1"      图标所占的大小比例            最佳值:0.5
    标题相关:
    app:ntb_titled="true"               是否显示图标所对应的标题       默认为false
    app:ntb_title_mode="active"         图片所对应的标题显示模式       active:活动时才显示 all:总是显示  PS:app:ntb_titled属性值为 true 时才可用
    app:ntb_title_size="10sp"           设置图标所对应的标题文字大小    请自定义
    勋章相关:
    app:ntb_badged="false"              是否显示勋章                  默认为false
    app:ntb_badge_gravity="top"         勋章的上下位置                top|bottom
    app:ntb_badge_position="right"      勋章的左右位置                left(25%), center(50%) and right(75%)
    app:ntb_badge_bg_color="#ffff0000"  勋章的背景颜色                可自定义
    app:ntb_badge_title_color="#000000" 勋章的标题文字颜色             可自定义 PS:不设置的话默认为切换动画的背景色
    app:ntb_badge_size="12sp"           勋章的标题文字大小             可自定义
    字体相关:
    app:ntb_badge_use_typeface="false"  是否使用自定义字体             默认为false
    app:ntb_typeface="fonts/by3500.ttf" 设置ntb的自定义字体            请将自定义的字体文件放在 asset/fonts 文件夹下
    其他:
    app:ntb_preview_colors="@array/colors"
    app:ntb_scaled="true"
    app:ntb_tinted="true"
    app:ntb_swiped="true"/>

Getting Help

To report a specific problem or feature request, open a new issue on Github.

Xamarin

Thanks to Martijn van Dijk for developing Xamarin bindings library for NavigationTabBar.
Plugin is available on Nuget.

use navbar using materialize css

navbar using materialize css is really easy and would take just assigning right classes to the html tags and it would create a navigation tab bar using its prewritten css and js files. This can be easily used in html pages using downloaded files or cdn links... https://materializecss.com/navbar.html

Credits

Sincere thanks, to portal FAnDroid.info (StartAndroid) who released the review of this library in detail. If you understand the Russian language, then feel free to see the video or read the text version of its great post.

Inspired by:

Sergey Valiukh

Thanks to Valery Nuzhniy for NTB badge design.

Author

Created by Basil Miller - @gigamole

Company

Facebook     Twitter     LinkedIn

Here you can see open source work developed by Devlight LLC.
This and another works is an exclusive property of Devlight LLC.

If you want to use this library in applications which will be available on Google Play, please report us about it or author of the library.

Whether you're searching for a new partner or trusted team for creating your new great product we are always ready to start work with you.

You can contact us via [email protected] or [email protected].
Thanks in advance.

Devlight LLC, 2016
devlight.io

Comments
  • menu without a title

    menu without a title

    I am a Chinese but English is not very good, I use your library, but the menu does not have a title, I try to use your demo,it dose not have a title too. I don't know what's wrong?

    help wanted question 
    opened by baoxin 33
  • Selected index

    Selected index

    How I can select index just to paint.

    Because, the method setModelIndex call method onStartTabSelected and reset my fragment and don't want this.

    I try to work with onBackPressed, when a fragment is removed and called who is top, then selected this tab. But how called onStartTabSelected this instance again. Thanks.

    PD: I can't show badge too.

    help wanted question 
    opened by juanlabrador 21
  • null object reference

    null object reference

    When I try to run my code I get this.

    I included you library from code

    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.graphics.Bitmap.isRecycled()' on a null object reference

    bug help wanted question 
    opened by MrThiago 15
  • Cannot get badges to show

    Cannot get badges to show

    Hi,

    Otherwise the NTB works like a charm, but I can't get the badges to show at all...

    Here's my layout xml: `

    <com.gigamole.navigationtabbar.ntb.NavigationTabBar
        android:id="@+id/main_ntb"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_alignParentTop="true"
        app:ntb_animation_duration="200"
        app:ntb_active_color="#ffffff"
        app:ntb_inactive_color="@color/grey"
        app:ntb_badged="true"
        app:ntb_titled="false"
        app:ntb_scaled="false"
        app:ntb_tinted="true"
        app:ntb_badge_position="right"
        app:ntb_badge_gravity="bottom"
        app:ntb_badge_bg_color="@color/theme_red"
        app:ntb_badge_title_color="#ffffff"
        app:ntb_swiped="true"
        app:ntb_bg_color="@color/dark_grey"
        app:ntb_badge_size="10sp"
        app:ntb_title_size="10sp" />
    
    <io.altru.lack.components.NonSwipeableViewPager
        android:id="@+id/viewpager"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_below="@+id/main_ntb"
        android:layout_alignParentBottom="true"
        android:background="@color/lightgrey" />
    

    `

    Here's the code for setting up my NTB:

    navigationTabBar = (NavigationTabBar) findViewById(R.id.main_ntb);

    final ArrayList<NavigationTabBar.Model> models = new ArrayList<>();

    IconDrawable browse = new IconDrawable(this, TypiconsIcons.typcn_home_outline).sizeDp(40);

    IconDrawable create = new IconDrawable(this, TypiconsIcons.typcn_camera).sizeDp(40);

    IconDrawable lists = new IconDrawable(this, TypiconsIcons.typcn_pin).sizeDp(40);

    models.add( new NavigationTabBar.Model.Builder(browse, getResources().getColor(R.color.theme_accent)) .build() );

    models.add( new NavigationTabBar.Model.Builder(create, getResources().getColor(R.color.theme_accent)) .build() );

    models.add( new NavigationTabBar.Model.Builder(lists, getResources().getColor(R.color.theme_accent)) .badgeTitle("Wee") .build() );

    navigationTabBar.setModels(models);

    navigationTabBar.setViewPager(viewPager, 0);

    navigationTabBar.setIsBadged(true);

    And finally, here's the code where I try to show the badge (pretty much copied from the sample app):

    navigationTabBar.postDelayed(new Runnable() { @Override public void run() { final NavigationTabBar.Model model = navigationTabBar.getModels().get(0); Log.v(TAG, "Is badge showing before: " + model.isBadgeShowed()); model.showBadge(); Log.v(TAG, "Is badge showing after: " + model.isBadgeShowed()); } }, 500);

    In the last code snippet, the model.isBadgeShowed() returns false on both calls, both before and after calling model.showBadge()

    Any help?

    help wanted 
    opened by juiceo 14
  • Fab Button layout_marginBottom=

    Fab Button layout_marginBottom="76dp" is not 16dp above from NavigationTabBar.

    Android Studio 2.1.3. gradle:2.1.3 compileSdkVersion 24 buildToolsVersion "24.0.0" minSdkVersion 14 targetSdkVersion 24

    compile 'com.android.support:design:24.2.0'
    compile 'com.android.support:appcompat-v7:24.2.0'
    compile 'com.github.devlight.navigationtabbar:navigationtabbar:1.2.5'
    

    It's not work good on SnakeBar showed.

    By use layout_marginBottom="76dp",the Fab Button is 16dp above from NavigationTabBar. But when SnakeBar showed ,it's 76dp+snakeBar's heigt above from NavigationTabBar.

    screenshot_2016-09-06-15-35-33_com lxt msgr screenshot_2016-09-06-15-35-34_com lxt msgr

    enhancement wontfix 
    opened by dyguests 13
  • Setting default Icon

    Setting default Icon

    i want to set a coloured icon , but it fills the default color in the icon. i want to keep my icon as it is coloured without setting any colour through nt_inactive_color .

    help wanted 
    opened by abumoallim 12
  • I can't make it show title

    I can't make it show title

    I use your NavigationTabBar in my project,But it is not work so better,it can not show title,can you please help me debug it?

    There is a part of code about it.

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:context="com.bigmercu.qinxinjiajiao.activity.bigmercuActivity"
        tools:showIn="@layout/activity_bigmercu">
        <com.gigamole.library.NavigationTabBar
            android:id="@+id/ntb"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:background="@color/colorPrimaryDark"
            app:ntb_animation_duration="400"
            app:ntb_preview_colors="@array/polluted_waves"
            app:ntb_active_color="#ffffff"
            app:ntb_inactive_color="#000000"
            app:ntb_badged="true"
            app:ntb_titled="true"
            app:ntb_title_mode="all"
            app:ntb_badge_position="right"
            app:ntb_badge_gravity="top"
            app:ntb_badge_use_typeface="true"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"/>
    </RelativeLayout>
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bigmercu);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        ButterKnife.bind(this);
    
        String[] colors = getResources().getStringArray(R.array.default_preview);
        ArrayList<NavigationTabBar.Model> models = new ArrayList<>();
        models.add(new NavigationTabBar.Model(
                getResources().getDrawable(R.drawable.ic_first), Color.parseColor(colors[0]), "首页"));
        models.add(new NavigationTabBar.Model(
                getResources().getDrawable(R.drawable.ic_second), Color.parseColor(colors[1]), "赵老师"));
        models.add(new NavigationTabBar.Model(
                getResources().getDrawable(R.drawable.ic_third), Color.parseColor(colors[2]), "周边家长"));
        models.add(new NavigationTabBar.Model(
                getResources().getDrawable(R.drawable.ic_fourth), Color.parseColor(colors[3]), "消息"));
        models.add(new NavigationTabBar.Model(
                getResources().getDrawable(R.mipmap.me), Color.parseColor(colors[4]), "我"));
    
        navigationTabBar.setBadgeGravity(NavigationTabBar.BadgeGravity.TOP);
        navigationTabBar.setBadgePosition(NavigationTabBar.BadgePosition.CENTER);
        navigationTabBar.setIsBadged(true);
        navigationTabBar.setIsTitled(true);
        navigationTabBar.setTitleMode(NavigationTabBar.TitleMode.ALL);
        navigationTabBar.setModels(models);
    

    Do you now why?

    bug help wanted question wontfix 
    opened by Lswks 12
  • get position without using view pager

    get position without using view pager

    Hi. in this library how can i found whats position of tab without using viewpager? i dont like to use view pager and i want to know current position when user scrolling

    question 
    opened by pishguy 6
  • Icons drawn lose their quality

    Icons drawn lose their quality

    In our project, we have 4 tabs, each tab icon has 2 states (active and inactive). So we create totally 8 icon images for those tabs. For each image, we generate images for different sizes like this:

    • xxxhdpi: 128 x 128 px
    • xxhdpi: 96 x 96 px
    • xhdpi: 64 x 64 px
    • hdpi: 48 x 48 px
    • mhdpi: 32 x 32 px

    However, when the app launches, the tab icons lose their quality:

    alt tag

    Do you have any idea how to fix this?

    Code:

    models.add(
                    new NavigationTabBar.Model.Builder(
                            getResources().getDrawable(R.drawable.grey_plane),
                            Color.parseColor(Constant.COLOR_TRANSPARENT)
                    ).selectedIcon(getResources().getDrawable(R.drawable.purple_plane_fulfill)).title("Flights")
                            .build()
            );
            models.add(
                    new NavigationTabBar.Model.Builder(
                            getResources().getDrawable(R.drawable.grey_bed),
                            Color.parseColor(Constant.COLOR_TRANSPARENT)
                    ).selectedIcon(getResources().getDrawable(R.drawable.purple_bed_fulfill)).title("Hotels")
                            .build()
            );
            models.add(
                    new NavigationTabBar.Model.Builder(
                            getResources().getDrawable(R.drawable.grey_history),
                            Color.parseColor(Constant.COLOR_TRANSPARENT)
                    ).selectedIcon(getResources().getDrawable(R.drawable.purple_history_fulfill)).title("Activity")
                            .build()
            );
            models.add(
                    new NavigationTabBar.Model.Builder(
                            getResources().getDrawable(R.drawable.grey_user),
                            Color.parseColor(Constant.COLOR_TRANSPARENT)
                    ).selectedIcon(getResources().getDrawable(R.drawable.purple_user_fulfill)).title("Me")
                            .build()
            );
            navigationTabBar.setModels(models);
            navigationTabBar.setViewPager(viewPager, 1);
            navigationTabBar.setTitleMode(NavigationTabBar.TitleMode.ALL);
            navigationTabBar.setIsTitled(true);
    

    in xml

     <com.gigamole.navigationtabbar.ntb.NavigationTabBar
                android:id="@+id/ntb"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:layout_marginTop="-8dp"
                app:ntb_animation_duration="200"
                app:ntb_active_color="@color/colorPrimary"
                app:ntb_inactive_color="@color/date_picker_text_normal"
                app:ntb_badged="true"
                app:ntb_scaled="false"
                app:ntb_title_mode="all"
                app:ntb_titled="true"
                app:ntb_typeface="fonts/Gotham-Book.otf" />
    
    enhancement help wanted 
    opened by minhkhang1795 6
  • Unable to build source after cloning. Help needed to set up the source

    Unable to build source after cloning. Help needed to set up the source

    Error:A problem occurred configuring root project 'NavigationTabBar'.

    Could not resolve all dependencies for configuration ':classpath'. Could not resolve com.github.dcendents:android-maven-gradle-plugin:1.3. Required by: :NavigationTabBar:unspecified > Could not resolve com.github.dcendents:android-maven-gradle-plugin:1.3. > Could not get resource 'https://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/1.3/android-maven-gradle-plugin-1.3.pom'. > Could not GET 'https://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/1.3/android-maven-gradle-plugin-1.3.pom'. > Connection to http://127.0.0.1:8888 refused Could not resolve com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1. Required by: :NavigationTabBar:unspecified > Could not resolve com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1. > Could not get resource 'https://jcenter.bintray.com/com/jfrog/bintray/gradle/gradle-bintray-plugin/1.1/gradle-bintray-plugin-1.1.pom'. > Could not GET 'https://jcenter.bintray.com/com/jfrog/bintray/gradle/gradle-bintray-plugin/1.1/gradle-bintray-plugin-1.1.pom'. > Connection to http://127.0.0.1:8888 refused

    help wanted 
    opened by sujanrao17 5
  • Incorrect selected icon on current index

    Incorrect selected icon on current index

    I create 2 models

    models.add(
                    new NavigationTabBar.Model.Builder(
                            getResources().getDrawable(R.drawable.grey_plane),
                            Color.parseColor(Constant.COLOR_TRANSPARENT)
                    ).selectedIcon(getResources().getDrawable(R.drawable.purple_plane_fulfill)).title("Flights")
                            .build()
            );
     models.add(
                    new NavigationTabBar.Model.Builder(
                            getResources().getDrawable(R.drawable.grey_bed),
                            Color.parseColor(Constant.COLOR_TRANSPARENT)
                    ).selectedIcon(getResources().getDrawable(R.drawable.purple_bed_fulfill)).title("Hotels")
                            .build()
            );
    

    and in xml:

       <com.gigamole.navigationtabbar.ntb.NavigationTabBar
                android:id="@+id/ntb"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:layout_marginTop="-8dp"
                app:ntb_animation_duration="200"
                app:ntb_bg_color="@android:color/white"
                app:ntb_active_color="@color/colorPrimary"
                app:ntb_inactive_color="@color/date_picker_text_normal"
                app:ntb_badged="true"
                app:ntb_scaled="false"
                app:ntb_title_mode="all"
                app:ntb_titled="true"
                app:ntb_swiped="false"
                app:ntb_typeface="fonts/Gotham-Book.otf" />
    

    So for each tab, I have 2 icons for 2 states:

    • Selected (with drawable R.drawable.grey_plane)
    • Unselected (with drawable R.drawable.purple_plane_fulfill).

    However, when changing the tab, the selected tab does not choose the selected icon/drawable, but chooses the unselected one with the active color app:ntb_active_color, and the tab next to the selected tab, weirdly, chooses the selected icon/drawable with the inactive color app:ntb_inactive_color`.

    I have updated to your newest version and met this problem.

    screen shot 2016-09-23 at 13 40 04

    wontfix 
    opened by minhkhang1795 4
  • ArrayIndexOutOfBounds Exception

    ArrayIndexOutOfBounds Exception

    My Code : ArrayList<NavigationTabBar.Model> models = new ArrayList<>(); final String[] colors = mFloatingView.getResources().getStringArray(R.array.vertical_ntb);

        models.add(new NavigationTabBar.Model.Builder(AppCompatResources.getDrawable(mFloatingView.getContext(), R.drawable.vector_player), Color.parseColor(colors[0])).title("Player").build());
        models.add(new NavigationTabBar.Model.Builder(AppCompatResources.getDrawable(mFloatingView.getContext(), R.drawable.vector_item), Color.parseColor(colors[1])).title("Items").build());
        models.add(new NavigationTabBar.Model.Builder(AppCompatResources.getDrawable(mFloatingView.getContext(), R.drawable.vector_vehicle), Color.parseColor(colors[2])).title("Vehicles").build());
        models.add(new NavigationTabBar.Model.Builder(AppCompatResources.getDrawable(mFloatingView.getContext(), R.drawable.vector_injector), Color.parseColor(colors[4])).title("Injector").build());
        models.add(new NavigationTabBar.Model.Builder(AppCompatResources.getDrawable(mFloatingView.getContext(), R.drawable.vector_esp_settings), Color.parseColor(colors[3])).title("Aimbot").build());
        if(!models.isEmpty())
                header_tabbar.setModels(models);
    
        viewpager.setPageTransformer(false, new CubeInTransformer());
        viewpager.setAdapter(new MyPagerAdapter(getApplicationContext()));
        viewpager.setOffscreenPageLimit(5);
        header_tabbar.setViewPager(viewpager, 0);
    

    Error Log : Fatal Exception: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.get(ArrayList.java:437) at androidx.viewpager.widget.ViewPager.fakeDragBy(ViewPager.java:2603) at devlight.io.library.ntb.NavigationTabBar.setModelIndex(NavigationTabBar.java:873) at devlight.io.library.ntb.NavigationTabBar$10.run(NavigationTabBar.java:1649) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:224) at android.app.ActivityThread.main(ActivityThread.java:7562) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

    Note : I am using PagerAdapter in a service with a viewpager

    I am unable to understand why does this error occured. Please help

    opened by Harshkanani 0
Releases(1.2.5)
Owner
Devlight
We deliver the right results in terms of efficiency, performance, interoperability, and user experience comprehensive technology.
Devlight
Library for Sliding Tab With Color Icons!

Sliding Tab With Color Icons Sliding Tab With Color Icons! Kindly use the following links to use this library: In build.gradle (Project) allprojects {

Prabhakar Thota 35 Jan 22, 2022
Animated Tab Bar is an awesome navigation extension that you can use to add cool, animated and fully customizable tab navigation in your apps

Animated Tab Bar is an awesome navigation extension that you can use to add cool, animated and fully customizable tab navigation in your apps. The extension provides handy methods and properties to change the behaviour as well as the appearance of the navigation bar.

Zain Ul Hassan 4 Nov 30, 2022
A progress bar with animation, gradient and colorful shadow.

Fancy Progressbar Android library providing a beautiful progressbar with colorful shadow, gradient and animation for Jetpack Compose. Download Add in

Fatemeh Afshari 5 Dec 25, 2022
Bottom-App-Bar-with-Bottom-Navigation-in-Jetpack-compose-Android - Bottom App Bar with Bottom Navigation in Jetpack compose

Bottom-App-Bar-with-Bottom-Navigation-in-Jetpack-compose-Android This is simple

Shruti Patel 1 Jul 11, 2022
NTabLayout is a simple tab bar custom view under android which has click-sliding and scaling up animation effect.

NTabLayout Brief NTabLayout is a simple tab bar custom view under android which has click-sliding and scaling up animation effect. This tab bar's effe

XellossRyan 1 Oct 22, 2021
Navigation tab strip with smooth interaction.

NavigationTabStrip Navigation tab strip with smooth interaction. You can check the sample app here. Warn This library is not more supported. If you w

Devlight 2.2k Jan 2, 2023
SystemUiController - Android Ui color controller (status bar, navigation bar)

SystemUiController Android system ui color controller (status bar, navigation bar) Download implementation "land.sungbin:systemuicontroller:${version}

Ji Sungbin 8 Dec 3, 2022
ModernStorage is a group of libraries that provide an abstraction layer over storage on Android to simplify its interactions

ModernStorage ModernStorage is a group of libraries that provide an abstraction layer over storage on Android to simplify its interactions by apps dev

Google 1.1k Dec 30, 2022
intera.kt is a Kotlin library for interacting with the Discord Interactions API through a gateway service or a REST API.

?? Overview ⚠️ WARNING: intera.kt is a work in progress. It is not yet ready for use. You may encounter bugs and other issues, but please report if yo

Pedro Henrique 1 Nov 30, 2021
intera.kt is a Kotlin library for interacting with the Discord Interactions API through a gateway service or a REST API.

?? Overview ⚠️ WARNING: intera.kt is a work in progress. It is not yet ready for use. You may encounter bugs and other issues, but please report if yo

Pedro Henrique 1 Nov 30, 2021
Sample project to demonstrate how to have clear and better interactions between composables and viewmodels.

Form Validation Sample project to demonstrate how to have clear and better interactions between composables and viewmodels. Concepts used uiState conc

Saurabh Pant 20 Dec 22, 2022
A colorful SeekBar for picking color

ScreenShot: Attrs attr format default colorSeeds references colorBarPosition integer 0 alphaBarPosition integer 0 maxPosition integer 100 bgColor colo

Jack Fu 324 Dec 26, 2022
Simple android view to display list of colorful tags efficiently.

Android TagView Simple android view to display collection of colorful tags efficiently. Library uses TextView as a base, and creates custom Spanes to

Michał Charmas 175 Nov 11, 2022
A smart colored time selector. Users can select just free time with a handy colorful range selector.

Colored Time Range Selector A smart colored time range selector. Users can select just free time with a handy colorful range selector. Screen Shots Fe

Ehsan Mehranvari 154 Oct 3, 2022
Colorful Sliders written with Jetpack Compose that enliven default sliders

???? ?? Colorful Sliders written with Jetpack Compose that enliven default sliders with track and thumb dimensions, and gradient colors, borders, labels on top or at the bottom move with thumb and ColorfulIconSlider that can display emoji or any Composable as thumb

Smart Tool Factory 70 Dec 30, 2022
Extended Android Tab Layout with animated indicators that have continuous feedback.

Dachshund Tab Layout Introduction Boosted Android Tab Layout with custom animated indicators including "Dachshund" animation inspired by this. Sample

Andrii 859 Nov 10, 2022
Library for Sliding Tab With Color Icons!

Sliding Tab With Color Icons Sliding Tab With Color Icons! Kindly use the following links to use this library: In build.gradle (Project) allprojects {

Prabhakar Thota 35 Jan 22, 2022
Will export all your words from LingQ to a tab-separated UTF-8 text file, Html, and Anki

LingQWordsExport Will export all your words from LingQ to a tab-separated UTF-8 text file, Html, and Anki. Here you can find a documentation page. Ins

Sergey Svistunov 2 Apr 21, 2022
Simple bottom navigation with side navigation drawer using Jetpack navigation UI made in Kotlin

BottomNavWithSideNavApp simple bottom navigation with side navigation drawer usi

Arvind Meshram 6 Oct 31, 2022
[] Action bar implementation which uses the native action bar on Android 4.0+ and a custom implementation on pre-4.0 through a single API and theme.

DEPRECATED ActionBarSherlock is deprecated. No more development will be taking place. For an up-to-date action bar backport use AppCompat. Thanks for

Jake Wharton 7.1k Dec 24, 2022