Skip to content

Instantly share code, notes, and snippets.

@sharmadhiraj
Last active August 3, 2018 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sharmadhiraj/29aa3eaeb88e01a9e948e098908db1c7 to your computer and use it in GitHub Desktop.
Save sharmadhiraj/29aa3eaeb88e01a9e948e098908db1c7 to your computer and use it in GitHub Desktop.
Android Paging Library
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<TextView
android:id="@+id/txt_error"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="ERROR !! Tap to retry." />
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:listitem="@layout/item_news" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardBackgroundColor="#FFF"
card_view:cardCornerRadius="4dp"
card_view:cardElevation="2dp"
card_view:cardUseCompatPadding="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/img_news_banner"
android:layout_width="match_parent"
android:layout_height="200dp"
android:scaleType="fitXY"
tools:src="@mipmap/ic_launcher" />
<TextView
android:id="@+id/txt_news_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="12dp"
android:textColor="#333"
android:textSize="16sp"
tools:text="Sample news title" />
</LinearLayout>
</android.support.v7.widget.CardView>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment