I needed to implement a layout which is similar to Google Chrome's stack of tabs as shown below .
Are there any libraries available for this ?
I needed to implement a layout which is similar to Google Chrome's stack of tabs as shown below .
Are there any libraries available for this ?
You need to create a set custom drawables for each aspect of the card and use them in the layout. You can use table layout for this purpose.
For example to put a background with corners you can create a drawable as follows:
Add new drwabe resource as follows:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<corners android:radius="5dp"/>
<stroke android:width="1dp" android:color="choose the color which you want"/>
<padding android:top="10dp" android:left="10dp" android:bottom="10dp"
android:right="10dp"/>
</shape>
Create a custom style and use the above drawable as background:
<style name="ContactTextView">
<item name="android:background">@drawable/drawableName</item>
// add other items
</style>
Apply the style on each item in your layout
Use a RecyclerView with your own LayoutManager. The layoutmanager can than stack it like this. To implement behaviour (like expanding an item on click) you need more code. I coudlnt find an open source project which has this.
Have a look here for help:
http://wiresareobsolete.com/2014/09/building-a-recyclerview-layoutmanager-part-1/
http://wiresareobsolete.com/2014/09/recyclerview-layoutmanager-2/
http://wiresareobsolete.com/2015/02/recyclerview-layoutmanager-3/