cardslider-android
介绍:
一个基于LayoutManager的卡片划动效果。
运行效果:
使用说明:
Gradle:
'com.ramotion.cardslider:card-slider:0.1.0'
SBT:
libraryDependencies += "com.ramotion.cardslider" % "card-slider" % "0.1.0"
Maven:
<dependency>
<groupId>com.ramotion.cardslider</groupId>
<artifactId>card-slider</artifactId>
<version>0.1.0</version>
</dependency>
CardSlider是一个自定义的LayoutManager。
下面是一些可以在xml或者构造函数中设置的自定义属性:
-
activeCardLeft - Active card offset from start of RecyclerView. Default value is 50dp.
-
cardWidth - Card width. Default value is 148dp.
-
cardsGap - Distance between cards. Default value is 12dp.
对于卡片划动,有一个CardSnapHelper类:
...
@Override
protected void onCreate(Bundle savedInstanceState) {
...
recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
recyclerView.setLayoutManager(new CardSliderLayoutManager(this););
new CardSnapHelper().attachToRecyclerView(recyclerView);
...
}
已下载
0