Skip to content

Instantly share code, notes, and snippets.

@osiloke
Created December 4, 2015 14:51
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 osiloke/d125d57a653a434f13d1 to your computer and use it in GitHub Desktop.
Save osiloke/d125d57a653a434f13d1 to your computer and use it in GitHub Desktop.
coordinated recycleview
<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.v7.widget.RecyclerView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
style="@style/myRecyclerViewStyle"/>
<android.support.design.widget.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="com.progwebtech.gamer.ui.FlingBehaviour"
>
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
android:background="@color/white"
app:contentScrim="?attr/colorPrimary" >
<com.github.florent37.carpaccio.Carpaccio
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/vDetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_collapseMode="parallax"
app:register="
com.github.florent37.carpaccio.controllers.ImageViewController;
com.github.florent37.carpaccio.controllers.AnimationViewController;
com.github.florent37.carpaccio.controllers.TextViewController;
com.progwebtech.gamer.ui.controllers.ListViewController
">
<LinearLayout
style="@style/MdCardView.Full"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:layout_marginTop="80dp"
android:paddingLeft="20dp"
android:paddingRight="20dp">
<ImageView
style="@style/MdCardView.Small"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_margin="10dp"
android:layout_marginRight="10dp"
android:background="@color/md_grey_100"
android:tag="
enablePreview();
centerCrop()
animateMaterial(2000);
url($game.getImageProxyUrl());
" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
style="@style/AppMdText.Headline"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxLines="3"
android:text="$game.getName()" />
<TextView
style="@style/AppMdText.Caption"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxLines="3"
android:text="$game.getDeveloper()" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</com.github.florent37.carpaccio.Carpaccio>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/AppStyle.MdToolbar"
app:layout_collapseMode="pin"
app:navigationIcon="@drawable/ic_toolbar_close_white"
app:title="Add Game">
<TextView
style="@style/MdText.Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Add Game"
android:textColor="#fff" />
<Button
android:id="@+id/btnSubmit"
style="@style/MdButton.Flat.Primary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_gravity="right"
android:text="Ok"
android:textColor="#fff" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment