Hide the "skip" message if we load up some recent cats

This commit is contained in:
Brion Vibber 2013-04-24 13:50:35 -07:00
parent 6e8e804861
commit 8b351d94a3

View file

@ -124,6 +124,9 @@ public class CategorizationFragment extends SherlockFragment{
if(!TextUtils.isEmpty(filter) && categories.size() == 0) {
categoriesNotFoundView.setText(getString(R.string.categories_not_found, filter));
categoriesNotFoundView.setVisibility(View.VISIBLE);
} else {
// If we found recent cats, hide the skip message!
categoriesSkip.setVisibility(View.GONE);
}
}
@ -308,11 +311,7 @@ public class CategorizationFragment extends SherlockFragment{
}
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
if(lastUpdater != null) {
lastUpdater.cancel(true);
}
lastUpdater = new CategoriesUpdater();
Utils.executeAsyncTask(lastUpdater, executor);
startUpdatingCategoryList();
}
public void afterTextChanged(Editable editable) {
@ -320,10 +319,19 @@ public class CategorizationFragment extends SherlockFragment{
}
});
startUpdatingCategoryList();
return rootView;
}
private void startUpdatingCategoryList() {
if (lastUpdater != null) {
lastUpdater.cancel(true);
}
lastUpdater = new CategoriesUpdater();
Utils.executeAsyncTask(lastUpdater, executor);
}
@Override
public void onCreateOptionsMenu(Menu menu, com.actionbarsherlock.view.MenuInflater inflater) {
menu.clear();