From 5faf5b459a06e9708707594d51974cc8d5a67c59 Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Thu, 29 Apr 2010 03:29:40 +0200 Subject: Make search a bit more friendly. --- res/values/strings.xml | 5 ++++- src/org/madore/android/unicodeMap/UnicodeMapActivity.java | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index acdc3e0..8c73c38 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -16,7 +16,10 @@ Search Search in character names Search - Case is insensitive and matches whole string; use a % sign as wildcard (e.g.: "latin%letter r%") + Case is insensitive and matches whole + string; use a * sign as wildcard (e.g.: + "latin*letter r*"); CJK ideographs and Hangul syllables cannot + be searched search results Only %d first results shown About diff --git a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java index 2795c28..5a2622a 100644 --- a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java +++ b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java @@ -362,6 +362,9 @@ public final class UnicodeMapActivity extends ListActivity { final static int searchLimit = 1000; protected void doSearch(String s) { + s = s.replaceAll("\\*", "%"); + s = s.replaceAll("^\\s*", ""); + s = s.replaceAll("\\s*$", ""); Display newDisp = new SearchDisplay(getResources().getString(R.string.search_results), s, searchLimit); saveDisplay(); -- cgit v1.2.3