summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2010-04-27 03:28:16 +0200
committerDavid A. Madore <david+git@madore.org>2010-04-27 03:28:16 +0200
commit0278ab996f751df3dd735e1d5eeba76248a46618 (patch)
treebc04e5121c77fe7ebffbb263deb23de34dcb02d5
parentc919a3c99166c812a1aa91e7df5023b22265b2b1 (diff)
downloadUnicodeMap-0278ab996f751df3dd735e1d5eeba76248a46618.tar.gz
UnicodeMap-0278ab996f751df3dd735e1d5eeba76248a46618.tar.bz2
UnicodeMap-0278ab996f751df3dd735e1d5eeba76248a46618.zip
Change title to reflect what is being displayed.
-rw-r--r--res/values/strings.xml2
-rw-r--r--src/org/madore/android/unicodeMap/UnicodeMapActivity.java21
2 files changed, 20 insertions, 3 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index b77be4a..f7fc1c7 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Unicode Map</string>
+ <string name="app_name_spec">Unicode Map: %s</string>
<string name="loading_database_title">Loading Unicode database</string>
<string name="loading_database_msg">Please wait</string>
<string name="copy_button">Copy</string>
@@ -10,5 +11,6 @@
<string name="search_title">Search in character names</string>
<string name="search_button">Search</string>
<string name="search_hint">Case is insensitive and matches whole string; use a % sign as wildcard (e.g.: "latin%letter r%")</string>
+ <string name="search_results">search results</string>
<string name="list_too_long">Only %d first results shown</string>
</resources>
diff --git a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java
index a13f73a..f9f2a34 100644
--- a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java
+++ b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java
@@ -31,11 +31,14 @@ public final class UnicodeMapActivity extends ListActivity {
public final UnicodeArrayAdapter adapter;
public final int selPosition;
public final int yOffset;
+ public final CharSequence title;
public ViewHistory(UnicodeArrayAdapter adapter,
- int selPosition, int yOffset) {
+ int selPosition, int yOffset,
+ CharSequence title) {
this.adapter = adapter;
this.selPosition = selPosition;
this.yOffset = yOffset;
+ this.title = title;
}
}
@@ -82,7 +85,9 @@ public final class UnicodeMapActivity extends ListActivity {
yOffset = selView.getTop();
else
yOffset = 0;
- historyStack.add(new ViewHistory(adapter, selPosition, yOffset));
+ CharSequence title = getTitle();
+ historyStack.add(new ViewHistory(adapter, selPosition, yOffset,
+ title));
}
protected void saveView() {
@@ -100,7 +105,9 @@ public final class UnicodeMapActivity extends ListActivity {
yOffset = view.getTop();
else
yOffset = 0;
- historyStack.add(new ViewHistory(adapter, position, yOffset));
+ CharSequence title = getTitle();
+ historyStack.add(new ViewHistory(adapter, position, yOffset,
+ title));
}
protected class MapItemClickListener
@@ -124,6 +131,9 @@ public final class UnicodeMapActivity extends ListActivity {
list);
saveView(view, position);
setListAdapter(adapter);
+ setTitle(String.format(getResources()
+ .getString(R.string.app_name_spec),
+ ((UnicodeCharacter.Range)it).getDescr()));
} else
throw new AssertionError("unknown UnicodeDisplayable");
}
@@ -231,6 +241,10 @@ public final class UnicodeMapActivity extends ListActivity {
list);
saveView();
setListAdapter(adapter);
+ setTitle(String.format(getResources()
+ .getString(R.string.app_name_spec),
+ getResources()
+ .getString(R.string.search_results)));
if ( overflowed ) {
String str = getResources().getString(R.string.list_too_long);
android.util.Log.e("UnicodeMapActivity", "format is: "+str);
@@ -284,6 +298,7 @@ public final class UnicodeMapActivity extends ListActivity {
final ListView lv = getListView();
ViewHistory saved = historyStack.remove(historyStack.size()-1);
setListAdapter(saved.adapter);
+ setTitle(saved.title);
lv.setSelectionFromTop(saved.selPosition, saved.yOffset);
return true;
} else if ( keyCode == KeyEvent.KEYCODE_SEARCH ) {