Java Code Examples for android.icu.text.DisplayContext#DIALECT_NAMES

The following examples show how to use android.icu.text.DisplayContext#DIALECT_NAMES . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LocaleDisplayNamesImpl.java    From j2objc with Apache License 2.0 6 votes vote down vote up
@Override
public DisplayContext getContext(DisplayContext.Type type) {
    DisplayContext result;
    switch (type) {
    case DIALECT_HANDLING:
        result = (dialectHandling==DialectHandling.STANDARD_NAMES)? DisplayContext.STANDARD_NAMES: DisplayContext.DIALECT_NAMES;
        break;
    case CAPITALIZATION:
        result = capitalization;
        break;
    case DISPLAY_LENGTH:
        result = nameLength;
        break;
    case SUBSTITUTE_HANDLING:
        result = substituteHandling;
        break;
    default:
        result = DisplayContext.STANDARD_NAMES; // hmm, we should do something else here
        break;
    }
    return result;
}
 
Example 2
Source File: LocaleDisplayNamesImpl.java    From j2objc with Apache License 2.0 4 votes vote down vote up
public LocaleDisplayNamesImpl(ULocale locale, DialectHandling dialectHandling) {
    this(locale, (dialectHandling==DialectHandling.STANDARD_NAMES)? DisplayContext.STANDARD_NAMES: DisplayContext.DIALECT_NAMES,
            DisplayContext.CAPITALIZATION_NONE);
}