# Grav **Repository Path**: aceyun/Grav ## Basic Information - **Project Name**: Grav - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2020-05-23 - **Last Updated**: 2025-12-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Grav [ ](https://bintray.com/glomadrian/maven/Grav/_latestVersion) [](http://www.apache.org/licenses/LICENSE-2.0) [](http://developer.android.com/index.html)
Grav is a library for android which allow you to make multiple animations based on points.
### Circular point generator
Generate points based on a cell and a variance in a circular shape.
```java
app:pointGenerator="com.github.glomadrian.grav.generator.point.CircularPointGenerator"
app:regular_cell_size="200"
app:regular_variance="200"
```
(Using in combination with GravBallGeneartor)
### Percent point generator
Generate the points based on percent locations array.
```java
app:pointGenerator="com.github.glomadrian.grav.generator.point.PercentPointGenerator"
app:percent_points_array="@array/walla_points_percent_points"
```
Inside arrays.xml each pair of items represents a point in the view, which is defined by a width percent and a height percent.
```java
## Grav Generator
Grav generator is the piece in charge of draw every point previously generated.
To use you need to set the attribute:
```java
app:gravGenerator="classname"
```
There are two Grav Generator available
### Ball generator
Draws a ball.
Ball sizes can be generated randomly within a range using the following attributes:
```java
app:gravGenerator="com.github.glomadrian.grav.generator.grav.BallGenerator"
app:ball_from_size="3dp"
app:ball_to_size="16dp"
```
### Rectangle generator
Draws rectangles.
Size of the rectangles can be changed using the following attributes:
```java
app:gravGenerator="com.github.glomadrian.grav.generator.grav.RectangleGenerator"
app:rectangle_width="15dp"
app:rectangle_height="10dp"
```
## Color generator
Decides how the Grav is painted.
To use you need to set the attribute:
```java
appcolorGenerator="classname"
```
There are two Color Generator available.
### Single color generator
Paint in one single color.
```java
app:colorGenerator="com.github.glomadrian.grav.generator.paint.SingleColorGenerator"
app:single_color="@color/colorPrimary"
```
### Array color generator
Paint using array of colors
```java
app:colorGenerator="com.github.glomadrian.grav.generator.paint.ArrayColorGenerator"
app:array_colors="@array/Spectral"
```
## Animation generator
The animation generator takes care of the position, size and properties animation. The animation generator can be one or an array of animation generators.
### Single animation generator
To use you need to set the attribute:
```java
app:animationGenerator="classname"
```
### Array animation generator
To use you need to set the attribute:
```java
app:animationGenerators="@array/array_reference"
### Side to side animator
Aniamtes the translation of the Grav to a different side.
```java
app:animationGenerator="com.github.glomadrian.grav.generator.animation.SideToSideAnimator"
//Min animation duration
app:side_to_side_min_duration="1000"
//Max animation duration
app:side_to_side_max_duration="3000"
//Direction leftToRight | rightToLeft | upToDown | downToUp
app:side_to_side_direction="leftToRight"
```
Also you can use a interpolator.
```java
side_to_side_interpolator="interpolator class"
```
### Alpha animator
Applies an alpha animation to a Grav.
```java
app:animationGenerator="com.github.glomadrian.grav.generator.animation.AlphaAnimator"
//Min animation duration
app:alpha_min_duration="1000"
//Max animation duration
app:alpha_max_duration="3000"
//From and to in a range (0-255)
app:alpha_from="0"
app:alpha_to="255"
```
### Ball size animator
Animates the size of the ball.
```java
app:animationGenerator="com.github.glomadrian.grav.generator.animation.BallSizeAnimator"
//Min animation duration
app:ball_size_min_duration="1000"
//Max animation duration
app:ball_size_max_duration="3000"
app:ball_size_from_size="3dp"
app:ball_size_to_size="8dp"
```
### Path animator
The path animator moves the grav following a path.
#### The path (sample)
```java
## XML Samples
The full samples can be found in the demo app source code.
```java
```java
```java
```java