TextUtilsCompat

public final class TextUtilsCompat


Backwards compatible version of TextUtils.

Summary

Public constructors

Public methods

static int

Returns the layout direction for a given Locale

static @NonNull String

Html-encode the string.

Public constructors

TextUtilsCompat

public final TextUtilsCompat()

Public methods

getLayoutDirectionFromLocale

public static int getLayoutDirectionFromLocale(@Nullable Locale locale)

Returns the layout direction for a given Locale

Parameters
@Nullable Locale locale

the Locale for which we want the layout direction, maybe be null.

Returns
int

the layout direction, either LAYOUT_DIRECTION_LTR or LAYOUT_DIRECTION_RTL.

htmlEncode

public static @NonNull String htmlEncode(@NonNull String s)

Html-encode the string.

Parameters
@NonNull String s

the string to be encoded

Returns
@NonNull String

the encoded string