id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
113,100
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.safeTruncate
public static String safeTruncate(final String value, final int length, final String filler) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); if (length == 0) { return ""; } if (length >= value.length()) { return value; } String...
java
public static String safeTruncate(final String value, final int length, final String filler) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); if (length == 0) { return ""; } if (length >= value.length()) { return value; } String...
[ "public", "static", "String", "safeTruncate", "(", "final", "String", "value", ",", "final", "int", "length", ",", "final", "String", "filler", ")", "{", "validate", "(", "value", ",", "NULL_STRING_PREDICATE", ",", "NULL_STRING_MSG_SUPPLIER", ")", ";", "if", "...
Truncate the string securely, not cutting a word in half. It always returns the last full word. @param value The input String @param length Max size of the truncated String @param filler String that will be added to the end of the return string. Example: '...' @return The truncated String
[ "Truncate", "the", "string", "securely", "not", "cutting", "a", "word", "in", "half", ".", "It", "always", "returns", "the", "last", "full", "word", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L872-L893
113,101
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.split
public static String[] split(final String value, final String regex) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); return value.split(regex); }
java
public static String[] split(final String value, final String regex) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); return value.split(regex); }
[ "public", "static", "String", "[", "]", "split", "(", "final", "String", "value", ",", "final", "String", "regex", ")", "{", "validate", "(", "value", ",", "NULL_STRING_PREDICATE", ",", "NULL_STRING_MSG_SUPPLIER", ")", ";", "return", "value", ".", "split", "...
Alias to String split function. Defined only for completeness. @param value The input String @param regex The delimiting regular expression @return String Array
[ "Alias", "to", "String", "split", "function", ".", "Defined", "only", "for", "completeness", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L902-L905
113,102
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.words
public static String[] words(final String value, final String delimiter) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); return value.split(delimiter); }
java
public static String[] words(final String value, final String delimiter) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); return value.split(delimiter); }
[ "public", "static", "String", "[", "]", "words", "(", "final", "String", "value", ",", "final", "String", "delimiter", ")", "{", "validate", "(", "value", ",", "NULL_STRING_PREDICATE", ",", "NULL_STRING_MSG_SUPPLIER", ")", ";", "return", "value", ".", "split",...
Splits a String to words by delimiter, \s+ by default @param value The input String @param delimiter delimiter for splitting input String @return words array
[ "Splits", "a", "String", "to", "words", "by", "delimiter", "\\", "s", "+", "by", "default" ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L924-L927
113,103
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.truncate
public static String truncate(final String value, final int length, final String filler) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); if (length == 0) { return ""; } if (length >= value.length()) { return value; } return appe...
java
public static String truncate(final String value, final int length, final String filler) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); if (length == 0) { return ""; } if (length >= value.length()) { return value; } return appe...
[ "public", "static", "String", "truncate", "(", "final", "String", "value", ",", "final", "int", "length", ",", "final", "String", "filler", ")", "{", "validate", "(", "value", ",", "NULL_STRING_PREDICATE", ",", "NULL_STRING_MSG_SUPPLIER", ")", ";", "if", "(", ...
Truncate the unsecured form string, cutting the independent string of required position. @param value Value will be truncated unsecurely. @param length Size of the returned string. @param filler Value that will be added to the end of the return string. Example: '...' @return String truncated unsafely.
[ "Truncate", "the", "unsecured", "form", "string", "cutting", "the", "independent", "string", "of", "required", "position", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L938-L947
113,104
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.htmlDecode
public static String htmlDecode(final String encodedHtml) { validate(encodedHtml, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); String[] entities = encodedHtml.split("&\\W+;"); return Arrays.stream(entities).map(e -> HtmlEntities.decodedEntities.get(e)).collect(joining()); }
java
public static String htmlDecode(final String encodedHtml) { validate(encodedHtml, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); String[] entities = encodedHtml.split("&\\W+;"); return Arrays.stream(entities).map(e -> HtmlEntities.decodedEntities.get(e)).collect(joining()); }
[ "public", "static", "String", "htmlDecode", "(", "final", "String", "encodedHtml", ")", "{", "validate", "(", "encodedHtml", ",", "NULL_STRING_PREDICATE", ",", "NULL_STRING_MSG_SUPPLIER", ")", ";", "String", "[", "]", "entities", "=", "encodedHtml", ".", "split", ...
Converts all HTML entities to applicable characters. @param encodedHtml The encoded HTML @return The decoded HTML
[ "Converts", "all", "HTML", "entities", "to", "applicable", "characters", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L955-L959
113,105
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.htmlEncode
public static String htmlEncode(final String html) { validate(html, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); return html.chars().mapToObj(c -> "\\u" + String.format("%04x", c).toUpperCase()) .map(HtmlEntities.encodedEntities::get).collect(joining()); }
java
public static String htmlEncode(final String html) { validate(html, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); return html.chars().mapToObj(c -> "\\u" + String.format("%04x", c).toUpperCase()) .map(HtmlEntities.encodedEntities::get).collect(joining()); }
[ "public", "static", "String", "htmlEncode", "(", "final", "String", "html", ")", "{", "validate", "(", "html", ",", "NULL_STRING_PREDICATE", ",", "NULL_STRING_MSG_SUPPLIER", ")", ";", "return", "html", ".", "chars", "(", ")", ".", "mapToObj", "(", "c", "->",...
Convert all applicable characters to HTML entities. @param html The HTML to encode @return The encoded data
[ "Convert", "all", "applicable", "characters", "to", "HTML", "entities", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L967-L971
113,106
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.shuffle
public static String shuffle(final String value) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); String[] chars = chars(value); Random random = new Random(); for (int i = 0; i < chars.length; i++) { int r = random.nextInt(chars.length); String ...
java
public static String shuffle(final String value) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); String[] chars = chars(value); Random random = new Random(); for (int i = 0; i < chars.length; i++) { int r = random.nextInt(chars.length); String ...
[ "public", "static", "String", "shuffle", "(", "final", "String", "value", ")", "{", "validate", "(", "value", ",", "NULL_STRING_PREDICATE", ",", "NULL_STRING_MSG_SUPPLIER", ")", ";", "String", "[", "]", "chars", "=", "chars", "(", "value", ")", ";", "Random"...
It returns a string with its characters in random order. @param value The input String @return The shuffled String
[ "It", "returns", "a", "string", "with", "its", "characters", "in", "random", "order", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L979-L990
113,107
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.slice
public static String slice(final String value, int begin, int end) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); return value.substring(begin, end); }
java
public static String slice(final String value, int begin, int end) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); return value.substring(begin, end); }
[ "public", "static", "String", "slice", "(", "final", "String", "value", ",", "int", "begin", ",", "int", "end", ")", "{", "validate", "(", "value", ",", "NULL_STRING_PREDICATE", ",", "NULL_STRING_MSG_SUPPLIER", ")", ";", "return", "value", ".", "substring", ...
Alias of substring method @param value The input String @param begin Start of slice. @param end End of slice. @return The String sliced!
[ "Alias", "of", "substring", "method" ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1000-L1003
113,108
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.slugify
public static String slugify(final String value) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); String transliterated = transliterate(collapseWhitespace(value.trim().toLowerCase())); return Arrays.stream(words(transliterated.replace("&", "-and-"), "\\W+")).collect(joining("-...
java
public static String slugify(final String value) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); String transliterated = transliterate(collapseWhitespace(value.trim().toLowerCase())); return Arrays.stream(words(transliterated.replace("&", "-and-"), "\\W+")).collect(joining("-...
[ "public", "static", "String", "slugify", "(", "final", "String", "value", ")", "{", "validate", "(", "value", ",", "NULL_STRING_PREDICATE", ",", "NULL_STRING_MSG_SUPPLIER", ")", ";", "String", "transliterated", "=", "transliterate", "(", "collapseWhitespace", "(", ...
Convert a String to a slug @param value The value to slugify @return The slugified value
[ "Convert", "a", "String", "to", "a", "slug" ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1011-L1015
113,109
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.transliterate
public static String transliterate(final String value) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); String result = value; Set<Map.Entry<String, List<String>>> entries = Ascii.ascii.entrySet(); for (Map.Entry<String, List<String>> entry : entries) { for...
java
public static String transliterate(final String value) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); String result = value; Set<Map.Entry<String, List<String>>> entries = Ascii.ascii.entrySet(); for (Map.Entry<String, List<String>> entry : entries) { for...
[ "public", "static", "String", "transliterate", "(", "final", "String", "value", ")", "{", "validate", "(", "value", ",", "NULL_STRING_PREDICATE", ",", "NULL_STRING_MSG_SUPPLIER", ")", ";", "String", "result", "=", "value", ";", "Set", "<", "Map", ".", "Entry",...
Remove all non valid characters. @param value The input String @return String without non valid characters.
[ "Remove", "all", "non", "valid", "characters", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1023-L1033
113,110
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.surround
public static String surround(final String value, final String prefix, final String suffix) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); String _prefix = Optional.ofNullable(prefix).orElse(""); return append(_prefix, value, Optional.ofNullable(suffix).orElse(_prefix)); ...
java
public static String surround(final String value, final String prefix, final String suffix) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); String _prefix = Optional.ofNullable(prefix).orElse(""); return append(_prefix, value, Optional.ofNullable(suffix).orElse(_prefix)); ...
[ "public", "static", "String", "surround", "(", "final", "String", "value", ",", "final", "String", "prefix", ",", "final", "String", "suffix", ")", "{", "validate", "(", "value", ",", "NULL_STRING_PREDICATE", ",", "NULL_STRING_MSG_SUPPLIER", ")", ";", "String", ...
Surrounds a 'value' with the given 'prefix' and 'suffix'. @param value The input String @param prefix prefix. If suffix is null then prefix is used @param suffix suffix @return The String with surround substrs!
[ "Surrounds", "a", "value", "with", "the", "given", "prefix", "and", "suffix", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1043-L1047
113,111
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.toCamelCase
public static String toCamelCase(final String value) { if (value == null || value.length() == 0) { return ""; } String str = toStudlyCase(value); return str.substring(0, 1).toLowerCase() + str.substring(1); }
java
public static String toCamelCase(final String value) { if (value == null || value.length() == 0) { return ""; } String str = toStudlyCase(value); return str.substring(0, 1).toLowerCase() + str.substring(1); }
[ "public", "static", "String", "toCamelCase", "(", "final", "String", "value", ")", "{", "if", "(", "value", "==", "null", "||", "value", ".", "length", "(", ")", "==", "0", ")", "{", "return", "\"\"", ";", "}", "String", "str", "=", "toStudlyCase", "...
Transform to camelCase @param value The input String @return String in camelCase.
[ "Transform", "to", "camelCase" ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1055-L1061
113,112
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.toStudlyCase
public static String toStudlyCase(final String value) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); String[] words = collapseWhitespace(value.trim()).split("\\s*(_|-|\\s)\\s*"); return Arrays.stream(words).filter(w -> !w.trim().isEmpty()).map(Strman::upperFirst).collect(joi...
java
public static String toStudlyCase(final String value) { validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER); String[] words = collapseWhitespace(value.trim()).split("\\s*(_|-|\\s)\\s*"); return Arrays.stream(words).filter(w -> !w.trim().isEmpty()).map(Strman::upperFirst).collect(joi...
[ "public", "static", "String", "toStudlyCase", "(", "final", "String", "value", ")", "{", "validate", "(", "value", ",", "NULL_STRING_PREDICATE", ",", "NULL_STRING_MSG_SUPPLIER", ")", ";", "String", "[", "]", "words", "=", "collapseWhitespace", "(", "value", ".",...
Transform to StudlyCaps. @param value The input String @return String in StudlyCaps.
[ "Transform", "to", "StudlyCaps", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1069-L1073
113,113
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.tail
public static Optional<String> tail(final String value) { return Optional.ofNullable(value).filter(v -> !v.isEmpty()).map(v -> last(v, v.length() - 1)); }
java
public static Optional<String> tail(final String value) { return Optional.ofNullable(value).filter(v -> !v.isEmpty()).map(v -> last(v, v.length() - 1)); }
[ "public", "static", "Optional", "<", "String", ">", "tail", "(", "final", "String", "value", ")", "{", "return", "Optional", ".", "ofNullable", "(", "value", ")", ".", "filter", "(", "v", "->", "!", "v", ".", "isEmpty", "(", ")", ")", ".", "map", "...
Return tail of the String @param value The input String @return String tail
[ "Return", "tail", "of", "the", "String" ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1081-L1083
113,114
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.join
public static String join(final String[] strings, final String separator) throws IllegalArgumentException { if (strings == null) { throw new IllegalArgumentException("Input array 'strings' can't be null"); } if (separator == null) { throw new IllegalArgumentException("sep...
java
public static String join(final String[] strings, final String separator) throws IllegalArgumentException { if (strings == null) { throw new IllegalArgumentException("Input array 'strings' can't be null"); } if (separator == null) { throw new IllegalArgumentException("sep...
[ "public", "static", "String", "join", "(", "final", "String", "[", "]", "strings", ",", "final", "String", "separator", ")", "throws", "IllegalArgumentException", "{", "if", "(", "strings", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(...
Join concatenates all the elements of the strings array into a single String. The separator string is placed between elements in the resulting string. @param strings The input array to concatenate @param separator The separator to use @return Concatenated String
[ "Join", "concatenates", "all", "the", "elements", "of", "the", "strings", "array", "into", "a", "single", "String", ".", "The", "separator", "string", "is", "placed", "between", "elements", "in", "the", "resulting", "string", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1137-L1149
113,115
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.capitalize
public static String capitalize(final String input) throws IllegalArgumentException { if (input == null) { throw new IllegalArgumentException("input can't be null"); } if (input.length() == 0) { return ""; } return head(input).map(String::toUpperCase).map(...
java
public static String capitalize(final String input) throws IllegalArgumentException { if (input == null) { throw new IllegalArgumentException("input can't be null"); } if (input.length() == 0) { return ""; } return head(input).map(String::toUpperCase).map(...
[ "public", "static", "String", "capitalize", "(", "final", "String", "input", ")", "throws", "IllegalArgumentException", "{", "if", "(", "input", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"input can't be null\"", ")", ";", "}", "i...
Converts the first character of string to upper case and the remaining to lower case. @param input The string to capitalize @return The capitalized string
[ "Converts", "the", "first", "character", "of", "string", "to", "upper", "case", "and", "the", "remaining", "to", "lower", "case", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1157-L1165
113,116
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.isEnclosedBetween
public static boolean isEnclosedBetween(final String input, final String leftEncloser, String rightEncloser) { if (input == null) { throw new IllegalArgumentException("input can't be null"); } if (leftEncloser == null) { throw new IllegalArgumentException("leftEncloser ca...
java
public static boolean isEnclosedBetween(final String input, final String leftEncloser, String rightEncloser) { if (input == null) { throw new IllegalArgumentException("input can't be null"); } if (leftEncloser == null) { throw new IllegalArgumentException("leftEncloser ca...
[ "public", "static", "boolean", "isEnclosedBetween", "(", "final", "String", "input", ",", "final", "String", "leftEncloser", ",", "String", "rightEncloser", ")", "{", "if", "(", "input", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ...
Verifies whether String is enclosed by encloser @param input The input String @param leftEncloser String which encloses input String at left start @param rightEncloser String which encloses input String at the right end @return true if enclosed false otherwise
[ "Verifies", "whether", "String", "is", "enclosed", "by", "encloser" ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1203-L1214
113,117
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.upperFirst
public static String upperFirst(String input) { if (input == null) { throw new IllegalArgumentException("input can't be null"); } return head(input).map(String::toUpperCase).map(h -> tail(input).map(t -> h + t).orElse(h)).get(); }
java
public static String upperFirst(String input) { if (input == null) { throw new IllegalArgumentException("input can't be null"); } return head(input).map(String::toUpperCase).map(h -> tail(input).map(t -> h + t).orElse(h)).get(); }
[ "public", "static", "String", "upperFirst", "(", "String", "input", ")", "{", "if", "(", "input", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"input can't be null\"", ")", ";", "}", "return", "head", "(", "input", ")", ".", "...
Converts the first character of string to upper case. @param input The string to convert. @return Returns the converted string.
[ "Converts", "the", "first", "character", "of", "string", "to", "upper", "case", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1222-L1227
113,118
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.trimStart
public static Optional<String> trimStart(final String input) { return Optional.ofNullable(input).filter(v -> !v.isEmpty()).map(Strman::leftTrim); }
java
public static Optional<String> trimStart(final String input) { return Optional.ofNullable(input).filter(v -> !v.isEmpty()).map(Strman::leftTrim); }
[ "public", "static", "Optional", "<", "String", ">", "trimStart", "(", "final", "String", "input", ")", "{", "return", "Optional", ".", "ofNullable", "(", "input", ")", ".", "filter", "(", "v", "->", "!", "v", ".", "isEmpty", "(", ")", ")", ".", "map"...
Removes leading whitespace from string. @param input The string to trim. @return Returns the trimmed string.
[ "Removes", "leading", "whitespace", "from", "string", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1235-L1237
113,119
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.trimStart
public static Optional<String> trimStart(final String input, String... chars) { return Optional.ofNullable(input).filter(v -> !v.isEmpty()).map(v -> { String pattern = String.format("^[%s]+", join(chars, "\\")); return v.replaceAll(pattern, ""); }); }
java
public static Optional<String> trimStart(final String input, String... chars) { return Optional.ofNullable(input).filter(v -> !v.isEmpty()).map(v -> { String pattern = String.format("^[%s]+", join(chars, "\\")); return v.replaceAll(pattern, ""); }); }
[ "public", "static", "Optional", "<", "String", ">", "trimStart", "(", "final", "String", "input", ",", "String", "...", "chars", ")", "{", "return", "Optional", ".", "ofNullable", "(", "input", ")", ".", "filter", "(", "v", "->", "!", "v", ".", "isEmpt...
Removes leading characters from string. @param input The string to trim. @param chars The characters to trim. @return Returns the trimmed string.
[ "Removes", "leading", "characters", "from", "string", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1246-L1251
113,120
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.trimEnd
public static Optional<String> trimEnd(final String input) { return Optional.ofNullable(input).filter(v -> !v.isEmpty()).map(Strman::rightTrim); }
java
public static Optional<String> trimEnd(final String input) { return Optional.ofNullable(input).filter(v -> !v.isEmpty()).map(Strman::rightTrim); }
[ "public", "static", "Optional", "<", "String", ">", "trimEnd", "(", "final", "String", "input", ")", "{", "return", "Optional", ".", "ofNullable", "(", "input", ")", ".", "filter", "(", "v", "->", "!", "v", ".", "isEmpty", "(", ")", ")", ".", "map", ...
Removes trailing whitespace from string. @param input The string to trim. @return Returns the trimmed string.
[ "Removes", "trailing", "whitespace", "from", "string", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1259-L1261
113,121
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.charsCount
public static Map<Character, Long> charsCount(String input) { if (isNullOrEmpty(input)) { return Collections.emptyMap(); } return input.chars().mapToObj(c -> (char) c).collect(groupingBy(identity(), counting())); }
java
public static Map<Character, Long> charsCount(String input) { if (isNullOrEmpty(input)) { return Collections.emptyMap(); } return input.chars().mapToObj(c -> (char) c).collect(groupingBy(identity(), counting())); }
[ "public", "static", "Map", "<", "Character", ",", "Long", ">", "charsCount", "(", "String", "input", ")", "{", "if", "(", "isNullOrEmpty", "(", "input", ")", ")", "{", "return", "Collections", ".", "emptyMap", "(", ")", ";", "}", "return", "input", "."...
Counts the number of occurrences of each character in the string @param input The input string @return A map containing the number of occurrences of each character in the string
[ "Counts", "the", "number", "of", "occurrences", "of", "each", "character", "in", "the", "string" ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1283-L1289
113,122
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.underscored
public static String underscored(final String input) { if (input == null || input.length() == 0) { return ""; } return input.trim().replaceAll("([a-z\\d])([A-Z]+)", "$1_$2").replaceAll("[-\\s]+", "_").toLowerCase(); }
java
public static String underscored(final String input) { if (input == null || input.length() == 0) { return ""; } return input.trim().replaceAll("([a-z\\d])([A-Z]+)", "$1_$2").replaceAll("[-\\s]+", "_").toLowerCase(); }
[ "public", "static", "String", "underscored", "(", "final", "String", "input", ")", "{", "if", "(", "input", "==", "null", "||", "input", ".", "length", "(", ")", "==", "0", ")", "{", "return", "\"\"", ";", "}", "return", "input", ".", "trim", "(", ...
Changes passed in string to all lower case and adds underscore between words. @param input The input string @return the input string in all lower case with underscores between words
[ "Changes", "passed", "in", "string", "to", "all", "lower", "case", "and", "adds", "underscore", "between", "words", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1307-L1313
113,123
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.zip
public static List<String> zip(String... inputs) { if (inputs.length == 0) { return Collections.emptyList(); } OptionalInt min = Arrays.stream(inputs).mapToInt(str -> str == null ? 0 : str.length()).min(); if (!min.isPresent()) { return Collections.emptyList(); ...
java
public static List<String> zip(String... inputs) { if (inputs.length == 0) { return Collections.emptyList(); } OptionalInt min = Arrays.stream(inputs).mapToInt(str -> str == null ? 0 : str.length()).min(); if (!min.isPresent()) { return Collections.emptyList(); ...
[ "public", "static", "List", "<", "String", ">", "zip", "(", "String", "...", "inputs", ")", "{", "if", "(", "inputs", ".", "length", "==", "0", ")", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "OptionalInt", "min", "=", "Array...
Aggregates the contents of n strings into a single list of tuples. @param inputs A list of strings. @return A list of strings if none of the strings in the input is null or empty. An empty list otherwise.
[ "Aggregates", "the", "contents", "of", "n", "strings", "into", "a", "single", "list", "of", "tuples", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1322-L1335
113,124
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.humanize
public static String humanize(final String input) { if (input == null || input.length() == 0) { return ""; } return upperFirst(underscored(input).replaceAll("_", " ")); }
java
public static String humanize(final String input) { if (input == null || input.length() == 0) { return ""; } return upperFirst(underscored(input).replaceAll("_", " ")); }
[ "public", "static", "String", "humanize", "(", "final", "String", "input", ")", "{", "if", "(", "input", "==", "null", "||", "input", ".", "length", "(", ")", "==", "0", ")", "{", "return", "\"\"", ";", "}", "return", "upperFirst", "(", "underscored", ...
Converts an underscored, camelized, or dasherized string into a humanized one. Also removes beginning and ending whitespace. @param input The input String @return humanized version of String
[ "Converts", "an", "underscored", "camelized", "or", "dasherized", "string", "into", "a", "humanized", "one", ".", "Also", "removes", "beginning", "and", "ending", "whitespace", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1366-L1371
113,125
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.swapCase
public static String swapCase(String input) { if (input == null || input.length() == 0) { return ""; } StringBuilder resultBuilder = new StringBuilder(); for (char ch : input.toCharArray()) { if (Character.isUpperCase(ch)) { resultBuilder.append(Ch...
java
public static String swapCase(String input) { if (input == null || input.length() == 0) { return ""; } StringBuilder resultBuilder = new StringBuilder(); for (char ch : input.toCharArray()) { if (Character.isUpperCase(ch)) { resultBuilder.append(Ch...
[ "public", "static", "String", "swapCase", "(", "String", "input", ")", "{", "if", "(", "input", "==", "null", "||", "input", ".", "length", "(", ")", "==", "0", ")", "{", "return", "\"\"", ";", "}", "StringBuilder", "resultBuilder", "=", "new", "String...
Returns a copy of the string in which all the case-based characters have had their case swapped. @param input Input string @return String with all the case swapped
[ "Returns", "a", "copy", "of", "the", "string", "in", "which", "all", "the", "case", "-", "based", "characters", "have", "had", "their", "case", "swapped", "." ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1379-L1392
113,126
shekhargulati/strman-java
src/main/java/strman/Strman.java
Strman.formatNumber
public static String formatNumber(long number) { String stringRepresentation = Long.toString(number); StringBuilder sb = new StringBuilder(); int bound = stringRepresentation.length() - 1; String delimiter = ","; int counter = 0; for (int i = bound; i >= 0; i--) { ...
java
public static String formatNumber(long number) { String stringRepresentation = Long.toString(number); StringBuilder sb = new StringBuilder(); int bound = stringRepresentation.length() - 1; String delimiter = ","; int counter = 0; for (int i = bound; i >= 0; i--) { ...
[ "public", "static", "String", "formatNumber", "(", "long", "number", ")", "{", "String", "stringRepresentation", "=", "Long", ".", "toString", "(", "number", ")", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "int", "bound", "=", ...
Returns a string representation of the number passed in where groups of three digits are delimited by comma @param number Input number @return formatted String
[ "Returns", "a", "string", "representation", "of", "the", "number", "passed", "in", "where", "groups", "of", "three", "digits", "are", "delimited", "by", "comma" ]
d0c2a10a6273fd6082f084e95156653ca55ce1be
https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1400-L1415
113,127
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/TouchEffectDrawable.java
TouchEffectDrawable.setPadding
public void setPadding(int left, int top, int right, int bottom) { if ((left | top | right | bottom) == 0) { mState.mPadding = null; } else { if (mState.mPadding == null) { mState.mPadding = new Rect(); } mState.mPadding.set(left, top, righ...
java
public void setPadding(int left, int top, int right, int bottom) { if ((left | top | right | bottom) == 0) { mState.mPadding = null; } else { if (mState.mPadding == null) { mState.mPadding = new Rect(); } mState.mPadding.set(left, top, righ...
[ "public", "void", "setPadding", "(", "int", "left", ",", "int", "top", ",", "int", "right", ",", "int", "bottom", ")", "{", "if", "(", "(", "left", "|", "top", "|", "right", "|", "bottom", ")", "==", "0", ")", "{", "mState", ".", "mPadding", "=",...
Sets padding for the shape. @param left padding for the left side (in pixels) @param top padding for the top (in pixels) @param right padding for the right side (in pixels) @param bottom padding for the bottom (in pixels)
[ "Sets", "padding", "for", "the", "shape", "." ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/TouchEffectDrawable.java#L167-L177
113,128
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/widget/AbsSeekBar.java
AbsSeekBar.setThumbColor
public void setThumbColor(int startColor, int endColor) { mSeekBarDrawable.setThumbColor(ColorStateList.valueOf(startColor)); if (mIndicator != null) mIndicator.setColors(startColor, endColor); }
java
public void setThumbColor(int startColor, int endColor) { mSeekBarDrawable.setThumbColor(ColorStateList.valueOf(startColor)); if (mIndicator != null) mIndicator.setColors(startColor, endColor); }
[ "public", "void", "setThumbColor", "(", "int", "startColor", ",", "int", "endColor", ")", "{", "mSeekBarDrawable", ".", "setThumbColor", "(", "ColorStateList", ".", "valueOf", "(", "startColor", ")", ")", ";", "if", "(", "mIndicator", "!=", "null", ")", "mIn...
Sets the color of the seek thumb, as well as the color of the popup indicator. @param startColor The color the seek thumb will be changed to @param endColor The color the popup indicator will be changed to
[ "Sets", "the", "color", "of", "the", "seek", "thumb", "as", "well", "as", "the", "color", "of", "the", "popup", "indicator", "." ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/widget/AbsSeekBar.java#L502-L506
113,129
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/compat/UiCompat.java
UiCompat.setHotspotBounds
public static void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { //We don't want the full size rect, Lollipop ripple would be too big int size = (right - left) / 8; drawable.setHots...
java
public static void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { //We don't want the full size rect, Lollipop ripple would be too big int size = (right - left) / 8; drawable.setHots...
[ "public", "static", "void", "setHotspotBounds", "(", "Drawable", "drawable", ",", "int", "left", ",", "int", "top", ",", "int", "right", ",", "int", "bottom", ")", "{", "if", "(", "Build", ".", "VERSION", ".", "SDK_INT", ">=", "Build", ".", "VERSION_CODE...
As our DiscreteSeekBar implementation uses a circular drawable on API < 21 we want to use the same method to set its bounds as the Ripple's hotspot bounds. @param drawable Drawable @param left Left @param top Top @param right Right @param bottom Bottom
[ "As", "our", "DiscreteSeekBar", "implementation", "uses", "a", "circular", "drawable", "on", "API", "<", "21", "we", "want", "to", "use", "the", "same", "method", "to", "set", "its", "bounds", "as", "the", "Ripple", "s", "hotspot", "bounds", "." ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/compat/UiCompat.java#L60-L68
113,130
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/compat/UiCompat.java
UiCompat.setTextDirection
public static void setTextDirection(TextView textView, int textDirection) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { UiCompatNotCrash.setTextDirection(textView, textDirection); } }
java
public static void setTextDirection(TextView textView, int textDirection) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { UiCompatNotCrash.setTextDirection(textView, textDirection); } }
[ "public", "static", "void", "setTextDirection", "(", "TextView", "textView", ",", "int", "textDirection", ")", "{", "if", "(", "Build", ".", "VERSION", ".", "SDK_INT", ">=", "Build", ".", "VERSION_CODES", ".", "JELLY_BEAN_MR1", ")", "{", "UiCompatNotCrash", "....
Sets the TextView text direction attribute when possible @param textView TextView @param textDirection Text Direction @see TextView#setTextDirection(int)
[ "Sets", "the", "TextView", "text", "direction", "attribute", "when", "possible" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/compat/UiCompat.java#L93-L97
113,131
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/widget/EditText.java
EditText.checkShowTitle
private void checkShowTitle(Editable s, boolean skipChange) { // in this we can check width if (isShowTitle() && getWidth() > 0) { boolean have = s != null && s.length() > 0; if (have != isHaveText || (have && skipChange)) { isHaveText = have; anim...
java
private void checkShowTitle(Editable s, boolean skipChange) { // in this we can check width if (isShowTitle() && getWidth() > 0) { boolean have = s != null && s.length() > 0; if (have != isHaveText || (have && skipChange)) { isHaveText = have; anim...
[ "private", "void", "checkShowTitle", "(", "Editable", "s", ",", "boolean", "skipChange", ")", "{", "// in this we can check width", "if", "(", "isShowTitle", "(", ")", "&&", "getWidth", "(", ")", ">", "0", ")", "{", "boolean", "have", "=", "s", "!=", "null...
Check show hint title @param s The text, if the have same string we should move hint @param skipChange on showed we not refresh ui, but skipChange=true, we can skip the check
[ "Check", "show", "hint", "title" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/widget/EditText.java#L282-L291
113,132
qiujuer/Genius-Android
caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/CommandService.java
CommandService.onDestroy
@Override public void onDestroy() { CommandServiceImpl impl = mImpl; if (impl != null) { mImpl = null; impl.destroy(); } super.onDestroy(); // Kill process android.os.Process.killProcess(android.os.Process.myPid()); }
java
@Override public void onDestroy() { CommandServiceImpl impl = mImpl; if (impl != null) { mImpl = null; impl.destroy(); } super.onDestroy(); // Kill process android.os.Process.killProcess(android.os.Process.myPid()); }
[ "@", "Override", "public", "void", "onDestroy", "(", ")", "{", "CommandServiceImpl", "impl", "=", "mImpl", ";", "if", "(", "impl", "!=", "null", ")", "{", "mImpl", "=", "null", ";", "impl", ".", "destroy", "(", ")", ";", "}", "super", ".", "onDestroy...
Kill process when destroy
[ "Kill", "process", "when", "destroy" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/CommandService.java#L64-L74
113,133
qiujuer/Genius-Android
caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/ActionSyncTask.java
ActionSyncTask.run
@Override public void run() { if (!mDone) { synchronized (this) { if (!mDone) { call(); mDone = true; try { this.notifyAll(); } catch (Exception ignored) { ...
java
@Override public void run() { if (!mDone) { synchronized (this) { if (!mDone) { call(); mDone = true; try { this.notifyAll(); } catch (Exception ignored) { ...
[ "@", "Override", "public", "void", "run", "(", ")", "{", "if", "(", "!", "mDone", ")", "{", "synchronized", "(", "this", ")", "{", "if", "(", "!", "mDone", ")", "{", "call", "(", ")", ";", "mDone", "=", "true", ";", "try", "{", "this", ".", "...
Run to doing something
[ "Run", "to", "doing", "something" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/ActionSyncTask.java#L54-L68
113,134
qiujuer/Genius-Android
caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/ActionSyncTask.java
ActionSyncTask.waitRun
void waitRun(long waitMillis, int waitNanos, boolean cancelOnTimeOut) { if (!mDone) { synchronized (this) { if (!mDone) { try { this.wait(waitMillis, waitNanos); } catch (InterruptedException ignored) { ...
java
void waitRun(long waitMillis, int waitNanos, boolean cancelOnTimeOut) { if (!mDone) { synchronized (this) { if (!mDone) { try { this.wait(waitMillis, waitNanos); } catch (InterruptedException ignored) { ...
[ "void", "waitRun", "(", "long", "waitMillis", ",", "int", "waitNanos", ",", "boolean", "cancelOnTimeOut", ")", "{", "if", "(", "!", "mDone", ")", "{", "synchronized", "(", "this", ")", "{", "if", "(", "!", "mDone", ")", "{", "try", "{", "this", ".", ...
Wait for a period of time to run end @param waitMillis wait milliseconds time @param waitNanos wait nanoseconds time @param cancelOnTimeOut when wait end cancel the runner
[ "Wait", "for", "a", "period", "of", "time", "to", "run", "end" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/ActionSyncTask.java#L93-L107
113,135
qiujuer/Genius-Android
caprice/graphics/src/main/java/net/qiujuer/genius/graphics/Blur.java
Blur.checkSource
private static Bitmap checkSource(Bitmap original, int radius) { if (radius < 0 || radius > 256) { throw new RuntimeException("Blur bitmap radius must >= 1 and <=256."); } // First we should check the original if (original == null) { throw new NullPointerExceptio...
java
private static Bitmap checkSource(Bitmap original, int radius) { if (radius < 0 || radius > 256) { throw new RuntimeException("Blur bitmap radius must >= 1 and <=256."); } // First we should check the original if (original == null) { throw new NullPointerExceptio...
[ "private", "static", "Bitmap", "checkSource", "(", "Bitmap", "original", ",", "int", "radius", ")", "{", "if", "(", "radius", "<", "0", "||", "radius", ">", "256", ")", "{", "throw", "new", "RuntimeException", "(", "\"Blur bitmap radius must >= 1 and <=256.\"", ...
Building the bitmap @param original Bitmap @return Bitmap
[ "Building", "the", "bitmap" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/graphics/src/main/java/net/qiujuer/genius/graphics/Blur.java#L20-L39
113,136
qiujuer/Genius-Android
caprice/graphics/src/main/java/net/qiujuer/genius/graphics/Blur.java
Blur.onStackBlur
public static Bitmap onStackBlur(Bitmap original, int radius) { Bitmap bitmap = checkSource(original, radius); // Return this none blur if (radius == 1) { return bitmap; } //Jni BitMap Blur nativeStackBlurBitmap(bitmap, radius); return (bitmap); ...
java
public static Bitmap onStackBlur(Bitmap original, int radius) { Bitmap bitmap = checkSource(original, radius); // Return this none blur if (radius == 1) { return bitmap; } //Jni BitMap Blur nativeStackBlurBitmap(bitmap, radius); return (bitmap); ...
[ "public", "static", "Bitmap", "onStackBlur", "(", "Bitmap", "original", ",", "int", "radius", ")", "{", "Bitmap", "bitmap", "=", "checkSource", "(", "original", ",", "radius", ")", ";", "// Return this none blur", "if", "(", "radius", "==", "1", ")", "{", ...
StackBlur By Jni Bitmap @param original Original Image @param radius Blur radius @return Image Bitmap
[ "StackBlur", "By", "Jni", "Bitmap" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/graphics/src/main/java/net/qiujuer/genius/graphics/Blur.java#L48-L60
113,137
qiujuer/Genius-Android
caprice/graphics/src/main/java/net/qiujuer/genius/graphics/Blur.java
Blur.onStackBlurPixels
public static int[] onStackBlurPixels(int[] pix, int w, int h, int radius) { if (radius < 0 || radius > 256) { throw new RuntimeException("Blur bitmap radius must >= 1 and <=256."); } if (pix == null) { throw new RuntimeException("Blur bitmap pix isn't null."); }...
java
public static int[] onStackBlurPixels(int[] pix, int w, int h, int radius) { if (radius < 0 || radius > 256) { throw new RuntimeException("Blur bitmap radius must >= 1 and <=256."); } if (pix == null) { throw new RuntimeException("Blur bitmap pix isn't null."); }...
[ "public", "static", "int", "[", "]", "onStackBlurPixels", "(", "int", "[", "]", "pix", ",", "int", "w", ",", "int", "h", ",", "int", "radius", ")", "{", "if", "(", "radius", "<", "0", "||", "radius", ">", "256", ")", "{", "throw", "new", "Runtime...
StackBlur By Jni Pixels @param pix Original Image, you can call: <p> int w = bitmap.getWidth(); int h = bitmap.getHeight(); int[] pix = new int[w * h]; bitmap.getPixels(pix, 0, w, 0, 0, w, h); <p> // Jni Pixels Blur onStackBlurPixels(pix, w, h, radius); <p> bitmap.setPixels(pix, 0, w, 0, 0, w, h); <p> @param radius...
[ "StackBlur", "By", "Jni", "Pixels" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/graphics/src/main/java/net/qiujuer/genius/graphics/Blur.java#L150-L167
113,138
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java
Ui.dipToPx
public static float dipToPx(Resources resources, float dp) { DisplayMetrics metrics = resources.getDisplayMetrics(); return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, metrics); }
java
public static float dipToPx(Resources resources, float dp) { DisplayMetrics metrics = resources.getDisplayMetrics(); return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, metrics); }
[ "public", "static", "float", "dipToPx", "(", "Resources", "resources", ",", "float", "dp", ")", "{", "DisplayMetrics", "metrics", "=", "resources", ".", "getDisplayMetrics", "(", ")", ";", "return", "TypedValue", ".", "applyDimension", "(", "TypedValue", ".", ...
Change Dip to PX @param resources Resources @param dp Dip @return PX
[ "Change", "Dip", "to", "PX" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java#L70-L73
113,139
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java
Ui.modulateColorAlpha
public static int modulateColorAlpha(int color, int alpha) { int colorAlpha = color >>> 24; int scale = alpha + (alpha >> 7); int newAlpha = colorAlpha * scale >> 8; int r = (color >> 16) & 0xFF; int g = (color >> 8) & 0xFF; int b = color & 0xFF; return newAlpha <...
java
public static int modulateColorAlpha(int color, int alpha) { int colorAlpha = color >>> 24; int scale = alpha + (alpha >> 7); int newAlpha = colorAlpha * scale >> 8; int r = (color >> 16) & 0xFF; int g = (color >> 8) & 0xFF; int b = color & 0xFF; return newAlpha <...
[ "public", "static", "int", "modulateColorAlpha", "(", "int", "color", ",", "int", "alpha", ")", "{", "int", "colorAlpha", "=", "color", ">>>", "24", ";", "int", "scale", "=", "alpha", "+", "(", "alpha", ">>", "7", ")", ";", "int", "newAlpha", "=", "c...
Modulate the color to new alpha @param color Color @param alpha Modulate alpha @return Modulate alpha color
[ "Modulate", "the", "color", "to", "new", "alpha" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java#L106-L114
113,140
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java
Ui.changeColorAlpha
public static int changeColorAlpha(int color, int alpha) { int r = (color >> 16) & 0xFF; int g = (color >> 8) & 0xFF; int b = color & 0xFF; return alpha << 24 | r << 16 | g << 8 | b; }
java
public static int changeColorAlpha(int color, int alpha) { int r = (color >> 16) & 0xFF; int g = (color >> 8) & 0xFF; int b = color & 0xFF; return alpha << 24 | r << 16 | g << 8 | b; }
[ "public", "static", "int", "changeColorAlpha", "(", "int", "color", ",", "int", "alpha", ")", "{", "int", "r", "=", "(", "color", ">>", "16", ")", "&", "0xFF", ";", "int", "g", "=", "(", "color", ">>", "8", ")", "&", "0xFF", ";", "int", "b", "=...
Change the color to new alpha @param color Color @param alpha New alpha @return New alpha color
[ "Change", "the", "color", "to", "new", "alpha" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java#L124-L129
113,141
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java
Ui.isTrueFromAttribute
public static boolean isTrueFromAttribute(AttributeSet attrs, String attribute, boolean defaultValue) { return attrs.getAttributeBooleanValue(Ui.androidStyleNameSpace, attribute, defaultValue); }
java
public static boolean isTrueFromAttribute(AttributeSet attrs, String attribute, boolean defaultValue) { return attrs.getAttributeBooleanValue(Ui.androidStyleNameSpace, attribute, defaultValue); }
[ "public", "static", "boolean", "isTrueFromAttribute", "(", "AttributeSet", "attrs", ",", "String", "attribute", ",", "boolean", "defaultValue", ")", "{", "return", "attrs", ".", "getAttributeBooleanValue", "(", "Ui", ".", "androidStyleNameSpace", ",", "attribute", "...
Get the attribute have enabled value Form android styles namespace @param attrs AttributeSet @param attribute The attribute to retrieve @param defaultValue What to return if the attribute isn't found @return Resulting value
[ "Get", "the", "attribute", "have", "enabled", "value", "Form", "android", "styles", "namespace" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java#L140-L142
113,142
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java
Ui.getBackgroundColor
public static int getBackgroundColor(Context context, AttributeSet attrs) { int color = Color.TRANSPARENT; if (isHaveAttribute(attrs, "background")) { int styleId = attrs.getStyleAttribute(); int[] attributesArray = new int[]{android.R.attr.background}; try { ...
java
public static int getBackgroundColor(Context context, AttributeSet attrs) { int color = Color.TRANSPARENT; if (isHaveAttribute(attrs, "background")) { int styleId = attrs.getStyleAttribute(); int[] attributesArray = new int[]{android.R.attr.background}; try { ...
[ "public", "static", "int", "getBackgroundColor", "(", "Context", "context", ",", "AttributeSet", "attrs", ")", "{", "int", "color", "=", "Color", ".", "TRANSPARENT", ";", "if", "(", "isHaveAttribute", "(", "attrs", ",", "\"background\"", ")", ")", "{", "int"...
Get Background color if the attr is color value @param context Context @param attrs AttributeSet @return Color
[ "Get", "Background", "color", "if", "the", "attr", "is", "color", "value" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java#L189-L207
113,143
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java
Ui.getColorsFromArrayRes
public static int[] getColorsFromArrayRes(Resources resources, int resId) { try { @SuppressLint("Recycle") TypedArray array = resources.obtainTypedArray(resId); if (array.length() > 0) { final int len = array.length(); final int[] colors = new ...
java
public static int[] getColorsFromArrayRes(Resources resources, int resId) { try { @SuppressLint("Recycle") TypedArray array = resources.obtainTypedArray(resId); if (array.length() > 0) { final int len = array.length(); final int[] colors = new ...
[ "public", "static", "int", "[", "]", "getColorsFromArrayRes", "(", "Resources", "resources", ",", "int", "resId", ")", "{", "try", "{", "@", "SuppressLint", "(", "\"Recycle\"", ")", "TypedArray", "array", "=", "resources", ".", "obtainTypedArray", "(", "resId"...
Get color array values form array resource @param resources Resources @param resId Resources id @return color array
[ "Get", "color", "array", "values", "form", "array", "resource" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java#L216-L231
113,144
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java
Ui.isHaveAttribute
public static boolean isHaveAttribute(AttributeSet attrs, String attribute) { return attrs.getAttributeValue(Ui.androidStyleNameSpace, attribute) != null; }
java
public static boolean isHaveAttribute(AttributeSet attrs, String attribute) { return attrs.getAttributeValue(Ui.androidStyleNameSpace, attribute) != null; }
[ "public", "static", "boolean", "isHaveAttribute", "(", "AttributeSet", "attrs", ",", "String", "attribute", ")", "{", "return", "attrs", ".", "getAttributeValue", "(", "Ui", ".", "androidStyleNameSpace", ",", "attribute", ")", "!=", "null", ";", "}" ]
Check the AttributeSet values have a attribute String, on user set the attribute resource. Form android styles namespace @param attrs AttributeSet @param attribute The attribute to retrieve @return If have the attribute return True
[ "Check", "the", "AttributeSet", "values", "have", "a", "attribute", "String", "on", "user", "set", "the", "attribute", "resource", ".", "Form", "android", "styles", "namespace" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java#L241-L243
113,145
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/effect/Effect.java
Effect.setPaintAlpha
protected int setPaintAlpha(Paint paint, int alpha) { final int prevAlpha = paint.getAlpha(); paint.setAlpha(Ui.modulateAlpha(prevAlpha, alpha)); return prevAlpha; }
java
protected int setPaintAlpha(Paint paint, int alpha) { final int prevAlpha = paint.getAlpha(); paint.setAlpha(Ui.modulateAlpha(prevAlpha, alpha)); return prevAlpha; }
[ "protected", "int", "setPaintAlpha", "(", "Paint", "paint", ",", "int", "alpha", ")", "{", "final", "int", "prevAlpha", "=", "paint", ".", "getAlpha", "(", ")", ";", "paint", ".", "setAlpha", "(", "Ui", ".", "modulateAlpha", "(", "prevAlpha", ",", "alpha...
Set the draw paint alpha by modulateAlpha @param paint Paint @param alpha Alpha @return PrevAlpha
[ "Set", "the", "draw", "paint", "alpha", "by", "modulateAlpha" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/effect/Effect.java#L109-L113
113,146
qiujuer/Genius-Android
caprice/kit-reflect/src/main/java/net/qiujuer/genius/kit/reflect/Reflector.java
Reflector.with
public static Reflector with(String name, ClassLoader classLoader) throws ReflectException { return with(getClassForName(name, classLoader)); }
java
public static Reflector with(String name, ClassLoader classLoader) throws ReflectException { return with(getClassForName(name, classLoader)); }
[ "public", "static", "Reflector", "with", "(", "String", "name", ",", "ClassLoader", "classLoader", ")", "throws", "ReflectException", "{", "return", "with", "(", "getClassForName", "(", "name", ",", "classLoader", ")", ")", ";", "}" ]
Create a Reflector by class name form ClassLoader @param name class full name @param classLoader ClassLoader @return Reflector @throws ReflectException ReflectException @see #with(Class)
[ "Create", "a", "Reflector", "by", "class", "name", "form", "ClassLoader" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-reflect/src/main/java/net/qiujuer/genius/kit/reflect/Reflector.java#L68-L70
113,147
qiujuer/Genius-Android
caprice/kit-reflect/src/main/java/net/qiujuer/genius/kit/reflect/Reflector.java
Reflector.set
public Reflector set(String name, Object value) throws ReflectException { try { Field field = field0(name); field.setAccessible(true); field.set(obj, unwrap(value)); return this; } catch (Exception e) { throw new ReflectException(e); } ...
java
public Reflector set(String name, Object value) throws ReflectException { try { Field field = field0(name); field.setAccessible(true); field.set(obj, unwrap(value)); return this; } catch (Exception e) { throw new ReflectException(e); } ...
[ "public", "Reflector", "set", "(", "String", "name", ",", "Object", "value", ")", "throws", "ReflectException", "{", "try", "{", "Field", "field", "=", "field0", "(", "name", ")", ";", "field", ".", "setAccessible", "(", "true", ")", ";", "field", ".", ...
Set the target field value @param name field name @param value field value @return Reflector @throws ReflectException
[ "Set", "the", "target", "field", "value" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-reflect/src/main/java/net/qiujuer/genius/kit/reflect/Reflector.java#L165-L174
113,148
qiujuer/Genius-Android
caprice/kit-reflect/src/main/java/net/qiujuer/genius/kit/reflect/Reflector.java
Reflector.get
@SuppressWarnings("RedundantTypeArguments") public <T> T get(String name) throws ReflectException { return field(name).<T>get(); }
java
@SuppressWarnings("RedundantTypeArguments") public <T> T get(String name) throws ReflectException { return field(name).<T>get(); }
[ "@", "SuppressWarnings", "(", "\"RedundantTypeArguments\"", ")", "public", "<", "T", ">", "T", "get", "(", "String", "name", ")", "throws", "ReflectException", "{", "return", "field", "(", "name", ")", ".", "<", "T", ">", "get", "(", ")", ";", "}" ]
Get the target field value @param name field name @param <T> The return value type @return field value @throws ReflectException
[ "Get", "the", "target", "field", "value" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-reflect/src/main/java/net/qiujuer/genius/kit/reflect/Reflector.java#L184-L187
113,149
qiujuer/Genius-Android
caprice/kit-reflect/src/main/java/net/qiujuer/genius/kit/reflect/Reflector.java
Reflector.create
public Reflector create(Object... args) throws ReflectException { Class<?>[] types = getTypes(args); try { Constructor<?> constructor = type().getDeclaredConstructor(types); return with(constructor, args); } catch (NoSuchMethodException e) { for (Constructor<...
java
public Reflector create(Object... args) throws ReflectException { Class<?>[] types = getTypes(args); try { Constructor<?> constructor = type().getDeclaredConstructor(types); return with(constructor, args); } catch (NoSuchMethodException e) { for (Constructor<...
[ "public", "Reflector", "create", "(", "Object", "...", "args", ")", "throws", "ReflectException", "{", "Class", "<", "?", ">", "[", "]", "types", "=", "getTypes", "(", "args", ")", ";", "try", "{", "Constructor", "<", "?", ">", "constructor", "=", "typ...
We can create class by args structural parameters @param args structural parameters @return new structural parameters class @throws ReflectException
[ "We", "can", "create", "class", "by", "args", "structural", "parameters" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-reflect/src/main/java/net/qiujuer/genius/kit/reflect/Reflector.java#L362-L377
113,150
qiujuer/Genius-Android
caprice/kit-reflect/src/main/java/net/qiujuer/genius/kit/reflect/Reflector.java
Reflector.toLowerCaseFirstOne
@SuppressLint("DefaultLocale") private static String toLowerCaseFirstOne(String string) { int length = string.length(); if (length == 0 || Character.isLowerCase(string.charAt(0))) { return string; } else if (length == 1) { return string.toLowerCase(); } else ...
java
@SuppressLint("DefaultLocale") private static String toLowerCaseFirstOne(String string) { int length = string.length(); if (length == 0 || Character.isLowerCase(string.charAt(0))) { return string; } else if (length == 1) { return string.toLowerCase(); } else ...
[ "@", "SuppressLint", "(", "\"DefaultLocale\"", ")", "private", "static", "String", "toLowerCaseFirstOne", "(", "String", "string", ")", "{", "int", "length", "=", "string", ".", "length", "(", ")", ";", "if", "(", "length", "==", "0", "||", "Character", "....
Change string first char to lower case @param string wait change string @return new first lower case string
[ "Change", "string", "first", "char", "to", "lower", "case" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-reflect/src/main/java/net/qiujuer/genius/kit/reflect/Reflector.java#L426-L439
113,151
qiujuer/Genius-Android
caprice/kit-reflect/src/main/java/net/qiujuer/genius/kit/reflect/Reflector.java
Reflector.getClasses
public static <T> Class<?>[] getClasses(Type[] types) { if (types == null) return null; if (types.length == 0) return new Class<?>[0]; Class<?>[] classes = new Class[types.length]; // Resolve types by chasing down type variables. for (int i = 0; i < types...
java
public static <T> Class<?>[] getClasses(Type[] types) { if (types == null) return null; if (types.length == 0) return new Class<?>[0]; Class<?>[] classes = new Class[types.length]; // Resolve types by chasing down type variables. for (int i = 0; i < types...
[ "public", "static", "<", "T", ">", "Class", "<", "?", ">", "[", "]", "getClasses", "(", "Type", "[", "]", "types", ")", "{", "if", "(", "types", "==", "null", ")", "return", "null", ";", "if", "(", "types", ".", "length", "==", "0", ")", "retur...
Get the underlying class array for a type array, or null if the type is a variable type. @param types the type array @return a class array of the raw classes for actual the type arguments.
[ "Get", "the", "underlying", "class", "array", "for", "a", "type", "array", "or", "null", "if", "the", "type", "is", "a", "variable", "type", "." ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-reflect/src/main/java/net/qiujuer/genius/kit/reflect/Reflector.java#L679-L691
113,152
qiujuer/Genius-Android
caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/HandlerPoster.java
HandlerPoster.handleMessage
@Override public void handleMessage(Message msg) { if (msg.what == ASYNC) { mAsyncDispatcher.dispatch(); } else if (msg.what == SYNC) { mSyncDispatcher.dispatch(); } else super.handleMessage(msg); }
java
@Override public void handleMessage(Message msg) { if (msg.what == ASYNC) { mAsyncDispatcher.dispatch(); } else if (msg.what == SYNC) { mSyncDispatcher.dispatch(); } else super.handleMessage(msg); }
[ "@", "Override", "public", "void", "handleMessage", "(", "Message", "msg", ")", "{", "if", "(", "msg", ".", "what", "==", "ASYNC", ")", "{", "mAsyncDispatcher", ".", "dispatch", "(", ")", ";", "}", "else", "if", "(", "msg", ".", "what", "==", "SYNC",...
Run in main thread @param msg call messages
[ "Run", "in", "main", "thread" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/HandlerPoster.java#L108-L115
113,153
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/widget/Loading.java
Loading.setBackgroundColorRes
public void setBackgroundColorRes(int colorRes) { ColorStateList colorStateList = UiCompat.getColorStateList(getResources(), colorRes); if (colorStateList == null) setBackgroundColor(0); else setBackgroundColor(colorStateList.getDefaultColor()); }
java
public void setBackgroundColorRes(int colorRes) { ColorStateList colorStateList = UiCompat.getColorStateList(getResources(), colorRes); if (colorStateList == null) setBackgroundColor(0); else setBackgroundColor(colorStateList.getDefaultColor()); }
[ "public", "void", "setBackgroundColorRes", "(", "int", "colorRes", ")", "{", "ColorStateList", "colorStateList", "=", "UiCompat", ".", "getColorStateList", "(", "getResources", "(", ")", ",", "colorRes", ")", ";", "if", "(", "colorStateList", "==", "null", ")", ...
Set the background color by resource id @param colorRes Color resource id
[ "Set", "the", "background", "color", "by", "resource", "id" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/widget/Loading.java#L249-L255
113,154
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/widget/Loading.java
Loading.setLoadingDrawable
protected void setLoadingDrawable(LoadingDrawable drawable) { if (drawable == null) { throw new NullPointerException("LoadingDrawable is null, You can only set the STYLE_CIRCLE and STYLE_LINE parameters."); } else { drawable.setCallback(this); mLoadingDrawable = drawa...
java
protected void setLoadingDrawable(LoadingDrawable drawable) { if (drawable == null) { throw new NullPointerException("LoadingDrawable is null, You can only set the STYLE_CIRCLE and STYLE_LINE parameters."); } else { drawable.setCallback(this); mLoadingDrawable = drawa...
[ "protected", "void", "setLoadingDrawable", "(", "LoadingDrawable", "drawable", ")", "{", "if", "(", "drawable", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"LoadingDrawable is null, You can only set the STYLE_CIRCLE and STYLE_LINE parameters.\"", ")...
In this we set LoadingDrawable really @param drawable {@link LoadingDrawable}
[ "In", "this", "we", "set", "LoadingDrawable", "really" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/widget/Loading.java#L361-L371
113,155
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/widget/TextView.java
TextView.setBorder
public void setBorder(int flag, int size, int color) { if (mBorder != flag || mBorderSize != size || mBorderColor != color) { mBorder = flag; mBorderSize = size; mBorderColor = color; if (flag <= 0) { mBorderDrawable = null; } else { ...
java
public void setBorder(int flag, int size, int color) { if (mBorder != flag || mBorderSize != size || mBorderColor != color) { mBorder = flag; mBorderSize = size; mBorderColor = color; if (flag <= 0) { mBorderDrawable = null; } else { ...
[ "public", "void", "setBorder", "(", "int", "flag", ",", "int", "size", ",", "int", "color", ")", "{", "if", "(", "mBorder", "!=", "flag", "||", "mBorderSize", "!=", "size", "||", "mBorderColor", "!=", "color", ")", "{", "mBorder", "=", "flag", ";", "...
Set the border, You can init border size, color and decision that direction contains border @param flag use {@link #BORDER_ALL } if you need All border, or {@link #BORDER_LEFT} the view will have Left border of case you can use eg: {@link #BORDER_LEFT}|{@link #BORDER_BOTTOM} the view will left and bottom border <p> i...
[ "Set", "the", "border", "You", "can", "init", "border", "size", "color", "and", "decision", "that", "direction", "contains", "border" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/widget/TextView.java#L132-L176
113,156
qiujuer/Genius-Android
caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/Command.java
Command.destroyService
private static void destroyService() { Thread thread = DESTROY_THREAD; if (thread == null) { thread = new Thread() { @Override public void run() { try { // we wait 5000ms, because the service maybe can use ...
java
private static void destroyService() { Thread thread = DESTROY_THREAD; if (thread == null) { thread = new Thread() { @Override public void run() { try { // we wait 5000ms, because the service maybe can use ...
[ "private", "static", "void", "destroyService", "(", ")", "{", "Thread", "thread", "=", "DESTROY_THREAD", ";", "if", "(", "thread", "==", "null", ")", "{", "thread", "=", "new", "Thread", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")"...
Destroy Service After 5 seconds run
[ "Destroy", "Service", "After", "5", "seconds", "run" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/Command.java#L117-L137
113,157
qiujuer/Genius-Android
caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/Command.java
Command.cancelDestroyService
private static void cancelDestroyService() { Thread thread = DESTROY_THREAD; if (thread != null) { DESTROY_THREAD = null; thread.interrupt(); } }
java
private static void cancelDestroyService() { Thread thread = DESTROY_THREAD; if (thread != null) { DESTROY_THREAD = null; thread.interrupt(); } }
[ "private", "static", "void", "cancelDestroyService", "(", ")", "{", "Thread", "thread", "=", "DESTROY_THREAD", ";", "if", "(", "thread", "!=", "null", ")", "{", "DESTROY_THREAD", "=", "null", ";", "thread", ".", "interrupt", "(", ")", ";", "}", "}" ]
Cancel Destroy Service
[ "Cancel", "Destroy", "Service" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/Command.java#L140-L146
113,158
qiujuer/Genius-Android
caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/Command.java
Command.bindService
private static void bindService() { synchronized (Command.class) { if (!IS_BIND) { Context context = Cmd.getContext(); if (context == null) { throw new NullPointerException("Context not should null. Please call Cmd.init(Context)"); ...
java
private static void bindService() { synchronized (Command.class) { if (!IS_BIND) { Context context = Cmd.getContext(); if (context == null) { throw new NullPointerException("Context not should null. Please call Cmd.init(Context)"); ...
[ "private", "static", "void", "bindService", "(", ")", "{", "synchronized", "(", "Command", ".", "class", ")", "{", "if", "(", "!", "IS_BIND", ")", "{", "Context", "context", "=", "Cmd", ".", "getContext", "(", ")", ";", "if", "(", "context", "==", "n...
Start bind Service
[ "Start", "bind", "Service" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/Command.java#L151-L164
113,159
qiujuer/Genius-Android
caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/Command.java
Command.commandRun
private static String commandRun(Command command) { // Wait bind if (I_COMMAND == null) { synchronized (I_LOCK) { if (I_COMMAND == null) { try { I_LOCK.wait(); } catch (InterruptedException e) { ...
java
private static String commandRun(Command command) { // Wait bind if (I_COMMAND == null) { synchronized (I_LOCK) { if (I_COMMAND == null) { try { I_LOCK.wait(); } catch (InterruptedException e) { ...
[ "private", "static", "String", "commandRun", "(", "Command", "command", ")", "{", "// Wait bind", "if", "(", "I_COMMAND", "==", "null", ")", "{", "synchronized", "(", "I_LOCK", ")", "{", "if", "(", "I_COMMAND", "==", "null", ")", "{", "try", "{", "I_LOCK...
Run do Command @param command Command @return Result
[ "Run", "do", "Command" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/Command.java#L172-L231
113,160
qiujuer/Genius-Android
caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/Command.java
Command.dispose
public static void dispose() { synchronized (Command.class) { if (IS_BIND) { Context context = Cmd.getContext(); if (context != null) { try { context.unbindService(I_CONN); } catch (Exception e) { ...
java
public static void dispose() { synchronized (Command.class) { if (IS_BIND) { Context context = Cmd.getContext(); if (context != null) { try { context.unbindService(I_CONN); } catch (Exception e) { ...
[ "public", "static", "void", "dispose", "(", ")", "{", "synchronized", "(", "Command", ".", "class", ")", "{", "if", "(", "IS_BIND", ")", "{", "Context", "context", "=", "Cmd", ".", "getContext", "(", ")", ";", "if", "(", "context", "!=", "null", ")",...
Dispose unbindService stopService
[ "Dispose", "unbindService", "stopService" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/Command.java#L289-L304
113,161
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/widget/popup/PopupIndicator.java
PopupIndicator.computeFlags
private int computeFlags(int curFlags) { curFlags &= ~( WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.Lay...
java
private int computeFlags(int curFlags) { curFlags &= ~( WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.Lay...
[ "private", "int", "computeFlags", "(", "int", "curFlags", ")", "{", "curFlags", "&=", "~", "(", "WindowManager", ".", "LayoutParams", ".", "FLAG_IGNORE_CHEEK_PRESSES", "|", "WindowManager", ".", "LayoutParams", ".", "FLAG_NOT_FOCUSABLE", "|", "WindowManager", ".", ...
I'm NOT completely sure how all this bitwise things work... @param curFlags Cur Flags @return Flags
[ "I", "m", "NOT", "completely", "sure", "how", "all", "this", "bitwise", "things", "work", "..." ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/widget/popup/PopupIndicator.java#L249-L262
113,162
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/LoadingDrawable.java
LoadingDrawable.setProgress
public void setProgress(float progress) { if (progress < 0) mProgress = 0; else if (mProgress > 1) mProgress = 1; else mProgress = progress; stop(); onProgressChange(mProgress); invalidateSelf(); }
java
public void setProgress(float progress) { if (progress < 0) mProgress = 0; else if (mProgress > 1) mProgress = 1; else mProgress = progress; stop(); onProgressChange(mProgress); invalidateSelf(); }
[ "public", "void", "setProgress", "(", "float", "progress", ")", "{", "if", "(", "progress", "<", "0", ")", "mProgress", "=", "0", ";", "else", "if", "(", "mProgress", ">", "1", ")", "mProgress", "=", "1", ";", "else", "mProgress", "=", "progress", ";...
Set the draw progress The progress include 0~1 float On changed, stop animation draw @param progress Loading progress
[ "Set", "the", "draw", "progress", "The", "progress", "include", "0~1", "float", "On", "changed", "stop", "animation", "draw" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/LoadingDrawable.java#L144-L154
113,163
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/SeekBarStateDrawable.java
SeekBarStateDrawable.setTrackColor
public void setTrackColor(ColorStateList stateList) { mTrackStateList = stateList; mTrackColor = mTrackStateList.getDefaultColor(); if (mAlpha < 255) { mCurTrackColor = Ui.modulateColorAlpha(mTrackColor, mAlpha); } else { mCurTrackColor = mTrackColor; } ...
java
public void setTrackColor(ColorStateList stateList) { mTrackStateList = stateList; mTrackColor = mTrackStateList.getDefaultColor(); if (mAlpha < 255) { mCurTrackColor = Ui.modulateColorAlpha(mTrackColor, mAlpha); } else { mCurTrackColor = mTrackColor; } ...
[ "public", "void", "setTrackColor", "(", "ColorStateList", "stateList", ")", "{", "mTrackStateList", "=", "stateList", ";", "mTrackColor", "=", "mTrackStateList", ".", "getDefaultColor", "(", ")", ";", "if", "(", "mAlpha", "<", "255", ")", "{", "mCurTrackColor", ...
Set the Track ColorStateList @param stateList ColorStateList
[ "Set", "the", "Track", "ColorStateList" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/SeekBarStateDrawable.java#L114-L122
113,164
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/SeekBarStateDrawable.java
SeekBarStateDrawable.setScrubberColor
public void setScrubberColor(ColorStateList stateList) { mScrubberStateList = stateList; mScrubberColor = mScrubberStateList.getDefaultColor(); if (mAlpha < 255) { mCurScrubberColor = Ui.modulateColorAlpha(mScrubberColor, mAlpha); } else { mCurScrubberColor = mSc...
java
public void setScrubberColor(ColorStateList stateList) { mScrubberStateList = stateList; mScrubberColor = mScrubberStateList.getDefaultColor(); if (mAlpha < 255) { mCurScrubberColor = Ui.modulateColorAlpha(mScrubberColor, mAlpha); } else { mCurScrubberColor = mSc...
[ "public", "void", "setScrubberColor", "(", "ColorStateList", "stateList", ")", "{", "mScrubberStateList", "=", "stateList", ";", "mScrubberColor", "=", "mScrubberStateList", ".", "getDefaultColor", "(", ")", ";", "if", "(", "mAlpha", "<", "255", ")", "{", "mCurS...
Set the Scrubber ColorStateList @param stateList ColorStateList
[ "Set", "the", "Scrubber", "ColorStateList" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/SeekBarStateDrawable.java#L136-L145
113,165
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/SeekBarStateDrawable.java
SeekBarStateDrawable.setThumbColor
public void setThumbColor(ColorStateList stateList) { mThumbStateList = stateList; mThumbColor = mThumbStateList.getDefaultColor(); if (mAlpha < 255) { mCurThumbColor = Ui.modulateColorAlpha(mThumbColor, mAlpha); } else { mCurThumbColor = mThumbColor; } ...
java
public void setThumbColor(ColorStateList stateList) { mThumbStateList = stateList; mThumbColor = mThumbStateList.getDefaultColor(); if (mAlpha < 255) { mCurThumbColor = Ui.modulateColorAlpha(mThumbColor, mAlpha); } else { mCurThumbColor = mThumbColor; } ...
[ "public", "void", "setThumbColor", "(", "ColorStateList", "stateList", ")", "{", "mThumbStateList", "=", "stateList", ";", "mThumbColor", "=", "mThumbStateList", ".", "getDefaultColor", "(", ")", ";", "if", "(", "mAlpha", "<", "255", ")", "{", "mCurThumbColor", ...
Set the Thumb ColorStateList @param stateList ColorStateList
[ "Set", "the", "Thumb", "ColorStateList" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/SeekBarStateDrawable.java#L160-L169
113,166
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/StateColorDrawable.java
StateColorDrawable.changeColor
protected boolean changeColor(int color) { boolean bFlag = mColor != color; if (bFlag) { mColor = color; //We've changed states onColorChange(color); invalidateSelf(); } return bFlag; }
java
protected boolean changeColor(int color) { boolean bFlag = mColor != color; if (bFlag) { mColor = color; //We've changed states onColorChange(color); invalidateSelf(); } return bFlag; }
[ "protected", "boolean", "changeColor", "(", "int", "color", ")", "{", "boolean", "bFlag", "=", "mColor", "!=", "color", ";", "if", "(", "bFlag", ")", "{", "mColor", "=", "color", ";", "//We've changed states", "onColorChange", "(", "color", ")", ";", "inva...
Set CurrentColor value @param color New Color @return If new value != current value return true
[ "Set", "CurrentColor", "value" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/StateColorDrawable.java#L126-L135
113,167
qiujuer/Genius-Android
caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/Run.java
Run.onBackground
public static Result onBackground(Action action) { final HandlerPoster poster = getBackgroundPoster(); if (Looper.myLooper() == poster.getLooper()) { action.call(); return new ActionAsyncTask(action, true); } ActionAsyncTask task = new ActionAsyncTask(action); ...
java
public static Result onBackground(Action action) { final HandlerPoster poster = getBackgroundPoster(); if (Looper.myLooper() == poster.getLooper()) { action.call(); return new ActionAsyncTask(action, true); } ActionAsyncTask task = new ActionAsyncTask(action); ...
[ "public", "static", "Result", "onBackground", "(", "Action", "action", ")", "{", "final", "HandlerPoster", "poster", "=", "getBackgroundPoster", "(", ")", ";", "if", "(", "Looper", ".", "myLooper", "(", ")", "==", "poster", ".", "getLooper", "(", ")", ")",...
Asynchronously The current thread asynchronous run relative to the sub thread, not blocking the current thread @param action Action Interface, you can do something in this
[ "Asynchronously", "The", "current", "thread", "asynchronous", "run", "relative", "to", "the", "sub", "thread", "not", "blocking", "the", "current", "thread" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/Run.java#L115-L124
113,168
qiujuer/Genius-Android
caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/Run.java
Run.onUiAsync
public static Result onUiAsync(Action action) { if (Looper.myLooper() == Looper.getMainLooper()) { action.call(); return new ActionAsyncTask(action, true); } ActionAsyncTask task = new ActionAsyncTask(action); getUiPoster().async(task); return task; }
java
public static Result onUiAsync(Action action) { if (Looper.myLooper() == Looper.getMainLooper()) { action.call(); return new ActionAsyncTask(action, true); } ActionAsyncTask task = new ActionAsyncTask(action); getUiPoster().async(task); return task; }
[ "public", "static", "Result", "onUiAsync", "(", "Action", "action", ")", "{", "if", "(", "Looper", ".", "myLooper", "(", ")", "==", "Looper", ".", "getMainLooper", "(", ")", ")", "{", "action", ".", "call", "(", ")", ";", "return", "new", "ActionAsyncT...
Asynchronously The current thread asynchronous run relative to the main thread, not blocking the current thread @param action Action Interface
[ "Asynchronously", "The", "current", "thread", "asynchronous", "run", "relative", "to", "the", "main", "thread", "not", "blocking", "the", "current", "thread" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/Run.java#L134-L142
113,169
qiujuer/Genius-Android
caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/Run.java
Run.onUiSync
public static void onUiSync(Action action) { if (Looper.myLooper() == Looper.getMainLooper()) { action.call(); return; } ActionSyncTask poster = new ActionSyncTask(action); getUiPoster().sync(poster); poster.waitRun(); }
java
public static void onUiSync(Action action) { if (Looper.myLooper() == Looper.getMainLooper()) { action.call(); return; } ActionSyncTask poster = new ActionSyncTask(action); getUiPoster().sync(poster); poster.waitRun(); }
[ "public", "static", "void", "onUiSync", "(", "Action", "action", ")", "{", "if", "(", "Looper", ".", "myLooper", "(", ")", "==", "Looper", ".", "getMainLooper", "(", ")", ")", "{", "action", ".", "call", "(", ")", ";", "return", ";", "}", "ActionSync...
Synchronously The current thread relative thread synchronization operation, blocking the current thread, thread for the main thread to complete @param action Action Interface
[ "Synchronously", "The", "current", "thread", "relative", "thread", "synchronization", "operation", "blocking", "the", "current", "thread", "thread", "for", "the", "main", "thread", "to", "complete" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/Run.java#L152-L160
113,170
qiujuer/Genius-Android
caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/TraceRoute.java
TraceRoute.onComplete
void onComplete(TraceRouteThread trace, boolean isError, boolean isArrived, TraceRouteContainer routeContainer) { if (threads != null) { synchronized (mLock) { try { threads.remove(trace); } catch (NullPointerException e) { e.pr...
java
void onComplete(TraceRouteThread trace, boolean isError, boolean isArrived, TraceRouteContainer routeContainer) { if (threads != null) { synchronized (mLock) { try { threads.remove(trace); } catch (NullPointerException e) { e.pr...
[ "void", "onComplete", "(", "TraceRouteThread", "trace", ",", "boolean", "isError", ",", "boolean", "isArrived", ",", "TraceRouteContainer", "routeContainer", ")", "{", "if", "(", "threads", "!=", "null", ")", "{", "synchronized", "(", "mLock", ")", "{", "try",...
Will the run thread is complete should call this method @param trace TraceRouteThread @param isError The run status @param isArrived Is Arrived the ip @param routeContainer TraceRouteContainer
[ "Will", "the", "run", "thread", "is", "complete", "should", "call", "this", "method" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/TraceRoute.java#L190-L209
113,171
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java
SVGParser.parseFontFamily
private static List<String> parseFontFamily(String val) { List<String> fonts = null; TextScanner scan = new TextScanner(val); while (true) { String item = scan.nextQuotedString(); if (item == null) item = scan.nextTokenWithWhitespace(','); if ...
java
private static List<String> parseFontFamily(String val) { List<String> fonts = null; TextScanner scan = new TextScanner(val); while (true) { String item = scan.nextQuotedString(); if (item == null) item = scan.nextTokenWithWhitespace(','); if ...
[ "private", "static", "List", "<", "String", ">", "parseFontFamily", "(", "String", "val", ")", "{", "List", "<", "String", ">", "fonts", "=", "null", ";", "TextScanner", "scan", "=", "new", "TextScanner", "(", "val", ")", ";", "while", "(", "true", ")"...
Parse a font family list
[ "Parse", "a", "font", "family", "list" ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java#L3860-L3879
113,172
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java
SVGParser.parseFontSize
private static Length parseFontSize(String val) { try { Length size = FontSizeKeywords.get(val); if (size == null) size = parseLength(val); return size; } catch (SVGParseException e) { return null; } }
java
private static Length parseFontSize(String val) { try { Length size = FontSizeKeywords.get(val); if (size == null) size = parseLength(val); return size; } catch (SVGParseException e) { return null; } }
[ "private", "static", "Length", "parseFontSize", "(", "String", "val", ")", "{", "try", "{", "Length", "size", "=", "FontSizeKeywords", ".", "get", "(", "val", ")", ";", "if", "(", "size", "==", "null", ")", "size", "=", "parseLength", "(", "val", ")", ...
Parse a font size keyword or numerical value
[ "Parse", "a", "font", "size", "keyword", "or", "numerical", "value" ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java#L3883-L3893
113,173
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java
SVGParser.parseFontStyle
private static Style.FontStyle parseFontStyle(String val) { // Italic is probably the most common, so test that first :) switch (val) { case "italic": return Style.FontStyle.Italic; case "normal": return Style.FontStyle.Normal; case "oblique": return Style.FontS...
java
private static Style.FontStyle parseFontStyle(String val) { // Italic is probably the most common, so test that first :) switch (val) { case "italic": return Style.FontStyle.Italic; case "normal": return Style.FontStyle.Normal; case "oblique": return Style.FontS...
[ "private", "static", "Style", ".", "FontStyle", "parseFontStyle", "(", "String", "val", ")", "{", "// Italic is probably the most common, so test that first :)\r", "switch", "(", "val", ")", "{", "case", "\"italic\"", ":", "return", "Style", ".", "FontStyle", ".", "...
Parse a font style keyword
[ "Parse", "a", "font", "style", "keyword" ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java#L3904-L3914
113,174
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java
SVGParser.parseFillRule
private static Style.FillRule parseFillRule(String val) { if ("nonzero".equals(val)) return Style.FillRule.NonZero; if ("evenodd".equals(val)) return Style.FillRule.EvenOdd; return null; }
java
private static Style.FillRule parseFillRule(String val) { if ("nonzero".equals(val)) return Style.FillRule.NonZero; if ("evenodd".equals(val)) return Style.FillRule.EvenOdd; return null; }
[ "private", "static", "Style", ".", "FillRule", "parseFillRule", "(", "String", "val", ")", "{", "if", "(", "\"nonzero\"", ".", "equals", "(", "val", ")", ")", "return", "Style", ".", "FillRule", ".", "NonZero", ";", "if", "(", "\"evenodd\"", ".", "equals...
Parse fill rule
[ "Parse", "fill", "rule" ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java#L3945-L3952
113,175
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java
SVGParser.parseStrokeLineCap
private static Style.LineCap parseStrokeLineCap(String val) { if ("butt".equals(val)) return Style.LineCap.Butt; if ("round".equals(val)) return Style.LineCap.Round; if ("square".equals(val)) return Style.LineCap.Square; return null; }
java
private static Style.LineCap parseStrokeLineCap(String val) { if ("butt".equals(val)) return Style.LineCap.Butt; if ("round".equals(val)) return Style.LineCap.Round; if ("square".equals(val)) return Style.LineCap.Square; return null; }
[ "private", "static", "Style", ".", "LineCap", "parseStrokeLineCap", "(", "String", "val", ")", "{", "if", "(", "\"butt\"", ".", "equals", "(", "val", ")", ")", "return", "Style", ".", "LineCap", ".", "Butt", ";", "if", "(", "\"round\"", ".", "equals", ...
Parse stroke-linecap
[ "Parse", "stroke", "-", "linecap" ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java#L3956-L3965
113,176
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java
SVGParser.parseStrokeLineJoin
private static Style.LineJoin parseStrokeLineJoin(String val) { if ("miter".equals(val)) return Style.LineJoin.Miter; if ("round".equals(val)) return Style.LineJoin.Round; if ("bevel".equals(val)) return Style.LineJoin.Bevel; return null; }
java
private static Style.LineJoin parseStrokeLineJoin(String val) { if ("miter".equals(val)) return Style.LineJoin.Miter; if ("round".equals(val)) return Style.LineJoin.Round; if ("bevel".equals(val)) return Style.LineJoin.Bevel; return null; }
[ "private", "static", "Style", ".", "LineJoin", "parseStrokeLineJoin", "(", "String", "val", ")", "{", "if", "(", "\"miter\"", ".", "equals", "(", "val", ")", ")", "return", "Style", ".", "LineJoin", ".", "Miter", ";", "if", "(", "\"round\"", ".", "equals...
Parse stroke-linejoin
[ "Parse", "stroke", "-", "linejoin" ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java#L3969-L3978
113,177
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java
SVGParser.parseStrokeDashArray
private static Length[] parseStrokeDashArray(String val) { TextScanner scan = new TextScanner(val); scan.skipWhitespace(); if (scan.empty()) return null; Length dash = scan.nextLength(); if (dash == null) return null; if (dash.isNegative()) ...
java
private static Length[] parseStrokeDashArray(String val) { TextScanner scan = new TextScanner(val); scan.skipWhitespace(); if (scan.empty()) return null; Length dash = scan.nextLength(); if (dash == null) return null; if (dash.isNegative()) ...
[ "private", "static", "Length", "[", "]", "parseStrokeDashArray", "(", "String", "val", ")", "{", "TextScanner", "scan", "=", "new", "TextScanner", "(", "val", ")", ";", "scan", ".", "skipWhitespace", "(", ")", ";", "if", "(", "scan", ".", "empty", "(", ...
Parse stroke-dasharray
[ "Parse", "stroke", "-", "dasharray" ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java#L3982-L4018
113,178
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java
SVGParser.parseVectorEffect
private static VectorEffect parseVectorEffect(String val) { switch (val) { case NONE: return Style.VectorEffect.None; case "non-scaling-stroke": return Style.VectorEffect.NonScalingStroke; default: return null; } }
java
private static VectorEffect parseVectorEffect(String val) { switch (val) { case NONE: return Style.VectorEffect.None; case "non-scaling-stroke": return Style.VectorEffect.NonScalingStroke; default: return null; } }
[ "private", "static", "VectorEffect", "parseVectorEffect", "(", "String", "val", ")", "{", "switch", "(", "val", ")", "{", "case", "NONE", ":", "return", "Style", ".", "VectorEffect", ".", "None", ";", "case", "\"non-scaling-stroke\"", ":", "return", "Style", ...
Parse a vector effect keyword
[ "Parse", "a", "vector", "effect", "keyword" ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java#L4088-L4096
113,179
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java
SVGParser.parseRenderQuality
private static RenderQuality parseRenderQuality(String val) { switch (val) { case "auto": return RenderQuality.auto; case "optimizeQuality": return RenderQuality.optimizeQuality; case "optimizeSpeed": return RenderQuality.optimizeSpeed; default: ...
java
private static RenderQuality parseRenderQuality(String val) { switch (val) { case "auto": return RenderQuality.auto; case "optimizeQuality": return RenderQuality.optimizeQuality; case "optimizeSpeed": return RenderQuality.optimizeSpeed; default: ...
[ "private", "static", "RenderQuality", "parseRenderQuality", "(", "String", "val", ")", "{", "switch", "(", "val", ")", "{", "case", "\"auto\"", ":", "return", "RenderQuality", ".", "auto", ";", "case", "\"optimizeQuality\"", ":", "return", "RenderQuality", ".", ...
Parse a rendering quality property
[ "Parse", "a", "rendering", "quality", "property" ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java#L4100-L4109
113,180
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java
SVGParser.parseSystemLanguage
private static Set<String> parseSystemLanguage(String val) { TextScanner scan = new TextScanner(val); HashSet<String> result = new HashSet<>(); while (!scan.empty()) { String language = scan.nextToken(); int hyphenPos = language.indexOf('-'); if (...
java
private static Set<String> parseSystemLanguage(String val) { TextScanner scan = new TextScanner(val); HashSet<String> result = new HashSet<>(); while (!scan.empty()) { String language = scan.nextToken(); int hyphenPos = language.indexOf('-'); if (...
[ "private", "static", "Set", "<", "String", ">", "parseSystemLanguage", "(", "String", "val", ")", "{", "TextScanner", "scan", "=", "new", "TextScanner", "(", "val", ")", ";", "HashSet", "<", "String", ">", "result", "=", "new", "HashSet", "<>", "(", ")",...
must be supported if we are to render this element
[ "must", "be", "supported", "if", "we", "are", "to", "render", "this", "element" ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java#L4391-L4409
113,181
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVGImageView.java
SVGImageView.setSVG
public void setSVG(SVG svg, String css) { if (svg == null) throw new IllegalArgumentException("Null value passed to setSVG()"); this.svg = svg; this.renderOptions.css(css); doRender(); }
java
public void setSVG(SVG svg, String css) { if (svg == null) throw new IllegalArgumentException("Null value passed to setSVG()"); this.svg = svg; this.renderOptions.css(css); doRender(); }
[ "public", "void", "setSVG", "(", "SVG", "svg", ",", "String", "css", ")", "{", "if", "(", "svg", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"Null value passed to setSVG()\"", ")", ";", "this", ".", "svg", "=", "svg", ";", "this",...
Directly set the SVG and the CSS. @param svg An {@code SVG} instance @param css Optional extra CSS to apply when rendering @since 1.3
[ "Directly", "set", "the", "SVG", "and", "the", "CSS", "." ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGImageView.java#L152-L161
113,182
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVG.java
SVG.getFromAsset
@SuppressWarnings({"WeakerAccess", "unused"}) public static SVG getFromAsset(AssetManager assetManager, String filename) throws SVGParseException, IOException { SVGParser parser = new SVGParser(); InputStream is = assetManager.open(filename); try { return parser.parse(is, ena...
java
@SuppressWarnings({"WeakerAccess", "unused"}) public static SVG getFromAsset(AssetManager assetManager, String filename) throws SVGParseException, IOException { SVGParser parser = new SVGParser(); InputStream is = assetManager.open(filename); try { return parser.parse(is, ena...
[ "@", "SuppressWarnings", "(", "{", "\"WeakerAccess\"", ",", "\"unused\"", "}", ")", "public", "static", "SVG", "getFromAsset", "(", "AssetManager", "assetManager", ",", "String", "filename", ")", "throws", "SVGParseException", ",", "IOException", "{", "SVGParser", ...
Read and parse an SVG from the assets folder. @param assetManager the AssetManager instance to use when reading the file. @param filename the filename of the SVG document within assets. @return an SVG instance on which you can call one of the render methods. @throws SVGParseException if there is an error parsing the d...
[ "Read", "and", "parse", "an", "SVG", "from", "the", "assets", "folder", "." ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVG.java#L219-L233
113,183
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVG.java
SVG.getDocumentViewBox
@SuppressWarnings({"WeakerAccess", "unused"}) public RectF getDocumentViewBox() { if (this.rootElement == null) throw new IllegalArgumentException("SVG document is empty"); if (this.rootElement.viewBox == null) return null; return this.rootElement.viewBox.toRectF();...
java
@SuppressWarnings({"WeakerAccess", "unused"}) public RectF getDocumentViewBox() { if (this.rootElement == null) throw new IllegalArgumentException("SVG document is empty"); if (this.rootElement.viewBox == null) return null; return this.rootElement.viewBox.toRectF();...
[ "@", "SuppressWarnings", "(", "{", "\"WeakerAccess\"", ",", "\"unused\"", "}", ")", "public", "RectF", "getDocumentViewBox", "(", ")", "{", "if", "(", "this", ".", "rootElement", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"SVG document...
Returns the viewBox attribute of the current SVG document. @return the document's viewBox attribute as a {@code android.graphics.RectF} object, or null if not set. @throws IllegalArgumentException if there is no current SVG document loaded.
[ "Returns", "the", "viewBox", "attribute", "of", "the", "current", "SVG", "document", "." ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVG.java#L832-L842
113,184
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SimpleAssetResolver.java
SimpleAssetResolver.resolveFont
@Override public Typeface resolveFont(String fontFamily, int fontWeight, String fontStyle) { Log.i(TAG, "resolveFont("+fontFamily+","+fontWeight+","+fontStyle+")"); // Try font name with suffix ".ttf" try { return Typeface.createFromAsset(assetManager, fontFamily + ".ttf...
java
@Override public Typeface resolveFont(String fontFamily, int fontWeight, String fontStyle) { Log.i(TAG, "resolveFont("+fontFamily+","+fontWeight+","+fontStyle+")"); // Try font name with suffix ".ttf" try { return Typeface.createFromAsset(assetManager, fontFamily + ".ttf...
[ "@", "Override", "public", "Typeface", "resolveFont", "(", "String", "fontFamily", ",", "int", "fontWeight", ",", "String", "fontStyle", ")", "{", "Log", ".", "i", "(", "TAG", ",", "\"resolveFont(\"", "+", "fontFamily", "+", "\",\"", "+", "fontWeight", "+", ...
Attempt to find the specified font in the "assets" folder and return a Typeface object. For the font name "Foo", first the file "Foo.ttf" will be tried and if that fails, "Foo.otf".
[ "Attempt", "to", "find", "the", "specified", "font", "in", "the", "assets", "folder", "and", "return", "a", "Typeface", "object", ".", "For", "the", "font", "name", "Foo", "first", "the", "file", "Foo", ".", "ttf", "will", "be", "tried", "and", "if", "...
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SimpleAssetResolver.java#L78-L99
113,185
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SimpleAssetResolver.java
SimpleAssetResolver.resolveCSSStyleSheet
@Override public String resolveCSSStyleSheet(String url) { Log.i(TAG, "resolveCSSStyleSheet("+url+")"); return getAssetAsString(url); }
java
@Override public String resolveCSSStyleSheet(String url) { Log.i(TAG, "resolveCSSStyleSheet("+url+")"); return getAssetAsString(url); }
[ "@", "Override", "public", "String", "resolveCSSStyleSheet", "(", "String", "url", ")", "{", "Log", ".", "i", "(", "TAG", ",", "\"resolveCSSStyleSheet(\"", "+", "url", "+", "\")\"", ")", ";", "return", "getAssetAsString", "(", "url", ")", ";", "}" ]
Attempt to find the specified stylesheet file in the "assets" folder and return its string contents. @since 1.3
[ "Attempt", "to", "find", "the", "specified", "stylesheet", "file", "in", "the", "assets", "folder", "and", "return", "its", "string", "contents", "." ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SimpleAssetResolver.java#L137-L142
113,186
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java
SVGAndroidRenderer.render
private void render(SVG.Svg obj) { // <svg> elements establish a new viewport. Box viewPort = makeViewPort(obj.x, obj.y, obj.width, obj.height); render(obj, viewPort, obj.viewBox, obj.preserveAspectRatio); }
java
private void render(SVG.Svg obj) { // <svg> elements establish a new viewport. Box viewPort = makeViewPort(obj.x, obj.y, obj.width, obj.height); render(obj, viewPort, obj.viewBox, obj.preserveAspectRatio); }
[ "private", "void", "render", "(", "SVG", ".", "Svg", "obj", ")", "{", "// <svg> elements establish a new viewport.\r", "Box", "viewPort", "=", "makeViewPort", "(", "obj", ".", "x", ",", "obj", ".", "y", ",", "obj", ".", "width", ",", "obj", ".", "height", ...
Renderers for each element type
[ "Renderers", "for", "each", "element", "type" ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java#L565-L571
113,187
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java
SVGAndroidRenderer.makeViewPort
private Box makeViewPort(Length x, Length y, Length width, Length height) { float _x = (x != null) ? x.floatValueX(this) : 0f; float _y = (y != null) ? y.floatValueY(this) : 0f; Box viewPortUser = getCurrentViewPortInUserUnits(); float _w = (width != null) ? width.floatValueX(this) ...
java
private Box makeViewPort(Length x, Length y, Length width, Length height) { float _x = (x != null) ? x.floatValueX(this) : 0f; float _y = (y != null) ? y.floatValueY(this) : 0f; Box viewPortUser = getCurrentViewPortInUserUnits(); float _w = (width != null) ? width.floatValueX(this) ...
[ "private", "Box", "makeViewPort", "(", "Length", "x", ",", "Length", "y", ",", "Length", "width", ",", "Length", "height", ")", "{", "float", "_x", "=", "(", "x", "!=", "null", ")", "?", "x", ".", "floatValueX", "(", "this", ")", ":", "0f", ";", ...
Derive the viewport from the x, y, width and height attributes of an object
[ "Derive", "the", "viewport", "from", "the", "x", "y", "width", "and", "height", "attributes", "of", "an", "object" ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java#L630-L640
113,188
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java
SVGAndroidRenderer.checkForClipPath_OldStyle
private void checkForClipPath_OldStyle(SvgElement obj, Box boundingBox) { // Use the old/original method for clip paths // Locate the referenced object SvgObject ref = obj.document.resolveIRI(state.style.clipPath); if (ref == null) { error("ClipPath reference '%s' not found"...
java
private void checkForClipPath_OldStyle(SvgElement obj, Box boundingBox) { // Use the old/original method for clip paths // Locate the referenced object SvgObject ref = obj.document.resolveIRI(state.style.clipPath); if (ref == null) { error("ClipPath reference '%s' not found"...
[ "private", "void", "checkForClipPath_OldStyle", "(", "SvgElement", "obj", ",", "Box", "boundingBox", ")", "{", "// Use the old/original method for clip paths\r", "// Locate the referenced object\r", "SvgObject", "ref", "=", "obj", ".", "document", ".", "resolveIRI", "(", ...
Pre-KitKat. Kept for backwards compatibility.
[ "Pre", "-", "KitKat", ".", "Kept", "for", "backwards", "compatibility", "." ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java#L3864-L3918
113,189
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java
SVGAndroidRenderer.clipStatePush
private void clipStatePush() { // Save matrix but not clip CanvasLegacy.save(canvas, CanvasLegacy.MATRIX_SAVE_FLAG); // Save style state stateStack.push(state); state = new RendererState(state); }
java
private void clipStatePush() { // Save matrix but not clip CanvasLegacy.save(canvas, CanvasLegacy.MATRIX_SAVE_FLAG); // Save style state stateStack.push(state); state = new RendererState(state); }
[ "private", "void", "clipStatePush", "(", ")", "{", "// Save matrix but not clip\r", "CanvasLegacy", ".", "save", "(", "canvas", ",", "CanvasLegacy", ".", "MATRIX_SAVE_FLAG", ")", ";", "// Save style state\r", "stateStack", ".", "push", "(", "state", ")", ";", "sta...
destroy the clip region we are trying to build.
[ "destroy", "the", "clip", "region", "we", "are", "trying", "to", "build", "." ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java#L3953-L3960
113,190
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/RenderOptions.java
RenderOptions.css
public RenderOptions css(String css) { CSSParser parser = new CSSParser(CSSParser.Source.RenderOptions); this.css = parser.parse(css); return this; }
java
public RenderOptions css(String css) { CSSParser parser = new CSSParser(CSSParser.Source.RenderOptions); this.css = parser.parse(css); return this; }
[ "public", "RenderOptions", "css", "(", "String", "css", ")", "{", "CSSParser", "parser", "=", "new", "CSSParser", "(", "CSSParser", ".", "Source", ".", "RenderOptions", ")", ";", "this", ".", "css", "=", "parser", ".", "parse", "(", "css", ")", ";", "r...
Specifies some additional CSS rules that will be applied during render in addition to any specified in the file itself. @param css CSS rules to apply @return this same <code>RenderOptions</code> instance
[ "Specifies", "some", "additional", "CSS", "rules", "that", "will", "be", "applied", "during", "render", "in", "addition", "to", "any", "specified", "in", "the", "file", "itself", "." ]
0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/RenderOptions.java#L92-L97
113,191
JakeWharton/scalpel
scalpel/src/main/java/com/jakewharton/scalpel/ScalpelFrameLayout.java
ScalpelFrameLayout.setChromeColor
public void setChromeColor(int color) { if (chromeColor != color) { viewBorderPaint.setColor(color); chromeColor = color; invalidate(); } }
java
public void setChromeColor(int color) { if (chromeColor != color) { viewBorderPaint.setColor(color); chromeColor = color; invalidate(); } }
[ "public", "void", "setChromeColor", "(", "int", "color", ")", "{", "if", "(", "chromeColor", "!=", "color", ")", "{", "viewBorderPaint", ".", "setColor", "(", "color", ")", ";", "chromeColor", "=", "color", ";", "invalidate", "(", ")", ";", "}", "}" ]
Set the view border chrome color.
[ "Set", "the", "view", "border", "chrome", "color", "." ]
97299acd1cc7b4138af714f1ed0bce47e9ce516d
https://github.com/JakeWharton/scalpel/blob/97299acd1cc7b4138af714f1ed0bce47e9ce516d/scalpel/src/main/java/com/jakewharton/scalpel/ScalpelFrameLayout.java#L150-L156
113,192
JakeWharton/scalpel
scalpel/src/main/java/com/jakewharton/scalpel/ScalpelFrameLayout.java
ScalpelFrameLayout.setChromeShadowColor
public void setChromeShadowColor(int color) { if (chromeShadowColor != color) { viewBorderPaint.setShadowLayer(1, -1, 1, color); chromeShadowColor = color; invalidate(); } }
java
public void setChromeShadowColor(int color) { if (chromeShadowColor != color) { viewBorderPaint.setShadowLayer(1, -1, 1, color); chromeShadowColor = color; invalidate(); } }
[ "public", "void", "setChromeShadowColor", "(", "int", "color", ")", "{", "if", "(", "chromeShadowColor", "!=", "color", ")", "{", "viewBorderPaint", ".", "setShadowLayer", "(", "1", ",", "-", "1", ",", "1", ",", "color", ")", ";", "chromeShadowColor", "=",...
Set the view border chrome shadow color.
[ "Set", "the", "view", "border", "chrome", "shadow", "color", "." ]
97299acd1cc7b4138af714f1ed0bce47e9ce516d
https://github.com/JakeWharton/scalpel/blob/97299acd1cc7b4138af714f1ed0bce47e9ce516d/scalpel/src/main/java/com/jakewharton/scalpel/ScalpelFrameLayout.java#L164-L170
113,193
kennycason/kumo
kumo-core/src/main/java/com/kennycason/kumo/WordCloud.java
WordCloud.writeToStream
public void writeToStream(final String format, final OutputStream outputStream) { try { LOGGER.debug("Writing WordCloud image data to output stream"); ImageIO.write(bufferedImage, format, outputStream); LOGGER.debug("Done writing WordCloud image data to output stream"); ...
java
public void writeToStream(final String format, final OutputStream outputStream) { try { LOGGER.debug("Writing WordCloud image data to output stream"); ImageIO.write(bufferedImage, format, outputStream); LOGGER.debug("Done writing WordCloud image data to output stream"); ...
[ "public", "void", "writeToStream", "(", "final", "String", "format", ",", "final", "OutputStream", "outputStream", ")", "{", "try", "{", "LOGGER", ".", "debug", "(", "\"Writing WordCloud image data to output stream\"", ")", ";", "ImageIO", ".", "write", "(", "buff...
Write wordcloud image data to stream in the given format @param format the image format @param outputStream the output stream to write image data to
[ "Write", "wordcloud", "image", "data", "to", "stream", "in", "the", "given", "format" ]
bc577f468f162dbaf61c327a2d4f1989c61c57a0
https://github.com/kennycason/kumo/blob/bc577f468f162dbaf61c327a2d4f1989c61c57a0/kumo-core/src/main/java/com/kennycason/kumo/WordCloud.java#L131-L141
113,194
kennycason/kumo
kumo-core/src/main/java/com/kennycason/kumo/WordCloud.java
WordCloud.drawForegroundToBackground
protected void drawForegroundToBackground() { if (backgroundColor == null) { return; } final BufferedImage backgroundBufferedImage = new BufferedImage(dimension.width, dimension.height, this.bufferedImage.getType()); final Graphics graphics = backgroundBufferedImage.getGraphics(); // d...
java
protected void drawForegroundToBackground() { if (backgroundColor == null) { return; } final BufferedImage backgroundBufferedImage = new BufferedImage(dimension.width, dimension.height, this.bufferedImage.getType()); final Graphics graphics = backgroundBufferedImage.getGraphics(); // d...
[ "protected", "void", "drawForegroundToBackground", "(", ")", "{", "if", "(", "backgroundColor", "==", "null", ")", "{", "return", ";", "}", "final", "BufferedImage", "backgroundBufferedImage", "=", "new", "BufferedImage", "(", "dimension", ".", "width", ",", "di...
create background, then draw current word cloud on top of it. Doing it this way preserves the transparency of the this.bufferedImage's pixels for a more flexible pixel perfect collision
[ "create", "background", "then", "draw", "current", "word", "cloud", "on", "top", "of", "it", ".", "Doing", "it", "this", "way", "preserves", "the", "transparency", "of", "the", "this", ".", "bufferedImage", "s", "pixels", "for", "a", "more", "flexible", "p...
bc577f468f162dbaf61c327a2d4f1989c61c57a0
https://github.com/kennycason/kumo/blob/bc577f468f162dbaf61c327a2d4f1989c61c57a0/kumo-core/src/main/java/com/kennycason/kumo/WordCloud.java#L148-L162
113,195
kennycason/kumo
kumo-core/src/main/java/com/kennycason/kumo/WordCloud.java
WordCloud.computeRadius
static int computeRadius(final Dimension dimension, final Point start) { final int maxDistanceX = Math.max(start.x, dimension.width - start.x) + 1; final int maxDistanceY = Math.max(start.y, dimension.height - start.y) + 1; // we use the pythagorean theorem to determinate the maximum ra...
java
static int computeRadius(final Dimension dimension, final Point start) { final int maxDistanceX = Math.max(start.x, dimension.width - start.x) + 1; final int maxDistanceY = Math.max(start.y, dimension.height - start.y) + 1; // we use the pythagorean theorem to determinate the maximum ra...
[ "static", "int", "computeRadius", "(", "final", "Dimension", "dimension", ",", "final", "Point", "start", ")", "{", "final", "int", "maxDistanceX", "=", "Math", ".", "max", "(", "start", ".", "x", ",", "dimension", ".", "width", "-", "start", ".", "x", ...
compute the maximum radius for the placing spiral @param dimension the size of the backgound @param start the center of the spiral @return the maximum usefull radius
[ "compute", "the", "maximum", "radius", "for", "the", "placing", "spiral" ]
bc577f468f162dbaf61c327a2d4f1989c61c57a0
https://github.com/kennycason/kumo/blob/bc577f468f162dbaf61c327a2d4f1989c61c57a0/kumo-core/src/main/java/com/kennycason/kumo/WordCloud.java#L171-L177
113,196
kennycason/kumo
kumo-core/src/main/java/com/kennycason/kumo/WordCloud.java
WordCloud.place
protected boolean place(final Word word, final Point start) { final Graphics graphics = this.bufferedImage.getGraphics(); final int maxRadius = computeRadius(dimension, start); final Point position = word.getPosition(); for (int r = 0; r < maxRadius; r += 2) { for (...
java
protected boolean place(final Word word, final Point start) { final Graphics graphics = this.bufferedImage.getGraphics(); final int maxRadius = computeRadius(dimension, start); final Point position = word.getPosition(); for (int r = 0; r < maxRadius; r += 2) { for (...
[ "protected", "boolean", "place", "(", "final", "Word", "word", ",", "final", "Point", "start", ")", "{", "final", "Graphics", "graphics", "=", "this", ".", "bufferedImage", ".", "getGraphics", "(", ")", ";", "final", "int", "maxRadius", "=", "computeRadius",...
try to place in center, build out in a spiral trying to place words for N steps @param word the word being placed @param start the place to start trying to place the word
[ "try", "to", "place", "in", "center", "build", "out", "in", "a", "spiral", "trying", "to", "place", "words", "for", "N", "steps" ]
bc577f468f162dbaf61c327a2d4f1989c61c57a0
https://github.com/kennycason/kumo/blob/bc577f468f162dbaf61c327a2d4f1989c61c57a0/kumo-core/src/main/java/com/kennycason/kumo/WordCloud.java#L184-L215
113,197
kennycason/kumo
kumo-core/src/main/java/com/kennycason/kumo/palette/LinearGradientColorPalette.java
LinearGradientColorPalette.createLinearGradient
private static List<Color> createLinearGradient(final Color color1, final Color color2, final int gradientSteps) { final List<Color> colors = new ArrayList<>(gradientSteps + 1); // add beginning color to the gradient colors.add(color1); for (int i = 1; i < gradientSteps; i++) { ...
java
private static List<Color> createLinearGradient(final Color color1, final Color color2, final int gradientSteps) { final List<Color> colors = new ArrayList<>(gradientSteps + 1); // add beginning color to the gradient colors.add(color1); for (int i = 1; i < gradientSteps; i++) { ...
[ "private", "static", "List", "<", "Color", ">", "createLinearGradient", "(", "final", "Color", "color1", ",", "final", "Color", "color2", ",", "final", "int", "gradientSteps", ")", "{", "final", "List", "<", "Color", ">", "colors", "=", "new", "ArrayList", ...
Creates a linear Gradient between two colors @param color1 start color @param color2 end color @param gradientSteps specifies the amount of colors in this gradient between color1 and color2, this includes both color1 and color2 @return List of colors in this gradient
[ "Creates", "a", "linear", "Gradient", "between", "two", "colors" ]
bc577f468f162dbaf61c327a2d4f1989c61c57a0
https://github.com/kennycason/kumo/blob/bc577f468f162dbaf61c327a2d4f1989c61c57a0/kumo-core/src/main/java/com/kennycason/kumo/palette/LinearGradientColorPalette.java#L95-L114
113,198
kennycason/kumo
kumo-core/src/main/java/com/kennycason/kumo/ParallelLayeredWordCloud.java
ParallelLayeredWordCloud.writeToFile
public void writeToFile(final String outputFileName, final boolean blockThread, final boolean shutdownExecutor) { if (blockThread) { waitForFuturesToBlockCurrentThread(); } super.writeToFile(outputFileName); if (shutdownExecutor) { this.shutdown(); } ...
java
public void writeToFile(final String outputFileName, final boolean blockThread, final boolean shutdownExecutor) { if (blockThread) { waitForFuturesToBlockCurrentThread(); } super.writeToFile(outputFileName); if (shutdownExecutor) { this.shutdown(); } ...
[ "public", "void", "writeToFile", "(", "final", "String", "outputFileName", ",", "final", "boolean", "blockThread", ",", "final", "boolean", "shutdownExecutor", ")", "{", "if", "(", "blockThread", ")", "{", "waitForFuturesToBlockCurrentThread", "(", ")", ";", "}", ...
Writes the wordcloud to an imagefile. @param outputFileName some file like "test.png" @param blockThread should the current thread be blocked @param shutdownExecutor should the executor be shutdown afterwards. if <code>false</code> this PLWC can still be used to build other layers. if <code>true</code> this will becom...
[ "Writes", "the", "wordcloud", "to", "an", "imagefile", "." ]
bc577f468f162dbaf61c327a2d4f1989c61c57a0
https://github.com/kennycason/kumo/blob/bc577f468f162dbaf61c327a2d4f1989c61c57a0/kumo-core/src/main/java/com/kennycason/kumo/ParallelLayeredWordCloud.java#L89-L98
113,199
julianhyde/sqlline
src/main/java/sqlline/DatabaseConnection.java
DatabaseConnection.initSyntaxRule
private void initSyntaxRule() throws SQLException { // Deduce the string used to quote identifiers. For example, Oracle // uses double-quotes: // SELECT * FROM "My Schema"."My Table" String identifierQuoteString = meta.getIdentifierQuoteString(); if (identifierQuoteString.length() > 1) { sql...
java
private void initSyntaxRule() throws SQLException { // Deduce the string used to quote identifiers. For example, Oracle // uses double-quotes: // SELECT * FROM "My Schema"."My Table" String identifierQuoteString = meta.getIdentifierQuoteString(); if (identifierQuoteString.length() > 1) { sql...
[ "private", "void", "initSyntaxRule", "(", ")", "throws", "SQLException", "{", "// Deduce the string used to quote identifiers. For example, Oracle", "// uses double-quotes:", "// SELECT * FROM \"My Schema\".\"My Table\"", "String", "identifierQuoteString", "=", "meta", ".", "getIde...
Initializes a syntax rule for a given database connection. <p>The rule is good for different highlighter and completer instances, but not necessarily for other database connections (because it depends on the set of keywords and identifier quote string).
[ "Initializes", "a", "syntax", "rule", "for", "a", "given", "database", "connection", "." ]
7577f3ebaca0897a9ff01d1553d4576487e1d2c3
https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/DatabaseConnection.java#L67-L83