I am creating a LayerDrawable
that creates bottom stroke but i dont know how to give bottom margin of a layer(Drawablw).
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:bottom="2dp">
..
</item>
</layer-list>
I want to set bottom margin like above programmatically.
So far i have done this:
Drawable[] list = new Drawable[2];
GradientDrawable strokeDrawable = new GradientDrawable(
GradientDrawable.Orientation.TOP_BOTTOM, new int[] {
strokeColor[0], strokeColor[0] });
GradientDrawable backgroundDrawable = new GradientDrawable(
GradientDrawable.Orientation.TOP_BOTTOM, bgColor);
// Now how to set bottom margin to make border.
list[0] = strokeDrawable;
list[1] = backgroundDrawable;
LayerDrawable layerDrawable = new LayerDrawable(list);
Anyone know about this?