Changing orientation from Landscape to Portrait & vice-versa keep the same width in SwipeRevealLayout

203 Views Asked by At

I'm using the chthai64/SwipeRevealLayout library, version 1.4.1, and when I change orientation from Portrait to Landscape or vice-versa, rows in Recycler view keep the same width giving improper size.

My activity has android:configChanges="orientation|keyboardHidden|screenSize"

XML:

<?xml version="1.0" encoding="utf-8"?>
<com.chauthai.swipereveallayout.SwipeRevealLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/swipe_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="10dp"
    android:padding="10dp"
    app:dragEdge="right"
    app:mode="same_level">

    <FrameLayout
        android:id="@+id/delete_layout"
        android:layout_width="wrap_content"
        android:layout_height="70dp"
        android:background="#ffcc0000">

        <TextView
            android:layout_width="70dp"
            android:layout_height="match_parent"
            android:background="@android:color/holo_red_dark"
            android:gravity="center"
            android:text="Delete"
            android:textColor="@android:color/white" />
    </FrameLayout>

    <FrameLayout
        android:id="@+id/front_layout"
        android:layout_width="match_parent"
        android:layout_height="70dp"
        android:background="@android:color/holo_blue_light">

        <TextView
            android:id="@+id/text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:gravity="center"
            android:textColor="@android:color/white"
            android:textSize="18sp" />
    </FrameLayout>
</com.chauthai.swipereveallayout.SwipeRevealLayout>

enter image description here

0

There are 0 best solutions below