From: Thad Hughes Date: Thu, 26 Dec 2013 01:58:06 +0000 (-0800) Subject: Fix flags of Scotland. Fix bug with URL encoding HTMLEntry titles. X-Git-Url: http://gitweb.fperrin.net/?p=Dictionary.git;a=commitdiff_plain;h=3137880a2137e96b7cee8a02e1e2a055e37f04db Fix flags of Scotland. Fix bug with URL encoding HTMLEntry titles. --- diff --git a/res/drawable-xxhdpi/flag_of_scotland.png b/res/drawable-xxhdpi/flag_of_scotland.png index 551836f..8ce57bf 100644 Binary files a/res/drawable-xxhdpi/flag_of_scotland.png and b/res/drawable-xxhdpi/flag_of_scotland.png differ diff --git a/src/com/hughes/android/dictionary/DictionaryManagerActivity.java b/src/com/hughes/android/dictionary/DictionaryManagerActivity.java index e3e76ad..5a03050 100644 --- a/src/com/hughes/android/dictionary/DictionaryManagerActivity.java +++ b/src/com/hughes/android/dictionary/DictionaryManagerActivity.java @@ -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; diff --git a/src/com/hughes/android/dictionary/MyWebView.java b/src/com/hughes/android/dictionary/MyWebView.java index d11cec0..ebec47c 100644 --- a/src/com/hughes/android/dictionary/MyWebView.java +++ b/src/com/hughes/android/dictionary/MyWebView.java @@ -33,6 +33,7 @@ public class MyWebView extends WebView { Log.d(LOG, "Handling Quickdic URL: " + url); final Intent result = new Intent(); HtmlEntry.quickdicUrlToIntent(url, result); + Log.d(LOG, "SEARCH_TOKEN=" + result.getStringExtra(C.SEARCH_TOKEN)); activity.setResult(Activity.RESULT_OK, result); activity.finish(); return true; diff --git a/src/com/hughes/android/dictionary/engine/HtmlEntry.java b/src/com/hughes/android/dictionary/engine/HtmlEntry.java index 5fe0780..612c6c1 100644 --- a/src/com/hughes/android/dictionary/engine/HtmlEntry.java +++ b/src/com/hughes/android/dictionary/engine/HtmlEntry.java @@ -1,6 +1,7 @@ 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; @@ -159,7 +160,7 @@ public class HtmlEntry extends AbstractEntry implements RAFSerializable%s\n

%s\n", - formatQuickdicUrl(indexShortName, titleEscaped), titleEscaped, + formatQuickdicUrl(indexShortName, htmlEntry.title), titleEscaped, htmlEntry.getHtml())); } return result.toString(); diff --git a/todo.txt b/todo.txt index 7bbc3c8..8cdab76 100644 --- a/todo.txt +++ b/todo.txt @@ -1,2 +1,4 @@ +* Clicking link in HTML view doesn't trigger search. +* Back button in top left * Contributions from: * HtmlEntries inline, expandable. \ No newline at end of file