Skip to content

Repository files navigation

GradientView 🌈

sample

PlatformAPIDownload
TwitterCodacy Badge

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.

Android app on Google Play

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:

implementation 'com.mikhaellopez:gradientview:1.1.0'

XML

<com.mikhaellopez.gradientview.GradientView
android:id="@+id/gradientView"android:layout_width="match_parent"android:layout_height="match_parent"app:gv_direction="left_to_right"app:gv_end="#d32e2e"app:gv_start="#3f51b5" />

You must use the following properties in your XML to change your CircleView.

PropertiesTypeDefault
app:gv_startcolorWHITE
app:gv_alpha_startfloat (from 0.0 to 1.0)1f
app:gv_endcolorWHITE
app:gv_alpha_endfloat (from 0.0 to 1.0)1f
app:gv_directionleft_to_right, right_to_left, top_to_bottom or bottom_to_topleft_to_right

KOTLIN

val gradientView = findViewById<GradientView>(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

GradientViewgradientView = findViewById(R.id.gradientView);
// Set Color StartgradientView.setStart(Color.RED);
gradientView.setAlphaStart(0.5f);
// Set Color EndgradientView.setEnd(Color.RED);
gradientView.setAlphaEnd(0.5f);
// Set Gradient DirectiongradientView.setDirection(GradientView.GradientDirection.TOP_TO_BOTTOM);

SUPPORT ❤️

Find this library useful? Support it by joining stargazers for this repository ⭐️
And follow me for my next creations 👍

LICENCE

GradientView by Lopez Mikhael is licensed under a Apache License 2.0.

About

Create gradient view in Android in the simplest way possible 🌈

Topics

Resources

Stars

195 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages