Unfortunately, none of the answers helped me reconcile the hint written in LTR, while the layout orientation was RTL. I needed such a layout in the form of a translation application to make overlay icons not interfering with RTL text. But this trick didn’t work with tooltips, as long as there was no text (icons appeared above the tooltip), and I came to the following java solution to the layout problem:
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { . . . if (isRightToLeft()){ EditText guess = (EditText) rootView.findViewById(android.R.id.text1); CharSequence hint = "\u200F" + guess.getHint(); guess.setHint(hint); } . . . }
The trick was a label from right to left to add a line from left to right. And it seems to work, but does anyone know a more elegant solution?
Cool Soft May 09 '15 at 12:20 2015-05-09 12:20
source share