List was repopulating every page view, because category spinner was firing change event.
This commit is contained in:
parent
8dd337f345
commit
34a2534cc8
@ -215,7 +215,10 @@ public class AppListManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setCurrentCategory(String currentCategory) {
|
public void setCurrentCategory(String currentCategory) {
|
||||||
this.currentCategory = currentCategory;
|
if (!this.currentCategory.equals(currentCategory)){
|
||||||
|
this.currentCategory = currentCategory;
|
||||||
|
repopulateLists();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static class WhatsNewComparator implements Comparator<DB.App> {
|
static class WhatsNewComparator implements Comparator<DB.App> {
|
||||||
|
@ -13,7 +13,6 @@ import org.fdroid.fdroid.views.AppListView;
|
|||||||
|
|
||||||
abstract class AppListFragment extends Fragment implements AdapterView.OnItemClickListener {
|
abstract class AppListFragment extends Fragment implements AdapterView.OnItemClickListener {
|
||||||
|
|
||||||
private AppListManager appListManager;
|
|
||||||
private FDroid parent;
|
private FDroid parent;
|
||||||
|
|
||||||
protected abstract AppListAdapter getAppListAdapter();
|
protected abstract AppListAdapter getAppListAdapter();
|
||||||
|
@ -51,8 +51,8 @@ public class AvailableAppsFragment extends AppListFragment implements AdapterVie
|
|||||||
|
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int pos,
|
public void onItemSelected(AdapterView<?> parent, View view, int pos,
|
||||||
long id) {
|
long id) {
|
||||||
getAppListManager().setCurrentCategory(parent.getItemAtPosition(pos).toString());
|
String category = parent.getItemAtPosition(pos).toString();
|
||||||
getAppListManager().repopulateLists();
|
getAppListManager().setCurrentCategory(category);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user