It seems to do everything according to the guidelines from Google, and when you call the bot itself, it is superimposed on top of the fragment layout

@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View v = inflater.inflate(R.layout.fragment_fragment_help, container, false); View bottomSheet = v.findViewById(R.id.bottom_shit); mBottomSheetBehavior = BottomSheetBehavior.from(bottomSheet); final LinearLayout test = (LinearLayout) v.findViewById(R.id.calls); test.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); } }); mBottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() { @Override public void onStateChanged(@NonNull View bottomSheet, int newState) { // React to state change } @Override public void onSlide(@NonNull View bottomSheet, float slideOffset) { // React to dragging events } }); return v; } 
  • one
    But where should he fit in yours? - xkor
  • @xkor to the fragment for which I call him - Alex
  • one
    You confused me. So should he, in your opinion, be superimposed on the fragment's layout or not? In a question like you want it to be superimposed on something else, in here you answer that it should on the layout layout. - xkor
  • @xkor Apparently incorrectly identified the question. I have a fragment layout on which I have labeled a bot in the onCreationView method. And on this layout he should appear. More precisely, it appears, but it is transparent - behind it you can see the xml of the fragment layout - Alex
  • one
    Well, set for R.id.bottom_shit background you need, from where the bat knows that you need a non-transparent background. PS: I’m a little dumb and read only the contents of the question, not the title, so I didn’t understand what transparency doesn’t suit you. - xkor

1 answer 1

The BottomSheet background is completely up to you, it simply displays the view you gave it on top of the layout, if your view has a transparent background, then it will be displayed with that background. So just give her the background you want.

  • If you are about setBackgroundColor () then it does not help. Still transparent but with a touch of color I chose - Alex
  • and even in the layout, if you change the background anyway, the text and others take a shine through the color bot-shirt - Alex
  • And everything is ready. Thanks for the help - Alex