I was making a xml file and was applying gravity to make view content to shift it to extreme right side of window but i saw gravity as right and end.So, what is the actual difference between the both and which one to use where.
in Arabic, Persian and all rtl (Right-To-Left) Locales, end
is left but for English and other ltr (Left-To-Right) Locales end
means right
Left
and right
gravities might not work correctly in applications localized for right-to-left languages like Hebrew, Arabic etc. In those languages left and right sides are mirrored to european languages. If you use hardcoded left
and right
gravities for some elements of your UI, then they might be misplaced in right-to-left localizations. If you use begin
and end
, then Android will map them correctly to left
or right
depending on current system language. Thus begin
for English is equal to left
and for Hebrew to right
etc.
If you app has a localization for one of right-to-left languages, then you should always use begin
and end
. Otherwise you can safely stay with left
and right
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With