]> gitweb.fperrin.net Git - Dictionary.git/commitdiff
Using icons in QuickSwitch.
authorThad Hughes <thadh@google.com>
Sun, 15 Dec 2013 23:41:28 +0000 (15:41 -0800)
committerThad Hughes <thadh@google.com>
Sun, 15 Dec 2013 23:41:28 +0000 (15:41 -0800)
src/com/hughes/android/dictionary/DictionaryActivity.java
src/com/hughes/android/dictionary/DictionaryApplication.java
src/com/hughes/android/dictionary/DictionaryManagerActivity.java

index d99de3c65ff67617879a5175e3eeb3e6f497a7e6..bf93cecdd82eec2c4bd271b1ee55aed3462fee2b 100644 (file)
@@ -638,15 +638,8 @@ public class DictionaryActivity extends SherlockListActivity {
                 final LinearLayout result = new LinearLayout(parent.getContext());
 
                 for (int i = 0; i < dictionaryInfo.indexInfos.size(); ++i) {
-                    if (i > 0) {
-                        final TextView dash = new TextView(parent.getContext());
-                        dash.setText("-");
-                        result.addView(dash);
-                    }
-
                     final IndexInfo indexInfo = dictionaryInfo.indexInfos.get(i);
-                    final Button button = new Button(parent.getContext());
-                    button.setText(indexInfo.shortName);
+                    final View button = application.createButton(parent.getContext(), dictionaryInfo, indexInfo);
                     final IntentLauncher intentLauncher = new IntentLauncher(parent.getContext(),
                             getLaunchIntent(
                                     application.getPath(dictionaryInfo.uncompressedFilename),
@@ -659,7 +652,6 @@ public class DictionaryActivity extends SherlockListActivity {
                     };
                     button.setOnClickListener(intentLauncher);
                     result.addView(button);
-
                 }
 
                 final TextView nameView = new TextView(parent.getContext());
@@ -672,7 +664,6 @@ public class DictionaryActivity extends SherlockListActivity {
                 layoutParams.weight = 1.0f;
                 nameView.setLayoutParams(layoutParams);
                 result.addView(nameView);
-
                 return result;
             }
 
index bc644695d0d0de87c2cf19f08f6187152f9019a7..c2bb8457a216ea50872f2331985e6c66025471d8 100644 (file)
@@ -290,9 +290,6 @@ public class DictionaryApplication extends Application {
       }
       result.setMinimumWidth(languageButtonPixels);
       result.setMinimumHeight(languageButtonPixels * 2 / 3);
-      result.setOnClickListener(
-              new IntentLauncher(context, 
-              DictionaryActivity.getLaunchIntent(getPath(dictionaryInfo.uncompressedFilename), indexInfo.shortName, "")));
 //      result.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
       return result;
   }
index c06ccc30504cfcac927e063629a67c424a709cd7..e668b760f480b79e640f5da8696711527a928947 100644 (file)
@@ -221,6 +221,7 @@ public class DictionaryManagerActivity extends SherlockActivity {
                 return true;
             }
         });
+        filterSearchView.setIconifiedByDefault(false);
 
         application.onCreateGlobalOptionsMenu(this, menu);
         return true;
@@ -338,6 +339,9 @@ public class DictionaryManagerActivity extends SherlockActivity {
                 final List<IndexInfo> sortedIndexInfos = application.sortedIndexInfos(dictionaryInfo.indexInfos);
                 for (IndexInfo indexInfo : sortedIndexInfos) {
                     final View button = application.createButton(buttons.getContext(), dictionaryInfo, indexInfo);
+                    button.setOnClickListener(
+                            new IntentLauncher(buttons.getContext(), 
+                            DictionaryActivity.getLaunchIntent(application.getPath(dictionaryInfo.uncompressedFilename), indexInfo.shortName, "")));
                     buttons.addView(button);
                 }