Skip to content

Instantly share code, notes, and snippets.

@JcMinarro
Created October 19, 2014 10:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JcMinarro/e5431b60f057904b72b0 to your computer and use it in GitHub Desktop.
Save JcMinarro/e5431b60f057904b72b0 to your computer and use it in GitHub Desktop.
SwipeRefreshLayout Example
<RelativeLayout 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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
tools:context="com.jcminarro.android.tools.views.fragments.FilmsFragment">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_films"
android:animateLayoutChanges="true"
android:dividerHeight="@dimen/margin_normal"
android:divider="@android:color/transparent"
app:paddingStart="10dp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</android.support.v4.widget.SwipeRefreshLayout>
<ProgressBar
android:id="@+id/pb_loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"/>
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment