Все работает хорошо, но проблема в том, что при смене изображения ползунка или при открытой клавиатуре BottomSheetBehavior уменьшил размер View. Есть ли способ остановить это
Открыть BottomSheetBehavior:
rl_comments.setSafeOnClickListener {
if (bottomSheetFilterBehavior.state != BottomSheetBehavior.STATE_EXPANDED) {
bottomSheetFilterBehavior.state = BottomSheetBehavior.STATE_EXPANDED
} else {
bottomSheetFilterBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED)
}
}
Закрыть BottomSheetBehavior:
view_collapse.setSafeOnClickListener {
if (bottomSheetFilterBehavior.state == BottomSheetBehavior.STATE_EXPANDED) {
bottomSheetFilterBehavior.state = BottomSheetBehavior.STATE_COLLAPSED
}
}
XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/bottom_sheet"
android:layout_width="match_parent"
android:layout_height="@dimen/_540sdp"
android:layout_gravity="bottom"
android:orientation="vertical"
android:background="#FFFDFDFD"
app:behavior_hideable="true"
app:behavior_peekHeight="0dp"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/bottomSection"
android:orientation="vertical">
<View
android:id="@+id/view_collapse"
android:layout_width="150dp"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:background="@drawable/bg_round_corner_open_sheet"
android:layout_height="10dp"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_commentList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_above="@+id/bottomSection"
/>
</LinearLayout>
<RelativeLayout
android:id="@+id/bottomSection"
android:layout_width="match_parent"
android:layout_height="@dimen/_55sdp"
android:layout_alignParentBottom="true"
android:background="@color/white">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_symBol"
android:layout_width="@dimen/_35sdp"
android:layout_height="@dimen/_35sdp"
app:srcCompat="@drawable/ic_spiritual_type_something"
android:padding="@dimen/_10sdp"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/_10sdp" />
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/et_messageText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/_5sdp"
android:layout_marginRight="@dimen/_5sdp"
android:background="@color/white"
android:ellipsize="end"
android:fontFamily="@font/regular"
android:hint="@string/hint_type_something"
android:inputType="text"
android:lineSpacingExtra="@dimen/_3sdp"
android:maxLines="5"
android:paddingLeft="@dimen/_10sdp"
android:paddingTop="@dimen/_10sdp"
android:paddingRight="@dimen/_10sdp"
android:paddingBottom="@dimen/_10sdp"
android:textColor="@color/black"
android:textColorHint="#63697B"
android:textSize="15sp"
android:layout_toRightOf="@+id/iv_symBol"
android:layout_centerVertical="true"
android:imeOptions="actionDone"
/>
</RelativeLayout>
</RelativeLayout>
GIf выпуска: