Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b8a3ce4 authored by Eran Mizrahi's avatar Eran Mizrahi
Browse files

Fix parenthesis direction in RTL langauges.

In RTL langauages, the parenthesis are mirrored when displayed,
as they should be. Hence, the keyboard app needs to mirror such
chars so that at the end the user will get the char he pressed.

For now only Hebrew is supported/effected - for other RTL langauges,
I recommend trying to add them to the condition I added and verifying
the fix is applicable for them as well.

Change-Id: Ib2c14c96d5ee3f6f09819f6f81cedf8c69359d86
parent bd315d9a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import android.preference.PreferenceManager;
import android.speech.SpeechRecognizer;
import android.text.ClipboardManager;
import android.text.TextUtils;
import android.text.AndroidCharacter;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.PrintWriterPrinter;
@@ -1470,6 +1471,12 @@ public class LatinIME extends InputMethodService
            postUpdateSuggestions();
        }

        // fix for parenthesis in RTL langauges:
        // TODO: Add further RTL langauges which need parenthesis correction:
        String iso3lang = mLanguageSwitcher.getInputLocale().getISO3Language();
        if (primaryCode < 0x100 && iso3lang.equals("heb"))
                primaryCode = AndroidCharacter.getMirror((char)primaryCode);

        boolean pickedDefault = false;
        // Handle separator
        InputConnection ic = getCurrentInputConnection();