The Android Developer Challenge is back! Submit your idea before December 2.

TextUtilsCompat

class TextUtilsCompat
kotlin.Any
   ↳ androidx.core.text.TextUtilsCompat

Backwards compatible version of TextUtils.

Summary

Public methods

static Int

Returns the layout direction for a given Locale

static String
htmlEncode(@NonNull s: String)

Html-encode the string.

Public methods

getLayoutDirectionFromLocale

static fun getLayoutDirectionFromLocale(@Nullable locale: Locale?): Int

Returns the layout direction for a given Locale

Parameters
locale Locale?: the Locale for which we want the layout direction, maybe be null.
Return
Int: the layout direction, either ViewCompat#LAYOUT_DIRECTION_LTR or ViewCompat#LAYOUT_DIRECTION_RTL.

htmlEncode

@NonNull static fun htmlEncode(@NonNull s: String): String

Html-encode the string.

Parameters
s String: the string to be encoded
Return
String: the encoded string