TextUtilsCompat

Added in 1.1.0

public final class TextUtilsCompat


Backwards compatible version of TextUtils.

Summary

Public methods

static int

Returns the layout direction for a given Locale

static @NonNull String

Html-encode the string.

Public methods

getLayoutDirectionFromLocale

Added in 1.1.0
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

Added in 1.1.0
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