Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Quatja/Vorolay
VoronoiView is a view (ViewGroup) that allows you to add and display views inside Voronoi diagram regions.
https://github.com/Quatja/Vorolay
Last synced: 2 months ago
JSON representation
VoronoiView is a view (ViewGroup) that allows you to add and display views inside Voronoi diagram regions.
- Host: GitHub
- URL: https://github.com/Quatja/Vorolay
- Owner: Quatja
- License: apache-2.0
- Created: 2016-12-30T08:33:59.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-11T11:49:28.000Z (almost 6 years ago)
- Last Synced: 2024-07-31T18:16:28.096Z (5 months ago)
- Language: Java
- Homepage:
- Size: 2.44 MB
- Stars: 923
- Watchers: 19
- Forks: 127
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- -awesome-android-ui - Vorolay - 2.0) | <img src="/art/Vorolay.png" width="49%"> <img src="/art/Vorolay2.png" width="49%"> (Index `(light-weight pages)`)
- awesome-android-ui - Vorolay - 2.0) | <img src="/art/Vorolay.png" width="49%"> <img src="/art/Vorolay2.png" width="49%"> (Index `(light-weight pages)`)
- awesome-android-ui - Vorolay - 2.0) | <img src="/art/Vorolay.png" width="49%"> <img src="/art/Vorolay2.png" width="49%"> (Index)
README
# Vorolay
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![](https://jitpack.io/v/Quatja/Vorolay.svg)](https://jitpack.io/#Quatja/Vorolay)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Vorolay-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/5001)
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
![alt text](https://github.com/Quatja/Vorolay/raw/master/Screenshots/screenshot_1.png "Simple diagram")
![alt text](https://github.com/Quatja/Vorolay/raw/master/Screenshots/screenshot_2.png "Settings")
![alt text](https://github.com/Quatja/Vorolay/raw/master/Screenshots/screenshot_3.png "List view")
![alt text](https://github.com/Quatja/Vorolay/raw/master/Screenshots/screenshot_4.png "Custom views")## Import
Step 1. Add the JitPack repository to your build fileAdd it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependencydependencies {
compile 'com.github.Quatja:Vorolay:1.0.1'
}
---------## Usage
Add the view into your layout. You can customize it by using xml attributes
```xml
```
Then add your views to the VoronoiView
```java
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
| attr | value/example | description |
| --------------- |:--------------:| ---------------------------------------------:|
| show_border | true | shows or hides each region borders |
| border_color | #fff | sets all borders color |
| border_width | 5 | sets borders width |
| border_round | true | makes border corners round |
| generation_type | random | sets different points generation behavior |### Generation types
| type | description |
| --------------- | -------------------------------------------------------------------------:|
| random | VoronoiView generates a random point positions inside the view bounds. |
| ordered | points are placed like a table - rows and columns. |
| custom | points will be placed in user defined positions. |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---------
## License
```xml
Copyright 2016 Daniil JurjevLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```