daimajia / AndroidSwipeLayout

The Most Powerful Swipe Layout!
MIT License
12.38k stars 2.67k forks source link

requestLayout() improperly called by com.daimajia.swipes.SwipeLayout #323

Open JitenNumberTank opened 8 years ago

JitenNumberTank commented 8 years ago

hello sir,

I am getting this warinng in my layout.

requestLayout() improperly called by com.daimajia.swipes.SwipeLayout{c0559bb V.E...CL. ........ 0,768-1080,958 #7f0d0198 app:id/swipe} during second layout pass: posting in next frame

My layout is

<?xml version="1.0" encoding="utf-8"?>
<com.daimajia.swipes.SwipeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/swipe"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    >
    <!-- Bottom View Start-->
    <LinearLayout
        android:id="@+id/bottom_wrapper"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:background="#ff0000"
        android:orientation="vertical"
        android:weightSum="1">
        <!--What you want to show-->

        <com.code.Utils.OpenSansTextView
            android:id="@+id/unfollowSwipeTextView"
            android:layout_width="65dp"
            android:layout_height="match_parent"
            android:layout_marginLeft="8dp"
            android:layout_marginRight="8dp"
            android:gravity="center"
            android:text="Unfollow"
            android:textColor="@android:color/white"
            android:textSize="16dp" />

    </LinearLayout>

    <LinearLayout
        android:id="@+id/bottom_wrapper_left"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:background="@color/darkblue"
        android:orientation="vertical"
        android:weightSum="1">
        <!--What you want to show-->

        <com.code.Utils.OpenSansTextView
            android:id="@+id/markUnreadTextView"
            android:layout_width="65dp"
            android:layout_height="match_parent"
            android:layout_marginLeft="8dp"
            android:layout_marginRight="8dp"
            android:gravity="center"
            android:text="Mark Unread"
            android:textColor="@android:color/white"
            android:textSize="16dp" />

    </LinearLayout>
    <!-- Bottom View End-->

    <com.code.Utils.RippleView
        android:id="@+id/rippleView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <com.code.Utils.CircularImageView
            android:id="@+id/picImageView"
            android:layout_width="@dimen/dp_size"
            android:layout_height="@dimen/dp_size"
            android:layout_centerVertical="true"
            android:layout_marginBottom="5dp"
            android:layout_marginLeft="12dp"
            android:layout_marginTop="5dp"
            android:src="@drawable/profilepic" />

        <LinearLayout
            android:id="@+id/contentLinearLayout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginBottom="12dp"
            android:layout_marginLeft="12dp"
            android:layout_marginTop="12dp"
            android:layout_toLeftOf="@+id/ownerTextView"
            android:layout_toRightOf="@+id/picImageView"
            android:layout_weight="1"
            android:gravity="center_vertical"
            android:orientation="vertical">

            <com.code.Utils.OpenSansTextView
                android:id="@+id/nameTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:singleLine="true"
                android:text="User Name "
                android:textColor="@color/black"
                android:textSize="16dp" />

            <com.code.Utils.OpenSansTextView
                android:id="@+id/contentTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:singleLine="true"
                android:text="User Name"
                android:textColor="@color/graya7"
                android:textSize="13dp" />

        </LinearLayout>

        <com.code.Utils.OpenSansTextView
            android:id="@+id/countTextView"
            android:layout_width="50dp"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:background="@drawable/badge_circle"
            android:gravity="center"
            android:text="0"
            android:textColor="#FFF"
            android:textSize="10dp"
            android:visibility="gone" />

        <com.code.Utils.OpenSansTextView
            android:id="@+id/ownerTextView"
            android:layout_width="70dp"
            android:layout_height="30dp"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:layout_marginRight="10dp"
            android:gravity="center"
            android:text="owner"
            android:textColor="#ff0000"
            android:textSize="15dp"
            android:visibility="visible" />

        <ImageButton
            android:id="@+id/unfollowImageButton"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:background="@null"
            android:src="@drawable/remove"
            android:visibility="gone" />

        <com.code.Utils.OpenSansTextView
            android:id="@+id/timeTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight="true"
            android:padding="3dp"
            android:singleLine="true"
            android:text="2m"
            android:textColor="@color/graya7"
            android:textSize="10dp" />

    </com.code.Utils.RippleView>

    <!-- Surface View End -->
</com.daimajia.swipes.SwipeLayout>
LowLevelSubmarine commented 5 years ago

I had the exact same problem because I used an include layout. Maybe com.code.Utils.RippleView uses an include layout and therefore creates those warnings.