Skip to content

Commit

Permalink
Fix intent search introduced in last version.
Browse files Browse the repository at this point in the history
Fixes issue #145
  • Loading branch information
rdoeffinger committed Sep 11, 2021
1 parent abd7512 commit 0406523
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hughes.android.dictionary"
android:installLocation="auto"
android:versionCode="114"
android:versionName="5.5.9" >
android:versionCode="115"
android:versionName="5.6.0" >

<uses-feature
android:name="android.hardware.touchscreen"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.1'
classpath 'com.android.tools.build:gradle:7.0.2'
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/com/hughes/android/dictionary/DictionaryActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public void onCreate(Bundle savedInstanceState) {

}
intent.putExtra(C.DICT_FILE, application.getPath(info.uncompressedFilename)
.toString());
.getUri().toString());
break;
}
}
Expand Down Expand Up @@ -428,7 +428,7 @@ public void onCreate(Bundle savedInstanceState) {
if (intent.getStringExtra(C.DICT_FILE) == null) {
String dictfile = prefs.getString(getString(R.string.defaultDicKey), null);
if (dictfile != null)
intent.putExtra(C.DICT_FILE, application.getPath(dictfile).toString());
intent.putExtra(C.DICT_FILE, application.getPath(dictfile).getUri().toString());
}
String dictFilename = intent.getStringExtra(C.DICT_FILE);
if (dictFilename == null && intent.getStringExtra(C.SEARCH_TOKEN) != null) {
Expand All @@ -449,14 +449,14 @@ public void onCreate(Bundle savedInstanceState) {
Log.d(LOG, "Checking index " + idx.shortName);
if (idx.findExact(search) != null) {
Log.d(LOG, "Found exact match");
dictFilename = dictfile.toString();
dictFilename = dictfile.getUri().toString();
intent.putExtra(C.INDEX_SHORT_NAME, idx.shortName);
break;
}
int matchLen = getMatchLen(search, idx.findInsertionPoint(search, dummy));
Log.d(LOG, "Found partial match length " + matchLen);
if (matchLen > bestMatchLen) {
bestFname = dictfile.toString();
bestFname = dictfile.getUri().toString();
bestIndex = idx.shortName;
bestMatchLen = matchLen;
}
Expand Down

0 comments on commit 0406523

Please sign in to comment.