So I have a floating action button (FAB) in a fragment, along with some buttons in the layout. Depending on which button is pressed, I would like to hide the FAB, then if another button is pressed, show the FAB. Basically I would like to toggle the visibility of the FAB in the same fragment. Is this a good design method, or should the FAB be always visible (except on scroll for some cases) if included?
IMO this would violate the material design practices. What I get from your question is that you have multiple actions assigned to FAB based on what selection user have selected.
The best practice is to keep a single action mapped to FAB. If you are on limited screen space, hiding the FAB would not violate the material design.
I think your approach would be a bad design practice since, user would get confused with multiple action FAB.