Open HassanHeydariNasab opened 9 years ago
@HassanHeydariNasab
i want to pull-request..
@HassanHeydariNasab Yes indeed. It would be very nice if RTL is supported in this great project.
I've figure out a solution to support RTL by Extending RichEditor class and add 'setDirectionTo' method:
public class CustomRichEditor extends RichEditor {
public CustomRichEditor(Context context) {
super(context);
}
public CustomRichEditor(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomRichEditor(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public void setDirectionTo(String dir) {
String direction = "(function() {" +
" var body = document.getElementsByTagName(\"body\")[0];" +
" body.dir = \"" + dir + "\";" +
"}) ();";
exec("javascript:" + direction + "");
}
}
XML code:
<your.package.name.CustomRichEditor
android:id="@+id/theID"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="50dp"/>
Thanks in advance @wasabeef
Please add RTL support ! Thanks