All Projects → Bakumon → LuckPan

Bakumon / LuckPan

Licence: other
幸运转盘,可以控制选中指定的奖项。

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to LuckPan

Frames
Retrieves desired frames from video.
Stars: ✭ 51 (+240%)
Mutual labels:  view
FillProgressLayout
A simple and flexible Fillable Progress Layout written in Kotlin
Stars: ✭ 77 (+413.33%)
Mutual labels:  view
AndroidAnimationView
🚌🚌🚌android 动画、自定义控件,学习记录demo
Stars: ✭ 30 (+100%)
Mutual labels:  view
Android-FilterView
Build a simple filter view with customizable controls.
Stars: ✭ 20 (+33.33%)
Mutual labels:  view
VideoTimelineView
Video timeline UI for iOS Apps
Stars: ✭ 103 (+586.67%)
Mutual labels:  view
SwiftyExcelView
A View Look Like Excel & Form
Stars: ✭ 45 (+200%)
Mutual labels:  view
bpmn-visualization-js
A TypeScript library for visualizing process execution data on BPMN diagrams
Stars: ✭ 113 (+653.33%)
Mutual labels:  view
LockerScreen
Android lock screen,slide to unlock ! 安卓锁屏,上滑解锁,效果酷炫,值得拥有!
Stars: ✭ 81 (+440%)
Mutual labels:  view
TimelineView
No description or website provided.
Stars: ✭ 18 (+20%)
Mutual labels:  view
PlayView
一个仿有道词典播放音乐的控件
Stars: ✭ 13 (-13.33%)
Mutual labels:  view
FlowlayoutTags
具有标签功能的流式布局,接口简单。可多选单选,可记住选择状态,状态切换有过渡动画。
Stars: ✭ 78 (+420%)
Mutual labels:  view
BSLoader
It's to show loading animations
Stars: ✭ 13 (-13.33%)
Mutual labels:  view
material-chip-view
Material Chip view. Can be used as tags for categories, contacts or creating text clouds
Stars: ✭ 1,300 (+8566.67%)
Mutual labels:  view
ModernUI
Modern desktop framework from low-level 3D graphics API to high-level view model, for development of 2D/3D rendering software or game engine, with internationalization support and many new technologies.
Stars: ✭ 168 (+1020%)
Mutual labels:  view
CheckableTextView
A simple and flexible Checked TextView or Checkable TextView
Stars: ✭ 108 (+620%)
Mutual labels:  view
DynamicViewPagerDemo
ViewPager单屏显示多页面,动画效果
Stars: ✭ 49 (+226.67%)
Mutual labels:  view
SkeletonPlaceholderView
A library for creating dynamic skeleton view
Stars: ✭ 25 (+66.67%)
Mutual labels:  view
MyCircleMenu
Android-自定义view之圆形与“半圆形”菜单
Stars: ✭ 33 (+120%)
Mutual labels:  view
TabBar
📱 TabBar – highly customizable tab bar for your SwiftUI application.
Stars: ✭ 105 (+600%)
Mutual labels:  view
PulseInstrument
脉象仪 波形实时绘制 Demo
Stars: ✭ 30 (+100%)
Mutual labels:  view

LuckPan

幸运转盘,可以控制选中指定的奖项。如下图,选择 ID 为 6 的奖项,在转盘停止后,选中 ID 为 6 的奖项。

demo下载

screenshot

最近项目中用到了转盘抽奖,才知道抽奖原来这么坑,转盘转动只是给用户看看而已。和点击按钮直接显示出抽奖结果的区别就是等、等、等,看着转盘揪心。

需求:

  1. 转盘上奖项的个数以及奖项的值通过调用接口确定
  2. 点击“开始抽奖”按钮,调接口成功后,停在接口返回的指定位置

API:

方法 参数 说明
setPrizeVoList(List<PrizeVo>) PrizeVo 实体集合,PrizeVo 实体包含 ID、title 等属性 (必须)设置奖项集合
setDarkColor(int) 颜色,如 Color.rgb(82, 182, 197) (非必须,有默认)设置转盘上的深色
setShallowColor(int) 颜色,如 Color.rgb(186, 226, 232) (非必须,有默认)设置转盘上的浅色色
setCircleNumRange(int, int) 转动圈数的范围,如 9~15 (非必须,有默认)设置转动圈数的范围
setOneCircleMillisRange(long, long) 每圈平均用时毫秒数的范围,如 400~600 (非必须,有默认)设置平均转动一圈用时的范围
setOnLuckPanAnimatorEndListener(listener) 转盘停止监听器 (非必须)设置转盘停止监听器
start(int) 选中奖项的 ID (必须)转盘开始转动,并停在 ID 值对应的位置上

使用

1.得到奖项数据集合

List<PrizeVo> prizeVoList = new ArrayList<>();
PrizeVo prizeVo;
for (int i = 0; i < 16; i++) {
    prizeVo = new PrizeVo();
    prizeVo.id = i + "";
    prizeVo.rate = i + "";
    prizeVo.title = "×" + i;
    prizeVoList.add(prizeVo);
}

2.转盘设置奖项数据

// 转盘设置奖项集合
mLuckPan.setPrizeVoList(prizeVoList);

3.开始转动

// 转到 ID 为 3 的奖项停止
mLuckPan.start(3);

可选:设置转动停止监听器

mLuckPan.setOnLuckPanAnimatorEndListener(new LuckPan.OnLuckPanAnimatorEndListener() {
    @Override
    public void onLuckPanAnimatorEnd(PrizeVo choicePrizeVo) {
        Toast.makeText(MainActivity.this, "选中的ID:" + choicePrizeVo.id, Toast.LENGTH_SHORT).show();
    }
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].