Doesn\'t work EditText padding in the API 21. I try to do it in empty project, only with single editText, but it still doesn\'t work.
Set padding programmatically works
Solved it by creating a custom edittext with padding and use it in xml.
public class MyEditTextView extends EditText{
public MyEditTextView(Context context) {
super(context);
init();
}
public MyEditTextView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public MyEditTextView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
private void init(){
int paddingLeftRight = (int) getResources().getDimension(R.dimen.edittext_padding);
int topPadding = this.getPaddingTop();
int bottomPadding = this.getPaddingBottom();
setPadding(paddingLeftRight, topPadding, paddingLeftRight, bottomPadding);
}
}