Flip RTL text before sending it

This commit is contained in:
Roy Iarchy 2016-01-25 01:55:34 +02:00
parent 5baf7de154
commit 06477bcac0
1 changed files with 4 additions and 0 deletions

View File

@ -22,6 +22,7 @@ import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.v4.text.TextDirectionHeuristicsCompat;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
@ -316,6 +317,9 @@ public class RemoteActivity extends BaseActivity
* Callbacks from Send text dialog
*/
public void onSendTextFinished(String text, boolean done) {
if (TextDirectionHeuristicsCompat.FIRSTSTRONG_LTR.isRtl(text, 0, text.length())) {
text = new StringBuilder(text).reverse().toString();
}
Input.SendText action = new Input.SendText(text, done);
action.execute(hostManager.getConnection(), null, null);
}