Browse Source

Remove any selection on the torrents list when opening the details fragment. Fixes #33.

pull/82/head
Eric Kok 11 years ago
parent
commit
dc4ac58a43
  1. 10
      core/src/org/transdroid/core/gui/TorrentsFragment.java

10
core/src/org/transdroid/core/gui/TorrentsFragment.java

@ -169,6 +169,7 @@ public class TorrentsFragment extends SherlockFragment implements OnLabelPickedL
this.currentTextFilter = null; this.currentTextFilter = null;
this.currentNavigationFilter = null; this.currentNavigationFilter = null;
} }
clearCheckedStates();
applyAllFilters(); applyAllFilters();
} }
@ -351,6 +352,8 @@ public class TorrentsFragment extends SherlockFragment implements OnLabelPickedL
@ItemClick(resName = "torrent_list") @ItemClick(resName = "torrent_list")
protected void torrentsListClicked(Torrent torrent) { protected void torrentsListClicked(Torrent torrent) {
clearCheckedStates();
// Show the torrent details fragment
((TorrentsActivity) getActivity()).openDetails(torrent); ((TorrentsActivity) getActivity()).openDetails(torrent);
} }
@ -361,6 +364,13 @@ public class TorrentsFragment extends SherlockFragment implements OnLabelPickedL
} }
} }
private void clearCheckedStates() {
// Remove any selection the user has made first
for (int i = 0; i < torrentsList.getAdapter().getCount(); i++) {
torrentsList.setItemChecked(i, false);
}
}
/** /**
* Updates the shown screen depending on whether we have a connection (so torrents can be shown) or not (in case we * Updates the shown screen depending on whether we have a connection (so torrents can be shown) or not (in case we
* need to show a message suggesting help). This should only ever be called on the UI thread. * need to show a message suggesting help). This should only ever be called on the UI thread.

Loading…
Cancel
Save