baoyongzhang / android-PullRefreshLayout

This component like SwipeRefreshLayout, it is more beautiful than SwipeRefreshLayout.
MIT License
2.07k stars 517 forks source link

RecyclerView with CardView-based items is not visible under PullRefreshLayout #29

Open oradkovsky opened 8 years ago

oradkovsky commented 8 years ago

Hi,

More details:

  1. general layout:

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">

<com.baoyz.widget.PullRefreshLayout
    android:id="@+id/swipe_refresh_layout_plans"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/plan_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true" />

...

  1. item layout:

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical">

<android.support.v7.widget.CardView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="@dimen/keyline_left_medium_mini"
    android:layout_marginRight="@dimen/keyline_left_medium_mini"
    android:layout_marginTop="@dimen/keyline_left_medium_mini"
    android:elevation="@dimen/cardview_default_elevation"
    app:cardCornerRadius="@dimen/cardview_default_radius">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

...

Once I move RecyclerView outside of PullRefreshLayout, it works as expected.