NavigationTabBar icon indicating copy to clipboard operation
NavigationTabBar copied to clipboard

A blinking issue occurs when changing the tab index.

Open greatsk55 opened this issue 8 years ago • 3 comments

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?

greatsk55 avatar Mar 06 '17 07:03 greatsk55

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.

pwa54rus avatar Nov 08 '17 08:11 pwa54rus

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 avatar Jul 07 '20 15:07 reza-khalafi

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

reza-khalafi avatar Jul 09 '20 10:07 reza-khalafi