SlidingUpPanelLayout,SwipeRefreshLayout和RecyclerView的正确层次结构

时间:2015-08-26 00:58:10

标签: android android-layout android-recyclerview swiperefreshlayout

我刚刚开始在以下布局中使用com.sothree.slidinguppanel.SlidingUpPanelLayout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:tools="http://schemas.android.com/tools"
              xmlns:app="http://schemas.android.com/apk/res-auto"
              tools:context="com.rburgosnavas.droidfs.MainActivityFragment"
              android:id="@+id/main_list_rec"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="vertical">

    <include layout="@layout/toolbar_main"/>

    <com.sothree.slidinguppanel.SlidingUpPanelLayout
        xmlns:sothree="http://schemas.android.com/apk/res-auto"
        android:id="@+id/sliding_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="bottom"
        sothree:umanoPanelHeight="68dp"
        sothree:umanoShadowHeight="4dp"
        sothree:umanoParalaxOffset="100dp"
        sothree:umanoDragView="@+id/dragView"
        sothree:umanoOverlay="true"
        sothree:umanoScrollableView="@+id/swipe_refresh_rec"
        >

        <!-- Main content -->
        <android.support.v4.widget.SwipeRefreshLayout
            android:id="@+id/swipe_refresh_rec"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            >
            <android.support.v7.widget.RecyclerView
                android:id="@+id/recycler_view"
                android:scrollbars="vertical"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                />
        </android.support.v4.widget.SwipeRefreshLayout>

        <!-- Draggable view -->
        <LinearLayout
            android:id="@+id/dragView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/bright_foreground_material_dark"
            android:orientation="vertical"
            android:clickable="true"
            android:focusable="false">
            <TextView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:text="LOL-LOL-LOL-LOL-LOL"
                />
        </LinearLayout>

    </com.sothree.slidinguppanel.SlidingUpPanelLayout>

</LinearLayout>

我面临的问题是RecyclerView始终没有响应滚动事件,而且我开始认为我的布局层次结构可能是错误的。由于我只想简单地开始,我在Java方面没有做任何事情,我不认为这是一个问题。

有没有任何指针?

0 个答案:

没有答案