Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A blinking issue occurs when changing the tab index. #90

Open
greatsk55 opened this issue Mar 6, 2017 · 3 comments
Open

A blinking issue occurs when changing the tab index. #90

greatsk55 opened this issue Mar 6, 2017 · 3 comments

Comments

@greatsk55
Copy link

tab.kt code :

models.add(
                NavigationTabBar.Model.Builder(
                        ContextCompat.getDrawable(this, R.drawable.and_general_bottom_bar_home_normal_bt),
                        ContextCompat.getColor(this, R.color.white))
                        .selectedIcon(ContextCompat.getDrawable(this, R.drawable.and_general_bottom_bar_home_active_bt))
                        .build()
        )
        models.add(
                NavigationTabBar.Model.Builder(
                        ContextCompat.getDrawable(this, R.drawable.and_general_bottom_bar_list_normal_bt),
                        ContextCompat.getColor(this, R.color.white))
                        .selectedIcon(ContextCompat.getDrawable(this, R.drawable.and_general_bottom_bar_list_active_bt))
                        .build()
        )

and xml code :

<devlight.io.library.ntb.NavigationTabBar
                android:id="@+id/ntb"
                android:layout_width="match_parent"
                android:layout_height="@dimen/tab_height"
                android:background="@drawable/and_bottom_bar_navi_bg"
                app:ntb_badge_gravity="top"
                app:ntb_badge_position="right"
                app:ntb_badged="true"
                app:ntb_bg_color="@color/white"
                app:ntb_icon_size_fraction="0.75"
                app:ntb_scaled="false"
                app:ntb_tinted="false"
                app:ntb_swiped="true"
                app:ntb_titled="false"/>

When I run the above code, whenever I change the tab, the image changes from inactive to active, causing the flickering to occur. I think it looks awkward. Is there a way to fix it?

@pwa54rus
Copy link

pwa54rus commented Nov 8, 2017

I think, you mean fade animation between normal and selected icon state. Am i right? Try not use "selectedIcon" method. This way, fade animation doesn't start, but you will have only one icon state.

@reza-khalafi
Copy link

This library unusable because of this problem. when change to another button of tab bar image has flashing. Is there a way to fix it?

@reza-khalafi
Copy link

I think i found the solution finally.
Just need to add this code to xml file like this:
app:ntb_animation_duration="0"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants