https://github.com/lopspower/gradientview
Create gradient view in Android in the simplest way possible 🌈
https://github.com/lopspower/gradientview
android gradientview
Last synced: 3 months ago
JSON representation
Create gradient view in Android in the simplest way possible 🌈
- Host: GitHub
- URL: https://github.com/lopspower/gradientview
- Owner: lopspower
- License: apache-2.0
- Created: 2019-08-19T12:59:11.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-06T09:19:42.000Z (over 5 years ago)
- Last Synced: 2025-06-20T14:18:09.998Z (4 months ago)
- Topics: android, gradientview
- Language: Kotlin
- Homepage:
- Size: 7.75 MB
- Stars: 198
- Watchers: 3
- Forks: 17
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
GradientView 🌈
=================
[](http://developer.android.com/index.html)
[](https://android-arsenal.com/api?level=14)
[](https://bintray.com/lopspower/maven/com.mikhaellopez:gradientview/1.1.0/link)
[](http://twitter.com/lopezmikhael)
[](https://app.codacy.com/app/lopspower/GradientView?utm_source=github.com&utm_medium=referral&utm_content=lopspower/GradientView&utm_campaign=Badge_Grade_Dashboard)This is an Android project allowing to realize a gradient View in the simplest way possible. Finish the gradient shapes of all colors in your projects.
USAGE
-----To make a gradient View add GradientView in your layout XML and add GradientView library in your project or you can also grab it via Gradle:
```groovy
implementation 'com.mikhaellopez:gradientview:1.1.0'
```XML
-----```xml
```
You must use the following properties in your XML to change your CircleView.
| Properties | Type | Default |
| -------------------- | ------------------------------------------------------------ | ------------- |
| `app:gv_start` | color | WHITE |
| `app:gv_alpha_start` | float (from 0.0 to 1.0) | 1f |
| `app:gv_end` | color | WHITE |
| `app:gv_alpha_end` | float (from 0.0 to 1.0) | 1f |
| `app:gv_direction` | left_to_right, right_to_left, top_to_bottom or bottom_to_top | left_to_right |KOTLIN
-----```kotlin
val gradientView = findViewById(R.id.gradientView)
gradientView.apply {
// Set Color Start
start = Color.RED
alphaStart = 0.5f
// Set Color End
end = Color.BLUE
alphaEnd = 0.5f
// Set Gradient Direction
direction = GradientView.GradientDirection.TOP_TO_BOTTOM
}
```JAVA
-----```java
GradientView gradientView = findViewById(R.id.gradientView);// Set Color Start
gradientView.setStart(Color.RED);
gradientView.setAlphaStart(0.5f);// Set Color End
gradientView.setEnd(Color.RED);
gradientView.setAlphaEnd(0.5f);// Set Gradient Direction
gradientView.setDirection(GradientView.GradientDirection.TOP_TO_BOTTOM);
```SUPPORT ❤️
-----Find this library useful? Support it by joining [**stargazers**](https://github.com/lopspower/GradientView/stargazers) for this repository ⭐️
And [**follow me**](https://github.com/lopspower?tab=followers) for my next creations 👍LICENCE
-----GradientView by [Lopez Mikhael](http://mikhaellopez.com/) is licensed under a [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).