diff options
Diffstat (limited to 'src/org/madore')
-rw-r--r-- | src/org/madore/android/unicodeMap/UnicodeCharacter.java | 69 | ||||
-rw-r--r-- | src/org/madore/android/unicodeMap/UnicodeMapActivity.java | 2 |
2 files changed, 40 insertions, 31 deletions
diff --git a/src/org/madore/android/unicodeMap/UnicodeCharacter.java b/src/org/madore/android/unicodeMap/UnicodeCharacter.java index 58835bc..42e449a 100644 --- a/src/org/madore/android/unicodeMap/UnicodeCharacter.java +++ b/src/org/madore/android/unicodeMap/UnicodeCharacter.java @@ -312,41 +312,43 @@ public class UnicodeCharacter implements UnicodeDisplayable { } public static enum Category { - UPPERCASE_LETTER("Lu", Character.UPPERCASE_LETTER), - LOWERCASE_LETTER("Ll", Character.LOWERCASE_LETTER), - TITLECASE_LETTER("Lt", Character.TITLECASE_LETTER), - MODIFIER_LETTER("Lm", Character.MODIFIER_LETTER), - OTHER_LETTER("Lo", Character.OTHER_LETTER), - NON_SPACING_MARK("Mn", Character.NON_SPACING_MARK), - COMBINING_SPACING_MARK("Mc", Character.COMBINING_SPACING_MARK), - ENCLOSING_MARK("Me", Character.ENCLOSING_MARK), - DECIMAL_DIGIT_NUMBER("Nd", Character.DECIMAL_DIGIT_NUMBER), - LETTER_NUMBER("Nl", Character.LETTER_NUMBER), - OTHER_NUMBER("No", Character.OTHER_NUMBER), - CONNECTOR_PUNCTUATION("Pc", Character.CONNECTOR_PUNCTUATION), - DASH_PUNCTUATION("Pd", Character.DASH_PUNCTUATION), - START_PUNCTUATION("Ps", Character.START_PUNCTUATION), - END_PUNCTUATION("Pe", Character.END_PUNCTUATION), - INITIAL_QUOTE_PUNCTUATION("Pi", Character.INITIAL_QUOTE_PUNCTUATION), - FINAL_QUOTE_PUNCTUATION("Pf", Character.FINAL_QUOTE_PUNCTUATION), - OTHER_PUNCTUATION("Po", Character.OTHER_PUNCTUATION), - MATH_SYMBOL("Sm", Character.MATH_SYMBOL), - CURRENCY_SYMBOL("Sc", Character.CURRENCY_SYMBOL), - MODIFIER_SYMBOL("Sk", Character.MODIFIER_SYMBOL), - OTHER_SYMBOL("So", Character.OTHER_SYMBOL), - SPACE_SEPARATOR("Zs", Character.SPACE_SEPARATOR), - LINE_SEPARATOR("Zl", Character.LINE_SEPARATOR), - PARAGRAPH_SEPARATOR("Zp", Character.PARAGRAPH_SEPARATOR), - CONTROL("Cc", Character.CONTROL), - FORMAT("Cf", Character.FORMAT), - SURROGATE("Cs", Character.SURROGATE), - PRIVATE_USE("Co", Character.PRIVATE_USE), - UNASSIGNED("Cn", Character.UNASSIGNED); + UPPERCASE_LETTER("Lu", Character.UPPERCASE_LETTER, "Letter, Uppercase"), + LOWERCASE_LETTER("Ll", Character.LOWERCASE_LETTER, "Letter, Lowercase"), + TITLECASE_LETTER("Lt", Character.TITLECASE_LETTER, "Letter, Titlecase"), + MODIFIER_LETTER("Lm", Character.MODIFIER_LETTER, "Letter, Modifier"), + OTHER_LETTER("Lo", Character.OTHER_LETTER, "Letter, Other"), + NON_SPACING_MARK("Mn", Character.NON_SPACING_MARK, "Mark, Nonspacing"), + COMBINING_SPACING_MARK("Mc", Character.COMBINING_SPACING_MARK, "Mark, Spacing Combining"), + ENCLOSING_MARK("Me", Character.ENCLOSING_MARK, "Mark, Enclosing"), + DECIMAL_DIGIT_NUMBER("Nd", Character.DECIMAL_DIGIT_NUMBER, "Number, Decimal Digit"), + LETTER_NUMBER("Nl", Character.LETTER_NUMBER, "Number, Letter"), + OTHER_NUMBER("No", Character.OTHER_NUMBER, "Number, Other"), + CONNECTOR_PUNCTUATION("Pc", Character.CONNECTOR_PUNCTUATION, "Punctuation, Connector"), + DASH_PUNCTUATION("Pd", Character.DASH_PUNCTUATION, "Punctuation, Dash"), + START_PUNCTUATION("Ps", Character.START_PUNCTUATION, "Punctuation, Open"), + END_PUNCTUATION("Pe", Character.END_PUNCTUATION, "Punctuation, Close"), + INITIAL_QUOTE_PUNCTUATION("Pi", Character.INITIAL_QUOTE_PUNCTUATION, "Punctuation, Initial quote"), + FINAL_QUOTE_PUNCTUATION("Pf", Character.FINAL_QUOTE_PUNCTUATION, "Punctuation, Final quote"), + OTHER_PUNCTUATION("Po", Character.OTHER_PUNCTUATION, "Punctuation, Other"), + MATH_SYMBOL("Sm", Character.MATH_SYMBOL, "Symbol, Math"), + CURRENCY_SYMBOL("Sc", Character.CURRENCY_SYMBOL, "Symbol, Currency"), + MODIFIER_SYMBOL("Sk", Character.MODIFIER_SYMBOL, "Symbol, Modifier"), + OTHER_SYMBOL("So", Character.OTHER_SYMBOL, "Symbol, Other"), + SPACE_SEPARATOR("Zs", Character.SPACE_SEPARATOR, "Separator, Space"), + LINE_SEPARATOR("Zl", Character.LINE_SEPARATOR, "Separator, Line"), + PARAGRAPH_SEPARATOR("Zp", Character.PARAGRAPH_SEPARATOR, "Separator, Paragraph"), + CONTROL("Cc", Character.CONTROL, "Other, Control"), + FORMAT("Cf", Character.FORMAT, "Other, Format"), + SURROGATE("Cs", Character.SURROGATE, "Other, Surrogate"), + PRIVATE_USE("Co", Character.PRIVATE_USE, "Other, Private Use"), + UNASSIGNED("Cn", Character.UNASSIGNED, "Other, Not Assigned"); protected final String code; protected final byte javaValue; - Category(String code, byte javaValue) { + protected final String descr; + Category(String code, byte javaValue, String descr) { this.code = code; this.javaValue = javaValue; + this.descr = descr; } protected final static Map<String,Category> revMap = new HashMap<String,Category>(); @@ -362,6 +364,7 @@ public class UnicodeCharacter implements UnicodeDisplayable { } public String getCode() { return this.code; } public byte getJavaValue() { return this.javaValue; } + public String getDescr() { return this.descr; } } protected final static Set<Category> printable; @@ -416,6 +419,10 @@ public class UnicodeCharacter implements UnicodeDisplayable { return this.name; } + public Category getCategory() { + return this.category; + } + public String getChar() { return this.charStr; } diff --git a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java index d9c56a3..b0c1948 100644 --- a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java +++ b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java @@ -280,6 +280,8 @@ public final class UnicodeMapActivity extends ListActivity { for ( int i=0 ; i<bytes.length ; i++ ) fmt.format(" 0x%02x", bytes[i]); text.setText(new String(s)); + text = (TextView) dialog.findViewById(R.id.categoryLabel); + text.setText(itch.getCategory().getDescr()); dialog.show(); return true; } else if ( it instanceof UnicodeRangeable ) { |