Browse Source

Correct showing/hiding of details screen list/empty text/loading progress.

pull/11/head
Eric Kok 12 years ago
parent
commit
d49785212d
  1. 9
      core/src/org/transdroid/core/gui/DetailsFragment.java

9
core/src/org/transdroid/core/gui/DetailsFragment.java

@ -75,8 +75,8 @@ public class DetailsFragment extends SherlockFragment {
((DetailsAdapter) detailsList.getAdapter()).updateTorrent(newTorrent); ((DetailsAdapter) detailsList.getAdapter()).updateTorrent(newTorrent);
// Make the list (with details header) visible // Make the list (with details header) visible
detailsList.setVisibility(View.VISIBLE); detailsList.setVisibility(View.VISIBLE);
emptyText.setVisibility(isLoadingTorrent? View.INVISIBLE: View.VISIBLE); emptyText.setVisibility(View.GONE);
loadingProgress.setVisibility(!isLoadingTorrent? View.VISIBLE: View.INVISIBLE); loadingProgress.setVisibility(View.GONE);
// Also update the available actions in the action bar // Also update the available actions in the action bar
getActivity().supportInvalidateOptionsMenu(); getActivity().supportInvalidateOptionsMenu();
} }
@ -122,8 +122,9 @@ public class DetailsFragment extends SherlockFragment {
*/ */
public void clear() { public void clear() {
detailsList.setAdapter(new DetailsAdapter(getActivity())); detailsList.setAdapter(new DetailsAdapter(getActivity()));
detailsList.setVisibility(View.INVISIBLE); detailsList.setVisibility(View.GONE);
emptyText.setVisibility(View.VISIBLE); emptyText.setVisibility(!isLoadingTorrent? View.VISIBLE: View.GONE);
loadingProgress.setVisibility(isLoadingTorrent? View.VISIBLE: View.GONE);
torrent = null; torrent = null;
torrentDetails = null; torrentDetails = null;
torrentFiles = null; torrentFiles = null;

Loading…
Cancel
Save