diff options
Diffstat (limited to 'src/org/madore')
-rw-r--r-- | src/org/madore/android/unicodeMap/UnicodeMapActivity.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java index aecea78..1358246 100644 --- a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java +++ b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java @@ -27,6 +27,17 @@ import android.app.ProgressDialog; public final class UnicodeMapActivity extends ListActivity { + protected static void textMakeSelectableIfPossible(TextView text) { + // .setTextIsSelectable() method is only available on Android + // Honeycomb (API 11) and later. + try { + java.lang.reflect.Method m = TextView.class.getMethod("setTextIsSelectable", new Class[] { boolean.class }); + m.invoke(text, true); + } catch (Exception e) { + // Ignore + } + } + protected UnicodeDatabase db; protected ListView lv; protected ClipboardManager cmgr; @@ -313,6 +324,7 @@ public final class UnicodeMapActivity extends ListActivity { TextView text; text = (TextView) dialog.findViewById(R.id.detailsLabel); text.setText(itch.getLabel()); + textMakeSelectableIfPossible(text); text = (TextView) dialog.findViewById(R.id.encodingLabel); StringBuilder s = new StringBuilder(); Formatter fmt = new Formatter(s); @@ -326,6 +338,7 @@ 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)); + textMakeSelectableIfPossible(text); text = (TextView) dialog.findViewById(R.id.categoryLabel); text.setText(itch.getCategory().getDescr()); final Button copyCharButton = (Button) dialog.findViewById(R.id.copyCharButton); @@ -391,6 +404,7 @@ public final class UnicodeMapActivity extends ListActivity { TextView text; text = (TextView) dialog.findViewById(R.id.rangeDescrLabel); text.setText(itr.getDescr()); + textMakeSelectableIfPossible(text); text = (TextView) dialog.findViewById(R.id.rangeRangeLabel); StringBuilder s = new StringBuilder(); Formatter fmt = new Formatter(s); @@ -404,6 +418,7 @@ public final class UnicodeMapActivity extends ListActivity { itr.getTo()-itr.getFrom(), db.countRange(itr.getFrom(), itr.getTo())); text.setText(new String(s)); + textMakeSelectableIfPossible(text); dialog.show(); return true; } else |