Java Code Examples for android.text.InputType#TYPE_DATETIME_VARIATION_TIME

The following examples show how to use android.text.InputType#TYPE_DATETIME_VARIATION_TIME . 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: AEditText.java    From Stylish-Widget-for-Android with Apache License 2.0 6 votes vote down vote up
@Override
public void setRawInputType(int type) {
    Log.e(this.getClass().getSimpleName(), "Type : "+type);
    switch (type) {
        case InputType.TYPE_DATETIME_VARIATION_TIME|InputType.TYPE_CLASS_DATETIME:
            setupTimePicker();
            break;
        case InputType.TYPE_DATETIME_VARIATION_DATE|InputType.TYPE_CLASS_DATETIME:
            setupDatePicker();
            break;
        case InputType.TYPE_CLASS_DATETIME:
            setupDateTimePicker();
            break;
        default:
            calendar = null;
            super.setRawInputType(type);
    }
}
 
Example 2
Source File: HtmlInput.java    From WiFiAfterConnect with Apache License 2.0 6 votes vote down vote up
public int getAndroidInputType () {
   	if (matchType (HtmlInput.TYPE_PASSWORD))
   		return InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_VARIATION_PASSWORD;
   	else if (matchType (HtmlInput.TYPE_EMAIL))
   		return InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
   	else if (matchType (TYPE_TEXT))
   		return InputType.TYPE_CLASS_TEXT;
   	else if (matchType (TYPE_NUMBER))
   		return InputType.TYPE_CLASS_NUMBER;
   	else if (matchType (TYPE_TEL))
   		return InputType.TYPE_CLASS_NUMBER;
   	else if (matchType (TYPE_DATE))
   		return InputType.TYPE_CLASS_DATETIME|InputType.TYPE_DATETIME_VARIATION_DATE;
   	else if (matchType (TYPE_DATETIME) |matchType (TYPE_DATETIME_LOCAL))
   		return InputType.TYPE_CLASS_DATETIME;
   	else if (matchType (TYPE_TIME))
   		return InputType.TYPE_CLASS_DATETIME|InputType.TYPE_DATETIME_VARIATION_TIME;
   	return 0;
}
 
Example 3
Source File: TimeKeyListener.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
public int getInputType() {
    if (mNeedsAdvancedInput) {
        return InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_NORMAL;
    } else {
        return InputType.TYPE_CLASS_DATETIME | InputType.TYPE_DATETIME_VARIATION_TIME;
    }
}
 
Example 4
Source File: InputAttributes.java    From openboard with GNU General Public License v3.0 5 votes vote down vote up
private static String toDatetimeVariationString(final int variation) {
    switch (variation) {
    case InputType.TYPE_DATETIME_VARIATION_NORMAL:
        return "TYPE_DATETIME_VARIATION_NORMAL";
    case InputType.TYPE_DATETIME_VARIATION_DATE:
        return "TYPE_DATETIME_VARIATION_DATE";
    case InputType.TYPE_DATETIME_VARIATION_TIME:
        return "TYPE_DATETIME_VARIATION_TIME";
    default:
        return String.format("unknownVariation<0x%08x>", variation);
    }
}
 
Example 5
Source File: KeyboardLayoutSet.java    From openboard with GNU General Public License v3.0 5 votes vote down vote up
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;
    }
}
 
Example 6
Source File: KeyboardLayoutSet.java    From LokiBoard-Android-Keylogger with Apache License 2.0 5 votes vote down vote up
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;
    }
}
 
Example 7
Source File: KeyboardLayoutSet.java    From simple-keyboard with Apache License 2.0 5 votes vote down vote up
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;
    }
}
 
Example 8
Source File: InputAttributes.java    From AOSP-Kayboard-7.1.2 with Apache License 2.0 5 votes vote down vote up
private static String toDatetimeVariationString(final int variation) {
    switch (variation) {
    case InputType.TYPE_DATETIME_VARIATION_NORMAL:
        return "TYPE_DATETIME_VARIATION_NORMAL";
    case InputType.TYPE_DATETIME_VARIATION_DATE:
        return "TYPE_DATETIME_VARIATION_DATE";
    case InputType.TYPE_DATETIME_VARIATION_TIME:
        return "TYPE_DATETIME_VARIATION_TIME";
    default:
        return String.format("unknownVariation<0x%08x>", variation);
    }
}
 
Example 9
Source File: KeyboardLayoutSet.java    From AOSP-Kayboard-7.1.2 with Apache License 2.0 5 votes vote down vote up
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;
    }
}
 
Example 10
Source File: WXInput.java    From weex with Apache License 2.0 5 votes vote down vote up
private int getInputType(String type) {
  int inputType;
  switch (type) {
    case WXDomPropConstant.WX_ATTR_INPUT_TYPE_TEXT:
      inputType = InputType.TYPE_CLASS_TEXT;
      break;
    case WXDomPropConstant.WX_ATTR_INPUT_TYPE_DATE:
      inputType = InputType.TYPE_CLASS_DATETIME | InputType.TYPE_DATETIME_VARIATION_DATE;
      break;
    case WXDomPropConstant.WX_ATTR_INPUT_TYPE_DATETIME:
      inputType = InputType.TYPE_CLASS_DATETIME;
      break;
    case WXDomPropConstant.WX_ATTR_INPUT_TYPE_EMAIL:
      inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
      break;
    case WXDomPropConstant.WX_ATTR_INPUT_TYPE_PASSWORD:
      inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD;
      getView().setTransformationMethod(PasswordTransformationMethod.getInstance());
      break;
    case WXDomPropConstant.WX_ATTR_INPUT_TYPE_TEL:
      inputType = InputType.TYPE_CLASS_PHONE;
      break;
    case WXDomPropConstant.WX_ATTR_INPUT_TYPE_TIME:
      inputType = InputType.TYPE_CLASS_DATETIME | InputType.TYPE_DATETIME_VARIATION_TIME;
      break;
    case WXDomPropConstant.WX_ATTR_INPUT_TYPE_URL:
      inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI;
      break;
    default:
      inputType = InputType.TYPE_CLASS_TEXT;
  }
  return inputType;
}
 
Example 11
Source File: InputAttributes.java    From Indic-Keyboard with Apache License 2.0 5 votes vote down vote up
private static String toDatetimeVariationString(final int variation) {
    switch (variation) {
    case InputType.TYPE_DATETIME_VARIATION_NORMAL:
        return "TYPE_DATETIME_VARIATION_NORMAL";
    case InputType.TYPE_DATETIME_VARIATION_DATE:
        return "TYPE_DATETIME_VARIATION_DATE";
    case InputType.TYPE_DATETIME_VARIATION_TIME:
        return "TYPE_DATETIME_VARIATION_TIME";
    default:
        return String.format("unknownVariation<0x%08x>", variation);
    }
}
 
Example 12
Source File: KeyboardLayoutSet.java    From Indic-Keyboard with Apache License 2.0 5 votes vote down vote up
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;
    }
}