]> gitweb.fperrin.net Git - Dictionary.git/commitdiff
2nd row in DictionaryManager.
authorThad Hughes <thad.hughes@gmail.com>
Wed, 25 Jan 2012 19:32:40 +0000 (11:32 -0800)
committerThad Hughes <thad.hughes@gmail.com>
Wed, 25 Jan 2012 19:32:40 +0000 (11:32 -0800)
res/values/strings.xml
src/com/hughes/android/dictionary/DictionaryManagerActivity.java

index e0ddfba2b147085be6e164d2dbd5b8ca5f2c3326..99f5cd082eff0ad4b94ce82d7bd7f52edb6c0003 100644 (file)
@@ -10,7 +10,7 @@
   <string name="updateButton">Update (%.1fMB)</string>
   <string name="moveToTop">Move to top</string>
   <string name="deleteDictionary">Delete dictionary</string>
-  <string name="indexInfo">%1$s=%2$d entries</string>
+  <string name="indexInfo">%1$s: %2$d words</string>
   
 
   <string name="thanksForUpdatingVersion">3.1_a</string>
index 6ea4e09c8b1edebc83a070b08ddef3a1defa138b..3638aac7f34f18fdb55dbc2744cbf6595e71c5ac 100644 (file)
@@ -31,6 +31,7 @@ import android.view.ContextMenu.ContextMenuInfo;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.MenuItem.OnMenuItemClickListener;
+import android.view.ViewGroup.LayoutParams;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.WindowManager;
@@ -250,12 +251,20 @@ public class DictionaryManagerActivity extends ListActivity {
       // Add the information about each index.
       final LinearLayout row2 = new LinearLayout(parent.getContext());
       row2.setOrientation(LinearLayout.HORIZONTAL);
+      final LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
+      row2.setLayoutParams(layoutParams);
       result.addView(row2);
+      final StringBuilder builder = new StringBuilder();
       for (final IndexInfo indexInfo : dictionaryInfo.indexInfos) {
-        final TextView indexView = new TextView(parent.getContext());
-        indexView.setText(getString(R.string.indexInfo, indexInfo.shortName, indexInfo.mainTokenCount));
-        row2.addView(indexView);
+        if (builder.length() > 0) {
+          builder.append(" | ");
+        }
+        builder.append(getString(R.string.indexInfo, indexInfo.shortName, indexInfo.mainTokenCount));
       }
+      final TextView indexView = new TextView(parent.getContext());
+      indexView.setText(builder.toString());
+      row2.addView(indexView);
+      
       
       // Because we have a Button inside a ListView row:
       // http://groups.google.com/group/android-developers/browse_thread/thread/3d96af1530a7d62a?pli=1