Created
July 27, 2015 23:53
-
-
Save lilac/101aaf745fba988614c5 to your computer and use it in GitHub Desktop.
Create a rounded color drawable with a border
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
// This snippet is from http://stackoverflow.com/questions/17667964/how-to-create-shape-with-solid-corner-stroke-in-java-code | |
int strokeWidth = 5; // 3px not dp | |
int roundRadius = 15; // 8px not dp | |
int strokeColor = Color.parseColor("#2E3135"); | |
int fillColor = Color.parseColor("#DFDFE0"); | |
GradientDrawable gd = new GradientDrawable(); | |
gd.setColor(fillColor); | |
gd.setCornerRadius(roundRadius); | |
gd.setStroke(strokeWidth, strokeColor); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment