List of usage examples for android.text TextUtils CAP_MODE_WORDS
int CAP_MODE_WORDS
To view the source code for android.text TextUtils CAP_MODE_WORDS.
Click Source Link
From source file:Main.java
/** * Convert capitalize mode flags into human readable text. * * @param capsFlags The modes flags to be converted. It may be any combination of * {@link TextUtils#CAP_MODE_CHARACTERS}, {@link TextUtils#CAP_MODE_WORDS}, and * {@link TextUtils#CAP_MODE_SENTENCES}. * @return the text that describe the <code>capsMode</code>. *///w w w. ja v a 2 s. c o m public static String flagsToString(final int capsFlags) { final int capsFlagsMask = TextUtils.CAP_MODE_CHARACTERS | TextUtils.CAP_MODE_WORDS | TextUtils.CAP_MODE_SENTENCES; if ((capsFlags & ~capsFlagsMask) != 0) { return "unknown<0x" + Integer.toHexString(capsFlags) + ">"; } final ArrayList<String> builder = new ArrayList<>(); if ((capsFlags & android.text.TextUtils.CAP_MODE_CHARACTERS) != 0) { builder.add("characters"); } if ((capsFlags & android.text.TextUtils.CAP_MODE_WORDS) != 0) { builder.add("words"); } if ((capsFlags & android.text.TextUtils.CAP_MODE_SENTENCES) != 0) { builder.add("sentences"); } return builder.isEmpty() ? "none" : TextUtils.join("|", builder); }