I've checked other posts having this problem and they said use <merge>
instead of <include>
but when i use <merge>
it shows red in my fragment.xml
file, there is no such tag. How can i solve this error?
In my fragment.xml
:
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/product_variation_bottom_sheet" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
In my Fragment.kt
:
var view = inflater.inflate(R.layout.bottom_sheet, container, false)
bottomSheetBehavior = BottomSheetBehavior.from(view.findViewById(R.id.bottomSheet))
In my bottom_sheet.xml
:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/productVariationBottomSheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/bottom_sheet_behavior"
app:behavior_peekHeight="0sp"
app:behavior_hideable="true"
android:background="#00000000"
xmlns:app="http://schemas.android.com/apk/res-auto">
//some other views
</LinearLayout>