From cb83925eb30ef7bede70f65bc8ae18b90c7feae4 Mon Sep 17 00:00:00 2001 From: handsomezhou Date: Tue, 2 Feb 2016 11:10:11 +0800 Subject: [PATCH] update demo,update readme --- .../appsearch/fragment/QwertySearchFragment.java | 14 +++++++------- .../appsearch/helper/AppInfoHelper.java | 4 ++-- .../fragment/QwertySearchFragment.java | 2 +- .../contactssearch/fragment/T9SearchFragment.java | 2 +- .../contactssearch/helper/ContactsHelper.java | 4 ++-- .../contactssearch/view/ContactsOperationView.java | 6 +++--- README.md | 6 +++--- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/AppSearch/src/com/handsomezhou/appsearch/fragment/QwertySearchFragment.java b/AppSearch/src/com/handsomezhou/appsearch/fragment/QwertySearchFragment.java index a3e6e28..0f8a63a 100644 --- a/AppSearch/src/com/handsomezhou/appsearch/fragment/QwertySearchFragment.java +++ b/AppSearch/src/com/handsomezhou/appsearch/fragment/QwertySearchFragment.java @@ -86,7 +86,7 @@ public boolean onItemLongClick(AdapterView parent, View view, /*start: OnSearchBox*/ @Override public void onSearchTextChanged(String curCharacter) { - updateSearch(curCharacter); + search(curCharacter); refreshView(); } @@ -102,7 +102,7 @@ public void updateSearch(){ return; } - updateSearch(mSearchBox.getSearchEtInput()); + search(mSearchBox.getSearchEtInput()); } private void refreshQwertySearchGv() { @@ -124,13 +124,13 @@ private void refreshQwertySearchGv() { } } - private void updateSearch(String search) { - Log.i(TAG, "search=["+search+"]"); + private void search(String keyword) { + Log.i(TAG, "search=["+keyword+"]"); String curCharacter; - if (null == search) { - curCharacter = search; + if (null == keyword) { + curCharacter = keyword; } else { - curCharacter = search.trim(); + curCharacter = keyword.trim(); } if (TextUtils.isEmpty(curCharacter)) { diff --git a/AppSearch/src/com/handsomezhou/appsearch/helper/AppInfoHelper.java b/AppSearch/src/com/handsomezhou/appsearch/helper/AppInfoHelper.java index 842d933..9a60f9c 100644 --- a/AppSearch/src/com/handsomezhou/appsearch/helper/AppInfoHelper.java +++ b/AppSearch/src/com/handsomezhou/appsearch/helper/AppInfoHelper.java @@ -121,7 +121,7 @@ public void setAppInfoChanged(boolean appInfoChanged) { } public boolean startLoadAppInfo(){ - if(true==isAppInfoLoading()){ + if(true==isLoading()){ return false; } @@ -479,7 +479,7 @@ private AppInfo getAppInfo(PackageManager pm,PackageInfo packageInfo){ return appInfo; } - private boolean isAppInfoLoading(){ + private boolean isLoading(){ return ((null!=mLoadAppInfoTask)&&(mLoadAppInfoTask.getStatus()==Status.RUNNING)); } diff --git a/ContactsSearch/src/com/handsomezhou/contactssearch/fragment/QwertySearchFragment.java b/ContactsSearch/src/com/handsomezhou/contactssearch/fragment/QwertySearchFragment.java index 3adcde9..7be30b9 100644 --- a/ContactsSearch/src/com/handsomezhou/contactssearch/fragment/QwertySearchFragment.java +++ b/ContactsSearch/src/com/handsomezhou/contactssearch/fragment/QwertySearchFragment.java @@ -34,7 +34,7 @@ public class QwertySearchFragment extends BaseFragment implements OnContactsLoad @Override public void onResume() { if(false==isFirstRefreshView()){ - mContactsOperationView.updateContactsList(); + mContactsOperationView.refreshContactsLv(); }else{ setFirstRefreshView(false); } diff --git a/ContactsSearch/src/com/handsomezhou/contactssearch/fragment/T9SearchFragment.java b/ContactsSearch/src/com/handsomezhou/contactssearch/fragment/T9SearchFragment.java index 2e1111f..97599ab 100644 --- a/ContactsSearch/src/com/handsomezhou/contactssearch/fragment/T9SearchFragment.java +++ b/ContactsSearch/src/com/handsomezhou/contactssearch/fragment/T9SearchFragment.java @@ -39,7 +39,7 @@ public class T9SearchFragment extends BaseFragment implements OnT9TelephoneDialp @Override public void onResume() { if(false==isFirstRefreshView()){ - mContactsOperationView.updateContactsList(); + mContactsOperationView.refreshContactsLv(); }else{ setFirstRefreshView(false); } diff --git a/ContactsSearch/src/com/handsomezhou/contactssearch/helper/ContactsHelper.java b/ContactsSearch/src/com/handsomezhou/contactssearch/helper/ContactsHelper.java index 350a4d1..10a261a 100644 --- a/ContactsSearch/src/com/handsomezhou/contactssearch/helper/ContactsHelper.java +++ b/ContactsSearch/src/com/handsomezhou/contactssearch/helper/ContactsHelper.java @@ -145,7 +145,7 @@ public void setSelectedContacts(HashMap selectedContacts) { * @return start load success return true, otherwise return false */ public boolean startLoadContacts() { - if (true == isSearching()) { + if (true == isLoading()) { return false; } @@ -541,7 +541,7 @@ private void initContactsHelper() { } } - private boolean isSearching() { + private boolean isLoading() { return (mLoadTask != null && mLoadTask.getStatus() == Status.RUNNING); } diff --git a/ContactsSearch/src/com/handsomezhou/contactssearch/view/ContactsOperationView.java b/ContactsSearch/src/com/handsomezhou/contactssearch/view/ContactsOperationView.java index 721ab01..f966fc6 100644 --- a/ContactsSearch/src/com/handsomezhou/contactssearch/view/ContactsOperationView.java +++ b/ContactsSearch/src/com/handsomezhou/contactssearch/view/ContactsOperationView.java @@ -145,7 +145,7 @@ public void onContactsSms(Contacts contacts) { @Override public void onContactsRefreshView() { // TODO Auto-generated method stub - updateContactsList(); + refreshContactsLv(); } /*end:OnContactsAdapter*/ @@ -187,10 +187,10 @@ public void updateContactsList(boolean searchEmpty) { ViewUtil.hideView(mQuickAlphabeticBar); } - updateContactsList(); + refreshContactsLv(); } - public void updateContactsList() { + public void refreshContactsLv() { if (null == mContactsLv) { return; } diff --git a/README.md b/README.md index 0cfe953..b0a7f8a 100644 --- a/README.md +++ b/README.md @@ -87,11 +87,11 @@ Usage Algorithm introduction --------------- -1.[Android Pinyin search contacts analysis and implementation](http://blog.csdn.net/zjqyjg/article/details/41360769) +1.[Pinyin search contacts analysis and implementation](http://blog.csdn.net/zjqyjg/article/details/41360769) -2.[Android T9 search contacts analysis and implementation](http://blog.csdn.net/zjqyjg/article/details/41182911) +2.[T9 search contacts analysis and implementation](http://blog.csdn.net/zjqyjg/article/details/41182911) -3.[Android Qwerty search contacts analysis and implementation](http://blog.csdn.net/zjqyjg/article/details/41318907) +3.[Qwerty search contacts analysis and implementation](http://blog.csdn.net/zjqyjg/article/details/41318907) License ---------------