Skip to content

Commit

Permalink
完善README
Browse files Browse the repository at this point in the history
  • Loading branch information
ooftf committed Dec 23, 2017
1 parent 5b56d05 commit 772be76
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Binary file added ImageRepository/SpialeLayout.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,45 @@
所以如果在Adapter getView根节点添加点击事件会导致和OnItemClickListener冲突
* 现阶段Adapter只支持Item存在一种样式 所以getItemViewType方法无效
* OnItemClickListener第三个参数itemData 是从adapter.getItem()中获取的
# 效果图
# Gradle配置
```groovy
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
compile 'com.github.ooftf:SpialeLayout:1.0.0'
}
```
# 使用方式
```xml
<com.ooftf.spiale.SpialeLayout
app:scrollMillis="1000"
app:showMillis="3000"
android:layout_marginTop="36dp"
android:id="@+id/spialeLayout"
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="#FFFFFF">
</com.ooftf.spiale.SpialeLayout>
```
```kotlin
BaseAdapter adapter = SpialeAdapter(this)
spialeLayout.adapter = adapter
spialeLayout.setOnItemClickListener{ position, _, itemData ->
itemData as Bean
Toast.makeText(this,"$position :: ${itemData.text}",Toast.LENGTH_SHORT).show()
}
```
# XML属性
|属性名|描述|默认值|
|---|---|---|
|scrollMillis|滚动动画时间(毫秒)|2000|
|showMillis|停止展示时间(毫秒)|2000|
# SpialeLayout方法
|方法名|描述|
|---|---|
|setAdapter|设置适配器|
|setOnItemClickListener|设置Item点击时间|

0 comments on commit 772be76

Please sign in to comment.