BottomBar: problem with badge cut

Create a bottombar with 2 behavior app:bb_behavior="shy|shifting" bagde is cut out. badge issue

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Comments: 33 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Release?

@xvarlez feel free to send a PR, i always try to look at them as quickly as possible, and the feature we haven’t spend time fixing it, because a new “big” version change is coming, is just i haven’t had free time to finish it 😦

@marcserrascmspain sorry if is taking long, but, you have to remember we all have day jobs, and mine is taking most of my time lately, but, i do intent on fixing it, i hope this next week i get some slack so that i can finish it and release the 3.0 version that introduces a lot of new features and fixes.

Any updates on this guys? Release date estimation? This would be really useful.

I have been experiencing this issue in my own app but was unable to reproduce it in the sample demo app.

I managed to identify the source of this bug as the animation. The badge is displayed at the end of the animation on the icon:

animator.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                if (!isActive && badge != null) {
                    badge.adjustPositionAndSize(BottomBarTab.this);
                    badge.show();
                }
            }
        });

However, there seems to be a problem with the onAnimationEnd() listener in the Android platform. Several people online have been reporting inconsistent behaviour (cf. Stackoverflow) where it’s triggered but the animation hasn’t finished.

I managed to solve this by replacing the faulty listener with a postDelayed() call:

postDelayed(new Runnable() {
            @Override
            public void run() {
                if (!isActive && badge != null) {
                    clearAnimation();
                    badge.adjustPositionAndSize(BottomBarTab.this);
                    badge.show();
                }
            }
        }, animator.getDuration());

Not really “clean” but I really need this feature to work 😅 Haven’t been able to reproduce the issue since this fix. Let me know if you want me to send a PR @roughike @yombunker

Is it going to be resolved in the short term? The issue is from 2 month ago 😦

@trihung93 Temporary you can use app:bb_behavior=“shy | iconsOnly” to resolve this problem.