09 April 2015

Layout on Android for Arabic and other RTL languages

The way which Android will put the text to the it's place in the layout depends on its layout gravity parameter. New values for this for API 17 are "start" and "end" orientations, depending on the language default for device user it changed it place from left to right and vice versa, it is different for langs written from the left to the right LTR and others(arabians) which start from the right to the left (RTL). In app to get layout/text directions call the method getLayoutDirectionFromLocale(locale), this will return View.LAYOUT_DIRECTION_LTR (left-to-right) or View.LAYOUT_DIRECTION_RTL (right-to-left).

01 April 2015