Commit 094d92e7 authored by kenan's avatar kenan

search code

parent b4def3b5
package cn.garymb.ygomobile.loader; package cn.garymb.ygomobile.loader;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import java.util.List; import java.util.List;
...@@ -32,15 +31,12 @@ class CardSearchInfo { ...@@ -32,15 +31,12 @@ class CardSearchInfo {
return false; return false;
} }
if (!TextUtils.isEmpty(word)) { if (!TextUtils.isEmpty(word)) {
while(word.length()!=0){ if(TextUtils.isDigitsOnly(word)){
if(word.startsWith("0")){ //code
word=word.substring(1,word.length()); long code = Long.parseLong(word);
}else{ return card.Code == code || card.Alias == code;
break; }else if (!((card.Name != null && card.Name.contains(word))
} || (card.Desc != null && card.Desc.contains(word)))) {
}
if (!((card.Name != null && card.Name.contains(word))
|| (card.Desc != null && card.Desc.contains(word))||(card.Code != 0 && (card.Code+"").equals(word)))) {
return false; return false;
} }
} else if (!TextUtils.isEmpty(prefixWord) && !TextUtils.isEmpty(suffixWord)) { } else if (!TextUtils.isEmpty(prefixWord) && !TextUtils.isEmpty(suffixWord)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment