Android实现自动滚动的瀑布流:ListBuddies

jopen 11年前

一对自动滚动循环视差ListViews像Expedia的应用程序主页上的效果。

Android实现自动滚动的瀑布流:ListBuddies

用法

你需要在你的XML布局中声明下面的视图

<com.jpardogo.listbuddies.lib.views.ListBuddiesLayout       xmlns:android="http://schemas.android.com/apk/res/android"      android:id="@+id/listbuddies"      android:layout_width="match_parent"      android:layout_height="match_parent"/>

有一堆的布局可选的自定义属性:

<com.jpardogo.listbuddies.lib.views.ListBuddiesLayout          xmlns:listbuddies="http://schemas.android.com/apk/res-auto"          android:id="@+id/listbuddies"          android:layout_width="match_parent"          android:layout_height="match_parent"          listbuddies:speed="2"          listbuddies:gap="@dimen/gap"          listbuddies:fillGap="@color/frame"          listbuddies:listsDivider="@drawable/divider"          listbuddies:listsDividerHeight="@dimen/divider_height"          listbuddies:autoScrollFaster="right"          listbuddies:scrollFaster="left"/>

属性说明:

  • speed: Sets the auto scroll speed (integer). 0 - no autoScroll
  • gap: Space between the lists, the default gap is 3dp (@dimen/default_margin_between_lists).
  • fillGap: Defines the color of the gap, if it is not set the gap is transparent
  • listDivider: Defines the lists dividers.
  • listsDividerHeight: Divider´s height.
  • autoScrollFaster: Indicate the ListView that will be faster on the parrallax effect during autoScroll. right/left.
  • scrollFaster: Indicate the ListView that will be faster on the parrallax effect during manual scroll. right/left.

项目主页:http://www.open-open.com/lib/view/home/1392023341973