I am using SwipeRevealLayout for swipe-to-delete in recyclerview item.I have textview (height is not stable may vary) and swipe layout. When I have text more than 3 rows , swipelayout height doesnt change. It comes short.What can I do to make it have the same height as the text length ?
- <com.chauthai.swipereveallayout.SwipeRevealLayout
android:id="@+id/swipeLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:dragEdge="right"
app:mode="same_level">
<!-- swipe delete layout -->
<LinearLayout
android:id="@+id/delete_layout"
android:layout_width="64dp"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="64dp"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatImageButton
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:clickable="false"
android:padding="5dp"
/>
<TextView
style="@style/TextStyle.Bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/delete"
android:textColor="@color/colorWhite" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="horizontal">
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:layout_marginRight="4dp"
android:gravity="center_vertical"
android:minHeight="52dp"
android:orientation="vertical"
android:showDividers="middle"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
>
</ImageView><TextView
android:id="@+id/title"
style="@style/TextStyle"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="2dp"
android:paddingEnd="8dp"
android:layout_gravity="center"
android:paddingBottom="2dp"
</LinearLayout>
<TextView
android:id="@+id/itemText"
android:paddingTop="5dp"
android:layout_marginRight="10dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Test"/></LinearLayout>
<LinearLayout
android:id="@+id/iconArea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@+id/modelArea"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/modelArea">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
/></LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</LinearLayout>
</com.chauthai.swipereveallayout.SwipeRevealLayout>
Do you have any idea ?