Select F-Droid correctly during swap process. Fixes #141.

Bug in the code which decides which apps to select for swapping.
Due to the way in which Adapters and ListViews work together to provide
"header" and "footer" functionalities for lists, there is a mismatch between
the index in our original adapter, and the actual index on the list. It is
up to us to maintain this correctly, which was not done, hence the off by
one error.
This commit is contained in:
Peter Serwylo 2014-12-29 20:00:35 +11:00
parent 953d3ed8d7
commit 7fb2de4bae

View File

@ -198,7 +198,7 @@ public class SelectAppsFragment extends ThemeableListFragment
Cursor c = ((Cursor) listView.getItemAtPosition(i + 1));
String packageName = c.getString(c.getColumnIndex(InstalledAppProvider.DataColumns.APP_ID));
if (TextUtils.equals(packageName, fdroid)) {
listView.setItemChecked(i, true); // always include FDroid
listView.setItemChecked(i + 1, true); // always include FDroid
} else {
for (String selected : FDroidApp.selectedApps) {
if (TextUtils.equals(packageName, selected)) {