]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryManagerActivity.java
Fix flags of Scotland. Fix bug with URL encoding HTMLEntry titles.
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryManagerActivity.java
index e3e76ad72a3c2f3b6944f0603a11f55c1813580e..5a0305015731bdfce8f90ac46b5a525188ceb481 100644 (file)
@@ -369,23 +369,23 @@ public class DictionaryManagerActivity extends SherlockListActivity {
         prefs.commit();
     }
 
-    // private void onClick(int index) {
-    // final DictionaryInfo dictionaryInfo = adapter.getItem(index);
-    // final DictionaryInfo downloadable =
-    // application.getDownloadable(dictionaryInfo.uncompressedFilename);
-    // if
-    // (!application.isDictionaryOnDevice(dictionaryInfo.uncompressedFilename)
-    // && downloadable != null) {
-    // final Intent intent = getDownloadIntent(downloadable);
-    // startActivity(intent);
-    // } else {
-    // final Intent intent =
-    // DictionaryActivity.getLaunchIntent(application.getPath(dictionaryInfo.uncompressedFilename),
-    // 0, "");
-    // startActivity(intent);
-    // }
-    // }
-    
+//    @Override
+//    private void onClick(int index) {
+//        final DictionaryInfo dictionaryInfo = adapter.getItem(index);
+//        final DictionaryInfo downloadable =
+//                application.getDownloadable(dictionaryInfo.uncompressedFilename);
+//        if (!application.isDictionaryOnDevice(dictionaryInfo.uncompressedFilename)
+//                && downloadable != null) {
+//            final Intent intent = getDownloadIntent(downloadable);
+//            startActivity(intent);
+//        } else {
+//            final Intent intent =
+//                    DictionaryActivity.getLaunchIntent(
+//                            application.getPath(dictionaryInfo.uncompressedFilename),
+//                            0, "");
+//            startActivity(intent);
+//        }
+//    }    
     
     class MyListAdapter extends BaseAdapter {
 
@@ -527,9 +527,20 @@ public class DictionaryManagerActivity extends SherlockListActivity {
         }
         details.setText(builder.toString());
         
-        row.setClickable(true);
-        row.setFocusable(true);
-        row.setLongClickable(true);
+        if (canLaunch) {
+            row.setClickable(true);
+            row.setOnClickListener(new OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    new IntentLauncher(parent.getContext(), 
+                            DictionaryActivity.getLaunchIntent(
+                                    application.getPath(dictionaryInfo.uncompressedFilename), 
+                                    dictionaryInfo.indexInfos.get(0).shortName, ""));
+                }
+            });
+            row.setFocusable(true);
+            row.setLongClickable(true);
+        }
         row.setBackgroundResource(android.R.drawable.menuitem_background);
         
         return row;