当前位置: 首页>>代码示例>>Java>>正文


Java InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE属性代码示例

本文整理汇总了Java中android.text.InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE属性的典型用法代码示例。如果您正苦于以下问题:Java InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE属性的具体用法?Java InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE怎么用?Java InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.text.InputType的用法示例。


在下文中一共展示了InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setTransport

public void setTransport(TransportOption transport) {
  final boolean useSystemEmoji = TextSecurePreferences.isSystemEmojiPreferred(getContext());

  int imeOptions = (getImeOptions() & ~EditorInfo.IME_MASK_ACTION) | EditorInfo.IME_ACTION_SEND;
  int inputType  = getInputType();

  if (isLandscape()) setImeActionLabel(transport.getComposeHint(), EditorInfo.IME_ACTION_SEND);
  else               setImeActionLabel(null, 0);

  if (useSystemEmoji) {
    inputType = (inputType & ~InputType.TYPE_MASK_VARIATION) | InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE;
  }

  setInputType(inputType);
  setImeOptions(imeOptions);
  setHint(transport.getComposeHint(),
          transport.getSimName().isPresent()
              ? getContext().getString(R.string.conversation_activity__from_sim_name, transport.getSimName().get())
              : null);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:20,代码来源:ComposeText.java

示例2: getKeyboardMode

private static int getKeyboardMode(final EditorInfo editorInfo) {
    final int inputType = editorInfo.inputType;
    final int variation = inputType & InputType.TYPE_MASK_VARIATION;

    switch (inputType & InputType.TYPE_MASK_CLASS) {
    case InputType.TYPE_CLASS_NUMBER:
        return KeyboardId.MODE_NUMBER;
    case InputType.TYPE_CLASS_DATETIME:
        switch (variation) {
        case InputType.TYPE_DATETIME_VARIATION_DATE:
            return KeyboardId.MODE_DATE;
        case InputType.TYPE_DATETIME_VARIATION_TIME:
            return KeyboardId.MODE_TIME;
        default: // InputType.TYPE_DATETIME_VARIATION_NORMAL
            return KeyboardId.MODE_DATETIME;
        }
    case InputType.TYPE_CLASS_PHONE:
        return KeyboardId.MODE_PHONE;
    case InputType.TYPE_CLASS_TEXT:
        if (InputTypeUtils.isEmailVariation(variation)) {
            return KeyboardId.MODE_EMAIL;
        } else if (variation == InputType.TYPE_TEXT_VARIATION_URI) {
            return KeyboardId.MODE_URL;
        } else if (variation == InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE) {
            return KeyboardId.MODE_IM;
        } else if (variation == InputType.TYPE_TEXT_VARIATION_FILTER) {
            return KeyboardId.MODE_TEXT;
        } else {
            return KeyboardId.MODE_TEXT;
        }
    default:
        return KeyboardId.MODE_TEXT;
    }
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:34,代码来源:KeyboardLayoutSet.java

示例3: getKeyboardMode

/**
 * 获取输入法键盘类型.
 */
private int getKeyboardMode(final EditorInfo editorInfo) {
    if (editorInfo == null) {
        return KeyBoardID.MODE_TEXT;
    }
    //
    final int inputType = editorInfo.inputType;
    final int variation = inputType & InputType.TYPE_MASK_VARIATION;
    // 根据 eidttext inputtype 返回软键盘类型.
    switch (inputType & InputType.TYPE_MASK_CLASS) {
        case InputType.TYPE_CLASS_NUMBER: // 数字键盘.
            // return KeyBoardID.MODE_NUMBER;
        case InputType.TYPE_CLASS_PHONE: // 显示符号键盘. phone拨号.
            // return KeyBoardID.MODE_PHONE;
        case InputType.TYPE_CLASS_DATETIME: // 日期,时间. 文本输入框要求输入数字或日期时.
            switch (variation) {
                case InputType.TYPE_DATETIME_VARIATION_DATE: // 多一个 "/"
                    return KeyBoardID.MODE_DATE;
                case InputType.TYPE_DATETIME_VARIATION_TIME: // 多一个 ":"
                    return KeyBoardID.MODE_TIME;
                default: // InputType.TYPE_DATETIME_VARIATION_NORMAL
                    return KeyBoardID.MODE_DATETIME; // 多两个 "/",":"
            }
        case InputType.TYPE_CLASS_TEXT: // 显示输入字母的软键盘.
            if (KeyBoardUtils.isEmailVariation(variation)) {
                return KeyBoardID.MODE_EMAIL;
            } else if (variation == InputType.TYPE_TEXT_VARIATION_URI) {
                return KeyBoardID.MODE_URL;
            } else if (variation == InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE) {
                return KeyBoardID.MODE_IM;
            } else if (variation == InputType.TYPE_TEXT_VARIATION_FILTER) {
                return KeyBoardID.MODE_TEXT;
            } else {
                return KeyBoardID.MODE_TEXT;
            }
        default:
            return KeyBoardID.MODE_TEXT;
    }
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:41,代码来源:EmojiIME.java

示例4: toTextVariationString

private static String toTextVariationString(final int variation) {
    switch (variation) {
    case InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS:
        return " TYPE_TEXT_VARIATION_EMAIL_ADDRESS";
    case InputType.TYPE_TEXT_VARIATION_EMAIL_SUBJECT:
        return "TYPE_TEXT_VARIATION_EMAIL_SUBJECT";
    case InputType.TYPE_TEXT_VARIATION_FILTER:
        return "TYPE_TEXT_VARIATION_FILTER";
    case InputType.TYPE_TEXT_VARIATION_LONG_MESSAGE:
        return "TYPE_TEXT_VARIATION_LONG_MESSAGE";
    case InputType.TYPE_TEXT_VARIATION_NORMAL:
        return "TYPE_TEXT_VARIATION_NORMAL";
    case InputType.TYPE_TEXT_VARIATION_PASSWORD:
        return "TYPE_TEXT_VARIATION_PASSWORD";
    case InputType.TYPE_TEXT_VARIATION_PERSON_NAME:
        return "TYPE_TEXT_VARIATION_PERSON_NAME";
    case InputType.TYPE_TEXT_VARIATION_PHONETIC:
        return "TYPE_TEXT_VARIATION_PHONETIC";
    case InputType.TYPE_TEXT_VARIATION_POSTAL_ADDRESS:
        return "TYPE_TEXT_VARIATION_POSTAL_ADDRESS";
    case InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE:
        return "TYPE_TEXT_VARIATION_SHORT_MESSAGE";
    case InputType.TYPE_TEXT_VARIATION_URI:
        return "TYPE_TEXT_VARIATION_URI";
    case InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD:
        return "TYPE_TEXT_VARIATION_VISIBLE_PASSWORD";
    case InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT:
        return "TYPE_TEXT_VARIATION_WEB_EDIT_TEXT";
    case InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS:
        return "TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS";
    case InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD:
        return "TYPE_TEXT_VARIATION_WEB_PASSWORD";
    default:
        return String.format("unknownVariation<0x%08x>", variation);
    }
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:36,代码来源:InputAttributes.java


注:本文中的android.text.InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。