android - SwipeRefreshLayout in fragment bigger than the tab containing it -


i have tablayout inside appbarlayout, , viewpager in activity. fragments loaded inside tabs. 1 fragment has recyclerview inside swiperefreshlayout. when running, fragment occupies whole screen overlapping tabs , appbar.

activity.xml

<android.support.design.widget.coordinatorlayout 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="match_parent">      <android.support.design.widget.appbarlayout         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:theme="@style/themeoverlay.appcompat.dark.actionbar">          <android.support.v7.widget.toolbar             android:id="@+id/toolbar"             android:layout_width="match_parent"             android:layout_height="?attr/actionbarsize"             android:background="?attr/colorprimary"             app:layout_scrollflags="scroll|enteralways"             app:popuptheme="@style/themeoverlay.appcompat.light" />          <android.support.design.widget.tablayout             android:id="@+id/tabs"             android:layout_width="match_parent"             android:layout_height="wrap_content"             app:tabmode="fixed"             app:tabgravity="fill"/>      </android.support.design.widget.appbarlayout>      <android.support.v4.view.viewpager         android:id="@+id/viewpager"         android:layout_width="match_parent"         android:layout_height="match_parent" /> </android.support.design.widget.coordinatorlayout> 

fragment.xml

<android.support.v4.widget.swiperefreshlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/swipe_refresh_layout"     android:layout_width="match_parent"     android:layout_height="match_parent">      <android.support.v7.widget.recyclerview         android:id="@+id/recycler_view"         android:paddingtop="15dp"         android:layout_width="match_parent"         android:layout_height="match_parent"/>  </android.support.v4.widget.swiperefreshlayout> 

how contain fragment inside tablayout?enter image description here


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -