https://github.com/dynamitechetan/flowing-gradient
Android Library to make a flowing gradient effect, similar to that used in Instagram Android login screen
https://github.com/dynamitechetan/flowing-gradient
android android-library colors gradient gradient-animations instagram transition
Last synced: 26 days ago
JSON representation
Android Library to make a flowing gradient effect, similar to that used in Instagram Android login screen
- Host: GitHub
- URL: https://github.com/dynamitechetan/flowing-gradient
- Owner: dynamitechetan
- Created: 2016-07-17T10:36:12.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-05-23T14:40:16.000Z (almost 6 years ago)
- Last Synced: 2025-03-29T02:04:56.136Z (about 1 month ago)
- Topics: android, android-library, colors, gradient, gradient-animations, instagram, transition
- Language: Java
- Homepage:
- Size: 220 KB
- Stars: 705
- Watchers: 15
- Forks: 89
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flowing Gradient Library
[](https://android-arsenal.com/details/1/3984)
[](http://www.apache.org/licenses/LICENSE-2.0.html)
[](https://github.com/dynamitechetan/Flowing-Gradient) Android ver 3.1+

## How to use
Add these lines in your build.gradle files:
##### In your Project Level build.gradle
```gradle
repositories {
jcenter()
}
```
##### In your App Level build.gradle```gradle
dependencies {
compile 'com.dynamitechetan.flowinggradient:flowinggradient:1.1'
}
```# Using Maven
```mavencom.dynamitechetan.flowinggradient
flowinggradient
1.1
pom```
## BASIC USAGE
```xml
```To set your own gradients and transition duration using XML, you must add this line in your xml file in the first component:
```xml
```
## Making your own Gradient Animations.
Make a file like this and place it in drawable folder
```xml
```
Making a Gradient in Android
```xml
```
## USING YOUR OWN ANIMATION GRADIENTS USING XML
```xml
```## SETTING TRANSITION DURATION USING XML
```xml
```# Using This Library in JAVA
## BASIC USAGE```java
RelativeLayout rl = (RelativeLayout) findViewById(R.id.rl);
FlowingGradientClass grad = new FlowingGradientClass();
grad.setBackgroundResource(R.drawable.translate)
.onRelativeLayout(rl)
.setTransitionDuration(4000)
.start();
```
####You are requested to use the methods in this order or sometimes it can end up in a null pointer exception.
```java
.onReltiveLayout() and be replaced by .onImageView() or .onLinearLayout() as per use.
```## To set Alpha of the transition
```java
RelativeLayout rl = (RelativeLayout) findViewById(R.id.rl);
FlowingGradientClass grad = new FlowingGradientClass();
grad.setBackgroundResource(R.drawable.translate)
.onRelativeLayout(rl)
.setTransitionDuration(4000)
.setAlpha(4)
.start();
```## License
Copyright (c) 2016 Chetan KaushikLicensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)