Vorolay
来源:互联网 发布:python 变量类型 编辑:程序博客网 时间:2024/06/07 07:25
Vorolay
VoronoiView is a view (ViewGroup) that allows you to add and display views inside Voronoi diagram regions. [Voronoi diagram] (https://en.wikipedia.org/wiki/Voronoi_diagram)
Screenshots
Import
Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
allprojects { repositories { ... maven { url 'https://jitpack.io' } }}
Step 2. Add the dependency
dependencies { compile 'com.github.Quatja:Vorolay:1.0.1'}
Usage
Add the view into your layout. You can customize it by using xml attributes
<quatja.com.vorolay.VoronoiView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="50dp" custom:border_color="@color/gray" custom:border_round="false" custom:border_width="5" />
Then add your views to the VoronoiView
VoronoiView voronoiView = (VoronoiView) findViewById(R.id.voronoi);LayoutInflater layoutInflater = getLayoutInflater();for (int i = 0; i < 15; i++) { View view = layoutInflater.inflate(R.layout.item_voronoi, null, false); voronoiView.addView(view);}
Now VoronoiView children will be displayed inside the diagram regions.
Customization
Attributes which you can use in customization purposes
Generation types
These attributes are available programmatically too.
Warning
Children visibility GONE doesn't work
Do not use tags for the children
Acknowledgements
Steven Fortune - algorithm author
Zhenyu Pan - Forutne algorithm Java version
Bart Kiers - Graham Scan realization
- Vorolay
- 二分法
- Python 结巴分词停止词及自定义词库
- DOM扩展:Selectors API(querySelector()和querySelectorALL())
- 小程序文档整理之 -- API(界面)
- innerHTML、innerText、outerHTML、outerText、text()、html()、val()、document.write、document.writeIn
- Vorolay
- Oracle—包和包体(转)
- 数据库,php和前端的关系!
- Spring + Mybatis框架下,数据库更新操作时只更新set过的字段
- 1-003.快速入门
- 【帝国CMS】列表页如何实现每隔5条记录加一个分隔线
- Ubuntu中压缩文件/解压文件的指令
- ConstraintLayout
- 实习一个月感悟