Giter Site home page Giter Site logo

gradientview's Introduction

GradientView ๐ŸŒˆ

sample

Platform API Download
Twitter Codacy 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.

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

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

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 for this repository โญ๏ธ
And follow me for my next creations ๐Ÿ‘

LICENCE

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

gradientview's People

Contributors

lopspower avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.