From d0dc1cb1d518de0a02544654c55b938064e5e3eb Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Fri, 16 Mar 2012 19:17:13 +0100 Subject: Add a button to copy a character's name. --- src/org/madore/android/unicodeMap/UnicodeMapActivity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/org/madore') diff --git a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java index f82382b..aecea78 100644 --- a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java +++ b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java @@ -345,6 +345,16 @@ public final class UnicodeMapActivity extends ListActivity { textForm.append(itch.getChar()); } }); + final Button copyNameButton = (Button) dialog.findViewById(R.id.copyNameButton); + copyNameButton.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + dialog.dismiss(); + cmgr.setText(itch.getLabel()); + Toast.makeText(UnicodeMapActivity.this, + R.string.copied_toast, + Toast.LENGTH_SHORT).show(); + } + }); if ( UnicodeCharacter.Range.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A.belongs(itch) || UnicodeCharacter.Range.CJK_UNIFIED_IDEOGRAPHS.belongs(itch) || UnicodeCharacter.Range.CJK_COMPATIBILITY_IDEOGRAPHS.belongs(itch) -- cgit v1.2.3