Since few times the autocomplete box from Eclipse propose android:paddingStart android:paddingStop when I\'m writing xml layout files.
I don\'t really understand what th
When working with and reading this I realize it is paddingStart and paddingEND and not paddingSTOP (although this element exists).
After reading into the Android source code (View.java) it seems paddingStart and paddingEnd are helpful to take care of letter direction (left to right of right to left) defined by the user.
Thus, paddingStart is interpreted as paddingLeft in LTR (left-to-right) languages and paddingRight in RTL (right-to-left) languages.
Source code from View.java (android-4.0.1) :
switch (getResolvedLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
// Start user padding override Right user padding. Otherwise, if Right user
// padding is not defined, use the default Right padding. If Right user padding
// is defined, just use it.
if (mUserPaddingStart >= 0) {
mUserPaddingRight = mUserPaddingStart;
} else if (mUserPaddingRight < 0) {
mUserPaddingRight = mPaddingRight;
}
if (mUserPaddingEnd >= 0) {
mUserPaddingLeft = mUserPaddingEnd;
} else if (mUserPaddingLeft < 0) {
mUserPaddingLeft = mPaddingLeft;
}
break;
case LAYOUT_DIRECTION_LTR:
default:
// Start user padding override Left user padding. Otherwise, if Left user
// padding is not defined, use the default left padding. If Left user padding
// is defined, just use it.
if (mUserPaddingStart >= 0) {
mUserPaddingLeft = mUserPaddingStart;
} else if (mUserPaddingLeft < 0) {
mUserPaddingLeft = mPaddingLeft;
}
if (mUserPaddingEnd >= 0) {
mUserPaddingRight = mUserPaddingEnd;
} else if (mUserPaddingRight < 0) {
mUserPaddingRight = mPaddingRight;
}
}