diff options
author | David A. Madore <david+git@madore.org> | 2010-04-27 03:28:16 +0200 |
---|---|---|
committer | David A. Madore <david+git@madore.org> | 2010-04-27 03:28:16 +0200 |
commit | 0278ab996f751df3dd735e1d5eeba76248a46618 (patch) | |
tree | bc04e5121c77fe7ebffbb263deb23de34dcb02d5 /src | |
parent | c919a3c99166c812a1aa91e7df5023b22265b2b1 (diff) | |
download | UnicodeMap-0278ab996f751df3dd735e1d5eeba76248a46618.tar.gz UnicodeMap-0278ab996f751df3dd735e1d5eeba76248a46618.tar.bz2 UnicodeMap-0278ab996f751df3dd735e1d5eeba76248a46618.zip |
Change title to reflect what is being displayed.
Diffstat (limited to 'src')
-rw-r--r-- | src/org/madore/android/unicodeMap/UnicodeMapActivity.java | 21 |
1 files changed, 18 insertions, 3 deletions
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 ) { |