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

Commit e4426623 authored by Scott Main's avatar Scott Main
Browse files

some extra docs for TextDirectionHeuristic

Change-Id: I8ceac72a76a29bde0e25ed418110a6e4120654e3
parent 27a8508e
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -25,8 +25,12 @@ import java.util.Locale;
/**
/**
 * Utility class for formatting text for display in a potentially opposite-directionality context
 * Utility class for formatting text for display in a potentially opposite-directionality context
 * without garbling. The directionality of the context is set at formatter creation and the
 * without garbling. The directionality of the context is set at formatter creation and the
 * directionality of the text can be either estimated or passed in when known. Provides the
 * directionality of the text can be either estimated or passed in when known. 
 * following functionality:
 *
 * <p>To support versions lower than {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2},
 * you can use the support library's {@link android.support.v4.text.BidiFormatter} class.
 *
 * <p>These APIs provides the following functionality:
 * <p>
 * <p>
 * 1. Bidi Wrapping
 * 1. Bidi Wrapping
 * When text in one language is mixed into a document in another, opposite-directionality language,
 * When text in one language is mixed into a document in another, opposite-directionality language,
@@ -370,6 +374,7 @@ public final class BidiFormatter {
     *
     *
     * @param str The input string.
     * @param str The input string.
     * @param heuristic The algorithm to be used to estimate the string's overall direction.
     * @param heuristic The algorithm to be used to estimate the string's overall direction.
     *        See {@link TextDirectionHeuristics} for pre-defined heuristics.
     * @param isolate Whether to directionally isolate the string to prevent it from garbling the
     * @param isolate Whether to directionally isolate the string to prevent it from garbling the
     *     content around it
     *     content around it
     * @return Input string after applying the above processing.
     * @return Input string after applying the above processing.
@@ -401,6 +406,7 @@ public final class BidiFormatter {
     *
     *
     * @param str The input string.
     * @param str The input string.
     * @param heuristic The algorithm to be used to estimate the string's overall direction.
     * @param heuristic The algorithm to be used to estimate the string's overall direction.
     *        See {@link TextDirectionHeuristics} for pre-defined heuristics.
     * @return Input string after applying the above processing.
     * @return Input string after applying the above processing.
     */
     */
    public String unicodeWrap(String str, TextDirectionHeuristic heuristic) {
    public String unicodeWrap(String str, TextDirectionHeuristic heuristic) {
+8 −1
Original line number Original line Diff line number Diff line
@@ -22,7 +22,14 @@ import android.view.View;
import java.nio.CharBuffer;
import java.nio.CharBuffer;


/**
/**
 * Some objects that implement TextDirectionHeuristic.
 * Some objects that implement {@link TextDirectionHeuristic}. Use these with
 * the {@link BidiFormatter#unicodeWrap unicodeWrap()} methods in {@link BidiFormatter}.
 * Also notice that these direction heuristics correspond to the same types of constants
 * provided in the {@link android.view.View} class for {@link android.view.View#setTextDirection
 * setTextDirection()}, such as {@link android.view.View#TEXT_DIRECTION_RTL}.
 * <p>To support versions lower than {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2},
 * you can use the support library's {@link android.support.v4.text.TextDirectionHeuristicsCompat}
 * class.
 *
 *
 */
 */
public class TextDirectionHeuristics {
public class TextDirectionHeuristics {