package com.navigation.reactnative;

import android.content.Context;
import android.view.ViewGroup;

import androidx.coordinatorlayout.widget.CoordinatorLayout;

import com.facebook.react.uimanager.PixelUtil;
import com.google.android.material.bottomsheet.BottomSheetBehavior;

public class BottomSheetView extends ViewGroup {
    public BottomSheetView(Context context) {
        super(context);
        CoordinatorLayout.LayoutParams params = new CoordinatorLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        params.setBehavior(new BottomSheetBehavior());
        setLayoutParams(params);
    }

    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        BottomSheetBehavior.from(this).setPeekHeight((int) PixelUtil.toPixelFromDIP(200));
    }

    @Override
    protected void onLayout(boolean b, int i, int i1, int i2, int i3) {
    }
}

@@ -540,16 +540,17 @@
     
-params.s
+BottomShe
 etBe
@@ -559,14 +559,10 @@
 vior
-(new B
+ b
 otto
@@ -579,141 +579,34 @@
 vior
-());%0A        setLayoutParams(params);%0A    %7D%0A%0A    @Override%0A    protected void onAttachedToWindow() %7B%0A        super.onAttachedToWindow
+ = new BottomSheetBehavior
 ();%0A
@@ -605,33 +605,33 @@
 vior();%0A        
-B
+b
 ottomSheetBehavi
@@ -637,19 +637,8 @@
 ior.
-from(this).
 setP
@@ -685,16 +685,98 @@
 (200));%0A
+        params.setBehavior(bottomSheetBehavior);%0A        setLayoutParams(params);%0A
     %7D%0A%0A 

Set behavior prop before added to window