summaryrefslogtreecommitdiffstats
path: root/src/org
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2010-04-26 20:49:35 (GMT)
committerDavid A. Madore <david+git@madore.org>2010-04-27 00:23:39 (GMT)
commite37377a5d3ca4c78c440b097af4186cbbd81a6a0 (patch)
treea8884d4a801f1f1ef0b5350af8ddaf7be0d2aa80 /src/org
parent4307bce6cd10fe0e3ebb86118d2077fbd78ff1cb (diff)
downloadUnicodeMap-e37377a5d3ca4c78c440b097af4186cbbd81a6a0.zip
UnicodeMap-e37377a5d3ca4c78c440b097af4186cbbd81a6a0.tar.gz
UnicodeMap-e37377a5d3ca4c78c440b097af4186cbbd81a6a0.tar.bz2
Range details similar to character details.
Diffstat (limited to 'src/org')
-rw-r--r--src/org/madore/android/unicodeMap/UnicodeCharacter.java5
-rw-r--r--src/org/madore/android/unicodeMap/UnicodeMapActivity.java23
2 files changed, 22 insertions, 6 deletions
diff --git a/src/org/madore/android/unicodeMap/UnicodeCharacter.java b/src/org/madore/android/unicodeMap/UnicodeCharacter.java
index 646c696..0805e8c 100644
--- a/src/org/madore/android/unicodeMap/UnicodeCharacter.java
+++ b/src/org/madore/android/unicodeMap/UnicodeCharacter.java
@@ -284,10 +284,7 @@ public class UnicodeCharacter implements UnicodeDisplayable {
protected String makeLabel() {
StringBuilder s = new StringBuilder();
Formatter fmt = new Formatter(s);
- if ( codePoint < 0x10000 )
- fmt.format("U+%04X %s", codePoint, name);
- else
- fmt.format("U+%X %s", codePoint, name);
+ fmt.format("U+%04X %s", codePoint, name);
return new String(s);
}
diff --git a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java
index 2d8d61b..1b43d9d 100644
--- a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java
+++ b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java
@@ -96,12 +96,13 @@ public final class UnicodeMapActivity extends ListActivity {
UnicodeCharacter itch = (UnicodeCharacter)it;
Dialog dialog = new Dialog(UnicodeMapActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+ dialog.setOwnerActivity(UnicodeMapActivity.this);
dialog.setContentView(R.layout.char_details);
dialog.setCancelable(true);
TextView text;
text = (TextView) dialog.findViewById(R.id.detailsLabel);
text.setText(itch.getLabel());
- text = (TextView) dialog.findViewById(R.id.utf8Label);
+ text = (TextView) dialog.findViewById(R.id.encodingLabel);
StringBuilder s = new StringBuilder();
Formatter fmt = new Formatter(s);
fmt.format("UTF-8:");
@@ -117,7 +118,25 @@ public final class UnicodeMapActivity extends ListActivity {
dialog.show();
return true;
} else if ( it instanceof UnicodeCharacter.Range ) {
- return false;
+ UnicodeCharacter.Range itr = (UnicodeCharacter.Range)it;
+ Dialog dialog = new Dialog(UnicodeMapActivity.this);
+ dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+ dialog.setOwnerActivity(UnicodeMapActivity.this);
+ dialog.setContentView(R.layout.range_details);
+ dialog.setCancelable(true);
+ TextView text;
+ text = (TextView) dialog.findViewById(R.id.rangeDescrLabel);
+ text.setText(itr.getDescr());
+ text = (TextView) dialog.findViewById(R.id.rangeRangeLabel);
+ StringBuilder s = new StringBuilder();
+ Formatter fmt = new Formatter(s);
+ fmt.format("%04X\u2013%04X (%d slots, %d chars)",
+ itr.getFrom(), itr.getTo()-1,
+ itr.getTo()-itr.getFrom(),
+ db.countRange(itr.getFrom(), itr.getTo()));
+ text.setText(new String(s));
+ dialog.show();
+ return true;
} else
throw new AssertionError("unknown UnicodeDisplayable");
}