question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BottomAppBar] Replacing menu while changing fab alignment mode causes flickering

See original GitHub issue

Description: If you change the fab alignment mode and replace the menu in the BottomAppBar the items get replaced 2 times. It looks like the icons are flickering.

Expected behavior: There should be a smooth transition of the items if they change the side in the BottomAppBar. Also the animation should not be affected, if in this time the menu items change.

Source code:

controller.addOnDestinationChangedListener(new NavController.OnDestinationChangedListener(){
	@Override
	public void onDestinationChanged(@NonNull NavController controller, @NonNull NavDestination destination, @Nullable Bundle arguments){
		if (destination.getId() == R.id.homeFragment){
			bottomAppBar.setNavigationIcon(R.drawable.ic_menu);
			bottomAppBar.setFabAlignmentMode(BottomAppBar.FAB_ALIGNMENT_MODE_CENTER);
			bottomAppBar.replaceMenu(R.menu.home_fragment_menu);
		}else{
			bottomAppBar.setNavigationIcon(null);
			bottomAppBar.setFabAlignmentMode(BottomAppBar.FAB_ALIGNMENT_MODE_END);
			bottomAppBar.replaceMenu(R.menu.details_fragment_menu);
		}
	}
});

Android API version: 29

Material Library version: Material Android Library version you are using here (e.g., 1.2.0-alpha03)

Device: Pixel 3 Emulator

To help us triage faster, please check to make sure you are using the latest version of the library.

We also happily accept pull requests.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:7
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
adrielcafecommented, Feb 19, 2020

Same behavior with me. Tested with 1.1.0 and 1.2.0-alpha04.

In addition, the menu is replaced first and then the FAB moves, as you can see below:

ezgif com-optimize (1)

0reactions
DanteAndroidcommented, Jan 24, 2021

BottomAppBarDemo.zip @hunterstich Please check it out

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Blinking effect on bottom app bar when change ...
I want to change fab alignment and menu when I selecting an item in my list. The changes work great but the animation...
Read more >
Implementing Google's newly launched Bottom AppBar |
FAB Alignment Mode — app:fabAlignmentMode. FAB Attached — app:fabAttached ... and then change the BottomAppBar Alignment from CENTRE to END (vice/versa).
Read more >
Phone Screen Display Glitching, Flickering & Flashing - Updato
Before you sweat a bucket, check out our complete guide on how to fix Android screen flickering issue the easy way. In the...
Read more >
124.2.0 - Google Git
... change. (Alyssa Weiss); Fix Bottom sheet bug that was causing flickering. ... Add shape API to allow changing FAB's shape after it...
Read more >
Default Theme Changelog - Kendo UI for Vue - Telerik
Change variable name from $list-* to $kendo-list-* . menu: Convert monolithic menu styles to multiple class names; menu-button: Convert monolithic menu ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found