Added in API level 1
Deprecated in API level 26

AndroidCharacter


open class AndroidCharacter
kotlin.Any
   ↳ android.text.AndroidCharacter

AndroidCharacter exposes some character properties that used to be not easily accessed from java.lang.Character, but are now available in ICU.

Summary

Constants
static Int

static Int

static Int

static Int

static Int

static Int

Public constructors

Public methods
open static Unit
getDirectionalities(src: CharArray!, dest: ByteArray!, count: Int)

Fill in the first count bytes of dest with the directionalities from the first count chars of src.

open static Int

Calculate the East Asian Width of a character according to Unicode TR#11.

open static Unit
getEastAsianWidths(src: CharArray!, start: Int, count: Int, dest: ByteArray!)

Fill the first count bytes of dest with the East Asian Width from count chars of src starting at start.

open static Char

Return the right-to-left mirror (or the original char if none) of the specified char.

open static Boolean
mirror(text: CharArray!, start: Int, count: Int)

Replace the specified slice of text with the chars' right-to-left mirrors (if any), returning true if any replacements were made.

Constants

EAST_ASIAN_WIDTH_AMBIGUOUS

Added in API level 8
Deprecated in API level 26
static val EAST_ASIAN_WIDTH_AMBIGUOUS: Int

Deprecated: Deprecated in Java.

Value: 1

EAST_ASIAN_WIDTH_FULL_WIDTH

Added in API level 8
Deprecated in API level 26
static val EAST_ASIAN_WIDTH_FULL_WIDTH: Int

Deprecated: Deprecated in Java.

Value: 3

EAST_ASIAN_WIDTH_HALF_WIDTH

Added in API level 8
Deprecated in API level 26
static val EAST_ASIAN_WIDTH_HALF_WIDTH: Int

Deprecated: Deprecated in Java.

Value: 2

EAST_ASIAN_WIDTH_NARROW

Added in API level 8
Deprecated in API level 26
static val EAST_ASIAN_WIDTH_NARROW: Int

Deprecated: Deprecated in Java.

Value: 4

EAST_ASIAN_WIDTH_NEUTRAL

Added in API level 8
Deprecated in API level 26
static val EAST_ASIAN_WIDTH_NEUTRAL: Int

Deprecated: Deprecated in Java.

Value: 0

EAST_ASIAN_WIDTH_WIDE

Added in API level 8
Deprecated in API level 26
static val EAST_ASIAN_WIDTH_WIDE: Int

Deprecated: Deprecated in Java.

Value: 5

Public constructors

AndroidCharacter

AndroidCharacter()

Public methods

getDirectionalities

Added in API level 1
open static fun getDirectionalities(
    src: CharArray!,
    dest: ByteArray!,
    count: Int
): Unit

Deprecated: Deprecated in Java.

Fill in the first count bytes of dest with the directionalities from the first count chars of src. This is just like Character.getDirectionality() except it is a batch operation.

getEastAsianWidth

Added in API level 8
Deprecated in API level 26
open static fun getEastAsianWidth(input: Char): Int

Deprecated: Deprecated in Java.

Calculate the East Asian Width of a character according to Unicode TR#11. The return will be one of EAST_ASIAN_WIDTH_NEUTRAL, EAST_ASIAN_WIDTH_AMBIGUOUS, EAST_ASIAN_WIDTH_HALF_WIDTH, EAST_ASIAN_WIDTH_FULL_WIDTH, EAST_ASIAN_WIDTH_NARROW, or EAST_ASIAN_WIDTH_WIDE.

Parameters
input Char: the character to measure
Return
Int the East Asian Width for input

getEastAsianWidths

Added in API level 8
Deprecated in API level 26
open static fun getEastAsianWidths(
    src: CharArray!,
    start: Int,
    count: Int,
    dest: ByteArray!
): Unit

Deprecated: Deprecated in Java.

Fill the first count bytes of dest with the East Asian Width from count chars of src starting at start. East Asian Width is calculated based on Unicode TR#11. Each entry in dest will be one of EAST_ASIAN_WIDTH_NEUTRAL, EAST_ASIAN_WIDTH_AMBIGUOUS, EAST_ASIAN_WIDTH_HALF_WIDTH, EAST_ASIAN_WIDTH_FULL_WIDTH, EAST_ASIAN_WIDTH_NARROW, or EAST_ASIAN_WIDTH_WIDE.

Parameters
src CharArray!: character array of input to measure
start Int: first character in array to measure
count Int: maximum number of characters to measure
dest ByteArray!: byte array of results for each character in src

getMirror

Added in API level 1
open static fun getMirror(ch: Char): Char

Deprecated: Deprecated in Java.

Return the right-to-left mirror (or the original char if none) of the specified char.

mirror

Added in API level 1
open static fun mirror(
    text: CharArray!,
    start: Int,
    count: Int
): Boolean

Deprecated: Deprecated in Java.

Replace the specified slice of text with the chars' right-to-left mirrors (if any), returning true if any replacements were made.

Parameters
text CharArray!: array of characters to apply mirror operation
start Int: first character in array to mirror
count Int: maximum number of characters to mirror
Return
Boolean true if replacements were made