https://github.com/jeanboydev/android-wheelfortune
🤡幸运抽奖转盘,类似于StarMaker直播间抽奖。
https://github.com/jeanboydev/android-wheelfortune
fortune wheel
Last synced: 3 months ago
JSON representation
🤡幸运抽奖转盘,类似于StarMaker直播间抽奖。
- Host: GitHub
- URL: https://github.com/jeanboydev/android-wheelfortune
- Owner: jeanboydev
- License: mit
- Created: 2021-01-21T06:23:04.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-22T11:25:54.000Z (over 4 years ago)
- Last Synced: 2025-06-08T07:08:11.547Z (4 months ago)
- Topics: fortune, wheel
- Language: Kotlin
- Homepage:
- Size: 8.36 MB
- Stars: 65
- Watchers: 1
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WheelFortune
幸运抽奖转盘,类似于StarMaker直播间抽奖。
## 效果图




[点击查看效果视频](https://raw.githubusercontent.com/jeanboydev/Android-WheelFortune/main/resources/00.mp4)## 使用
- 设置布局
```xml
```
- 处理回调
```kotlin
val wheelFortuneView = findViewById(R.id.wheelFortuneView)
tv_user_count = findViewById(R.id.tv_user_count)wheelFortuneView?.setListener(object : WheelFortuneView.WheelStateListener {
override fun onJoinClick() {
// join 按钮点击时回调,移除 item
wheelFortuneView?.toRunning(0)
}override fun onCountChange(count: Int) {
// item 数量变化回调
tv_user_count?.text = resources.getString(R.string.user_count, count, dataList.size)
}override fun onRemove(removeData: ItemData) {
// item 移除时回调
}
})
```- 处理数据
```kotlin
// 添加数据
wheelFortuneView?.addData(dataList[index])// 清除数据
wheelFortuneView?.clearData()
```