Created
May 16, 2018 09:14
-
-
Save paraya3636/53a19923685aa4203c0da720fcc191b7 to your computer and use it in GitHub Desktop.
[Android] programmatically gradient drawable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TopToBottomGradientDrawable(startColor: Int, endColor: Int, width: Int, height: Int) : GradientDrawable(Orientation.TOP_BOTTOM, arrayOf(startColor, endColor).toIntArray()) { | |
init { | |
shape = RECTANGLE | |
bounds = Rect(0, 0, width, height) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment