GrammaticalInflectionManagerCompat


public final class GrammaticalInflectionManagerCompat


Helper for accessing features in android.app.GrammaticalInflectionManager.

Summary

Constants

static final int

Constant for grammatical gender: to indicate the terms of address the user preferred in an application is feminine.

static final int

Constant for grammatical gender: to indicate the terms of address the user preferred in an application is masculine.

static final int

Constant for grammatical gender: to indicate the terms of address the user preferred in an application is neuter.

static final int

Constant for grammatical gender: to indicate the user has not specified the terms of address for the application.

Public methods

static int

Returns the current grammatical gender.

static void
@AnyThread
setRequestedApplicationGrammaticalGender(
    @NonNull Context context,
    int grammaticalGender
)

Sets the current grammatical gender.

Constants

GRAMMATICAL_GENDER_FEMININE

Added in 1.12.0
public static final int GRAMMATICAL_GENDER_FEMININE = 2

Constant for grammatical gender: to indicate the terms of address the user preferred in an application is feminine.

GRAMMATICAL_GENDER_MASCULINE

Added in 1.12.0
public static final int GRAMMATICAL_GENDER_MASCULINE = 3

Constant for grammatical gender: to indicate the terms of address the user preferred in an application is masculine.

GRAMMATICAL_GENDER_NEUTRAL

Added in 1.12.0
public static final int GRAMMATICAL_GENDER_NEUTRAL = 1

Constant for grammatical gender: to indicate the terms of address the user preferred in an application is neuter.

GRAMMATICAL_GENDER_NOT_SPECIFIED

Added in 1.12.0
public static final int GRAMMATICAL_GENDER_NOT_SPECIFIED = 0

Constant for grammatical gender: to indicate the user has not specified the terms of address for the application.

Public methods

getApplicationGrammaticalGender

Added in 1.12.0
@AnyThread
public static int getApplicationGrammaticalGender(@NonNull Context context)

Returns the current grammatical gender. No-op on versions prior to UPSIDE_DOWN_CAKE.

Parameters
@NonNull Context context

Context to retrieve service from.

Returns
int

the grammatical gender if device API level is greater than 33, otherwise, return 0.

setRequestedApplicationGrammaticalGender

Added in 1.12.0
@AnyThread
public static void setRequestedApplicationGrammaticalGender(
    @NonNull Context context,
    int grammaticalGender
)

Sets the current grammatical gender. No-op on versions prior to UPSIDE_DOWN_CAKE.

Parameters
@NonNull Context context

Context to retrieve service from.

int grammaticalGender

the terms of address the user preferred in an application.