List was repopulating every page view, because category spinner was firing change event.

This commit is contained in:
Peter Serwylo 2013-04-14 08:37:02 +10:00
parent 8dd337f345
commit 34a2534cc8
3 changed files with 6 additions and 4 deletions

View File

@ -215,7 +215,10 @@ public class AppListManager {
}
public void setCurrentCategory(String currentCategory) {
if (!this.currentCategory.equals(currentCategory)){
this.currentCategory = currentCategory;
repopulateLists();
}
}
static class WhatsNewComparator implements Comparator<DB.App> {

View File

@ -13,7 +13,6 @@ import org.fdroid.fdroid.views.AppListView;
abstract class AppListFragment extends Fragment implements AdapterView.OnItemClickListener {
private AppListManager appListManager;
private FDroid parent;
protected abstract AppListAdapter getAppListAdapter();

View File

@ -51,8 +51,8 @@ public class AvailableAppsFragment extends AppListFragment implements AdapterVie
public void onItemSelected(AdapterView<?> parent, View view, int pos,
long id) {
getAppListManager().setCurrentCategory(parent.getItemAtPosition(pos).toString());
getAppListManager().repopulateLists();
String category = parent.getItemAtPosition(pos).toString();
getAppListManager().setCurrentCategory(category);
}
@Override