Take a look at this code snippet. I am getting an error with the last line, because I am passing an \'index\' instead of a resource. I thought it was a lint issue and tried
TypedValue outValue = new TypedValue(); context.getTheme().resolveAttribute(android.R.attr.paddingLeft, outValue, true); int paddingLeft = outValue.data;
Repeat the same for android.R.attr.paddingRight