How can I create a gradient border like in the image below?

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can achieve this by using a layerlist and messing with the padding. You’ll need 3 elements:
1: A border.xml shape, which is just a solid shape in the color of your border: border.xml
2: The ‘inner’ shape, the shape where you want the border to appear around: inner.xml
3: A layer list, which will put these 2 on top of eachother. You create the border by setting the padding on the inner shape: layerlist.xml
Specify here where you want to have a stroke(top, left, right, bottom)
Set this as the background of your TextView, Layout etc. (where you want the stroke to appear)
Or just create a 9Patch image with the borders.