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 {
}
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;
package com.hughes.android.dictionary.engine;
import android.content.Intent;
+import android.util.Log;
import com.hughes.android.dictionary.C;
import com.hughes.util.StringUtil;
for (final HtmlEntry htmlEntry : htmlEntries) {
final String titleEscaped = StringUtil.escapeUnicodeToPureHtml(htmlEntry.title);
result.append(String.format("<h1><a href=\"%s\">%s</a></h1>\n<p>%s\n",
- formatQuickdicUrl(indexShortName, titleEscaped), titleEscaped,
+ formatQuickdicUrl(indexShortName, htmlEntry.title), titleEscaped,
htmlEntry.getHtml()));
}
return result.toString();