summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/layout/main_layout.xml11
-rw-r--r--res/values/strings.xml7
-rw-r--r--src/org/madore/android/unicodeMap/UnicodeMapActivity.java13
3 files changed, 19 insertions, 12 deletions
diff --git a/res/layout/main_layout.xml b/res/layout/main_layout.xml
index 9500f4d..571a2dc 100644
--- a/res/layout/main_layout.xml
+++ b/res/layout/main_layout.xml
@@ -7,6 +7,11 @@
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1" />
+ <TextView android:id="@id/android:empty"
+ android:layout_width="fill_parent"
+ android:layout_height="0dip"
+ android:layout_weight="1"
+ android:text="@string/empty_list" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@@ -19,10 +24,6 @@
<Button android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
- android:text="Copy" />
+ android:text="@string/copy_button" />
</LinearLayout>
- <TextView android:id="@id/android:empty"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:text="Nothing here" />
</LinearLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6409dea..605a255 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1,4 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="app_name">UnicodeMapActivity</string>
+ <string name="app_name">Unicode Map</string>
+ <string name="loading_database_title">Loading Unicode database</string>
+ <string name="loading_database_msg">Please wait</string>
+ <string name="copy_button">Copy</string>
+ <string name="copied_toast">Copied to clipboard</string>
+ <string name="empty_list">(Empty!)</string>
</resources>
diff --git a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java
index aee9e71..def8537 100644
--- a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java
+++ b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java
@@ -20,7 +20,7 @@ public final class UnicodeMapActivity extends ListActivity {
protected UnicodeDatabase db;
protected final List<UnicodeDisplayable> rootList
- = new ArrayList<UnicodeDisplayable>(100);
+ = new ArrayList<UnicodeDisplayable>(200);
protected final List<List<UnicodeDisplayable>> stack
= new ArrayList<List<UnicodeDisplayable>>(10);
@@ -28,8 +28,8 @@ public final class UnicodeMapActivity extends ListActivity {
protected void launchPopulation() {
final ProgressDialog progress = new ProgressDialog(this);
progress.setOwnerActivity(this);
- progress.setTitle("Loading Unicode database");
- progress.setMessage("Please wait");
+ progress.setTitle(R.string.loading_database_title);
+ progress.setMessage(getResources().getText(R.string.loading_database_msg));
progress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progress.setCancelable(false);
progress.show();
@@ -57,7 +57,6 @@ public final class UnicodeMapActivity extends ListActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- android.util.Log.v("UnicodeMapActivity", "creating activity");
setContentView(R.layout.main_layout);
db = new UnicodeDatabase(this);
final boolean needPopulate = db.needPopulate();
@@ -74,7 +73,8 @@ public final class UnicodeMapActivity extends ListActivity {
btn.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
cmgr.setText(txt.getText());
- Toast.makeText(getApplicationContext(), "Copied to clipboard",
+ Toast.makeText(getApplicationContext(),
+ R.string.copied_toast,
Toast.LENGTH_SHORT).show();
}
});
@@ -96,7 +96,8 @@ public final class UnicodeMapActivity extends ListActivity {
list.add(ch);
stack.add(list);
setListAdapter(new UnicodeArrayAdapter(UnicodeMapActivity.this, list));
- }
+ } else
+ throw new AssertionError("unknown UnicodeDisplayable");
}
});
}