Friday 15 February 2013

Android Material Signature element with a listview -



Android Material Signature element with a listview -

i have layout consists of cover image (hero image) toolbar , listview.

on new material design guideline (like seen on checklist: tangible surfaces), when scroll list view, cover image should go behind toolbar , listview, toolbar should scroll top.

on google i/o 2014 app, can see feature under session activity. problem using scrollview have within it.

how can same thing listview instead?

[edit] : after release of new design back upwards library (http://android-developers.blogspot.co.uk/2015/05/android-design-support-library.html), solution using coordinator layout recyclerview. @endor anyway!

you can utilize framelayout root, add together imageview first kid cover , add together listview sec child.

like this:

<merge xmlns:android="http://schemas.android.com/apk/res/android" > <textview android:id="@+id/tv_splash" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/holo_blue_light" android:gravity="center" android:text="@string/app_name" android:textcolor="@android:color/black" android:textsize="24sp" > </textview> <listview android:id="@+id/lv_item" android:layout_width="match_parent" android:layout_height="match_parent" android:divider="#ca8500" android:dividerheight="1dp" > </listview> </merge>

obviously listview blocking imageview, trick here add together transparent header listview same height cover imageview.

then user scrolls listview, imageview covered real content of listview.

android listview toolbar material androiddesignsupport

No comments:

Post a Comment