diff options
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/madore/android/unicodeMap/UnicodeCharacter.java | 3 | ||||
-rw-r--r-- | src/org/madore/android/unicodeMap/UnicodeMapActivity.java | 24 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/org/madore/android/unicodeMap/UnicodeCharacter.java b/src/org/madore/android/unicodeMap/UnicodeCharacter.java index 5d53ccb..e79a982 100644 --- a/src/org/madore/android/unicodeMap/UnicodeCharacter.java +++ b/src/org/madore/android/unicodeMap/UnicodeCharacter.java @@ -225,6 +225,9 @@ public class UnicodeCharacter implements UnicodeDisplayable { public boolean belongs(int codePoint) { return ( codePoint>=this.from && codePoint<this.to ); } + public boolean belongs(UnicodeCharacter ch) { + return ( ch.codePoint>=this.from && ch.codePoint<this.to ); + } @Override public String toString() { return this.descr; } } diff --git a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java index 01f5fdb..f50ef1f 100644 --- a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java +++ b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java @@ -327,6 +327,30 @@ public final class UnicodeMapActivity extends ListActivity { text.setText(new String(s)); text = (TextView) dialog.findViewById(R.id.categoryLabel); text.setText(itch.getCategory().getDescr()); + if ( UnicodeCharacter.Range.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A.belongs(itch) + || UnicodeCharacter.Range.CJK_UNIFIED_IDEOGRAPHS.belongs(itch) + || UnicodeCharacter.Range.CJK_COMPATIBILITY_IDEOGRAPHS.belongs(itch) + || UnicodeCharacter.Range.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B.belongs(itch) + || UnicodeCharacter.Range.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C.belongs(itch) + || UnicodeCharacter.Range.CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT.belongs(itch) ) { + Button btn = new Button(UnicodeMapActivity.this); + btn.setText(R.string.unihan_lookup); + ((LinearLayout) dialog.findViewById(R.id.detailsLayout)) + .addView(btn, + ViewGroup.LayoutParams.FILL_PARENT, + ViewGroup.LayoutParams.WRAP_CONTENT); + final String tgt + = String.format("http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=%04X", + itch.getCodePoint()); + btn.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + Intent intent + = new Intent(Intent.ACTION_VIEW, + Uri.parse(tgt)); + startActivity(intent); + } + }); + } dialog.show(); return true; } else if ( it instanceof UnicodeRangeable ) { |