I want to use a BottomSheetLayout
for different cases like as a SearchBar
with search results when user is actively searching and also to show a RecyclerView
with different items, buttons, etc. when user is not searching.
In general, this requires different views which has to be conditionally shown in the BottomSheetLayout.
One approach I know is to create the corresponding views and change the visibility. Second approach is to add/remove views to the parent view. Let's say that the container is a ConstraintLayout
.
I want to know what is the best approach in respect to performance, usability and complexity. Maybe there are other possibilities that I don't know yet.