Change text selection to rtl instead of ltr default

I am working on a WebView in Android. As you know, when we want to select text in a WebView that has two or more rows, it selects text from left to right . How to make WebView select text from t24> ?

Example (a bold double quote is the beginning of the selection, and the next is the end of the selection)

Stack overflow is Q and A free programming. " Free to ask questions, free to answer questions, free to read, free to index " created using plain old HTML, no fake rot13 text on the home page, no scammy google-cloaking tactics, no sellers, JavaScript windows are not reset before replying, requiring $ 12.95 to leave. You can register if you want to collect karma and win a valuable flair that appears next to your name, but otherwise it's just free. And fast. Very, very fast.

I want to select text as:

Qaru is a programming Q & A, built with plain old HTML, no

But the default selection text is as follows:

site that free. Free to ask questions, free to answer questions, free to read, free to index

Can someone help me do this?

Thank you in advance:)

+4
source share
1 answer

In my opinion, the direction of choice should be encapsulated in a web view (not available to developers) and dictated instead by the content of the HTML being viewed. Using the <bdo dir="rtl"> , I can select the JellyBean browser as I wish, but Ice Cream Sandwich still selects from left to right. It is possible that support for choice direction may be a recent addition.

0
source

Source: https://habr.com/ru/post/1435689/


All Articles