Custom Layout for right-to-left languages in Android -
i have custom layout extend viewgroup class, how can modify layout programmatically in order support right-to-left languages e.g. arabic, farsi, etc. means reversing order of layout's items or mirroring ?
there no need programmatically starting android api 17 (4.2 think), can define dynamically items on screen according device locale.
it should this:
<textview android:layout_width="match_parent" android:layout_height="wrap_content" android:drawableleft="@drawable/profile_settings_list_options" android:drawablepadding="28dp" android:drawablestart="@drawable/profile_settings_list_options" android:gravity="start" android:paddingbottom="16dp" android:paddingleft="28dp" android:paddingstart="28dp" android:paddingtop="16dp" android:textcolor="@color/gray_dark3" android:textsize="@dimen/text_size_small2" />
for more, read blogpost
Comments
Post a Comment