Skip to content

Commit

Permalink
update demo,update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
handsomezhou committed Feb 2, 2016
1 parent 7d36194 commit cb83925
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public boolean onItemLongClick(AdapterView<?> parent, View view,
/*start: OnSearchBox*/
@Override
public void onSearchTextChanged(String curCharacter) {
updateSearch(curCharacter);
search(curCharacter);
refreshView();

}
Expand All @@ -102,7 +102,7 @@ public void updateSearch(){
return;
}

updateSearch(mSearchBox.getSearchEtInput());
search(mSearchBox.getSearchEtInput());
}

private void refreshQwertySearchGv() {
Expand All @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void setAppInfoChanged(boolean appInfoChanged) {
}

public boolean startLoadAppInfo(){
if(true==isAppInfoLoading()){
if(true==isLoading()){
return false;
}

Expand Down Expand Up @@ -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));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public void setSelectedContacts(HashMap<String, Contacts> selectedContacts) {
* @return start load success return true, otherwise return false
*/
public boolean startLoadContacts() {
if (true == isSearching()) {
if (true == isLoading()) {
return false;
}

Expand Down Expand Up @@ -541,7 +541,7 @@ private void initContactsHelper() {
}
}

private boolean isSearching() {
private boolean isLoading() {
return (mLoadTask != null && mLoadTask.getStatus() == Status.RUNNING);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public void onContactsSms(Contacts contacts) {
@Override
public void onContactsRefreshView() {
// TODO Auto-generated method stub
updateContactsList();
refreshContactsLv();
}
/*end:OnContactsAdapter*/

Expand Down Expand Up @@ -187,10 +187,10 @@ public void updateContactsList(boolean searchEmpty) {
ViewUtil.hideView(mQuickAlphabeticBar);
}

updateContactsList();
refreshContactsLv();
}

public void updateContactsList() {
public void refreshContactsLv() {
if (null == mContactsLv) {
return;
}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------------
Expand Down

0 comments on commit cb83925

Please sign in to comment.