From a view, how can I get the value of the android:padding attribute programmatically? I am currently using:
private static final String ANDROID_NAMESPACE = \"h
You can just add the android:padding
to your custom view's attributes.
...
...
And then, you can access the attribute just like your other attributes:
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ActivityWrapperView);
float padding = a.getDimension(R.styleable.ActivityWrapperView_android_padding, 0);
...
boolean hasPadding = a.hasValue(R.styleable.ActivityWrapperView_android_padding);