How to create Listview like android L's recent App listview

1.2k views Asked by At

I known about use of RecycleView and CardView but i want to create Listview that can work like android L Recent App listview .

You can check from this link .

below is screen shot of android 5.0 recent app list.

Android 5.0 Recent App list UI

3

There are 3 answers

1
MohK On

You can use carousal libraries like

http://code.google.com/p/carousel-layout-android/ which allows creating vertical carausal.

Or atleast you can have idea from the source code.

0
Antoine On

To complete previous answers (as I cannot comment),

In order to make http://code.google.com/p/carousel-layout-android/ work in vertical mode, you need 2 things :

  • In activity_main.xml, comment the HorizontalCarouselLayout and uncomment VerticalCarouselLayout
  • In MainActivity.java, comment the block dealing with HorizontalCarousel* and uncomment the one dealing with VerticalCarousel*

However, it doesn't work exactly like the recent apps display, since each swipe makes you move only one item in the list (there is no "fling" effect).

0
user3328051 On

As Mohammad Khatri said you can use

http://code.google.com/p/carousel-layout-android/

and change the activity_main.xml to

<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"
    tools:context=".MainActivity" 
    android:background="@android:color/darker_gray">

<!--     <com.touchmenotapps.carousel.simple.HorizontalCarouselLayout 
        android:id="@+id/carousel_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>  -->

  <com.touchmenotapps.carousel.simple.VerticalCarouselLayout 
        android:id="@+id/carousel_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/> 

</RelativeLayout>