|
|
@ -102,6 +102,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener |
|
|
|
protected SwipeRefreshLayout swipeRefreshLayout; |
|
|
|
protected SwipeRefreshLayout swipeRefreshLayout; |
|
|
|
@ViewById |
|
|
|
@ViewById |
|
|
|
protected ListView torrentsList; |
|
|
|
protected ListView torrentsList; |
|
|
|
|
|
|
|
protected ListView torrentsList; |
|
|
|
@ViewById |
|
|
|
@ViewById |
|
|
|
protected TextView emptyText; |
|
|
|
protected TextView emptyText; |
|
|
|
@ViewById |
|
|
|
@ViewById |
|
|
@ -251,7 +252,9 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener |
|
|
|
// Sort the list of filtered torrents
|
|
|
|
// Sort the list of filtered torrents
|
|
|
|
Collections.sort(filteredTorrents, new TorrentsComparator(daemonType, this.currentSortOrder, this.currentSortDescending)); |
|
|
|
Collections.sort(filteredTorrents, new TorrentsComparator(daemonType, this.currentSortOrder, this.currentSortDescending)); |
|
|
|
|
|
|
|
|
|
|
|
((TorrentsAdapter) torrentsList.getAdapter()).update(filteredTorrents); |
|
|
|
if (torrentsList.getAdapter() != null) { |
|
|
|
|
|
|
|
((TorrentsAdapter) torrentsList.getAdapter()).update(filteredTorrents); |
|
|
|
|
|
|
|
} |
|
|
|
updateViewVisibility(); |
|
|
|
updateViewVisibility(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -464,7 +467,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener |
|
|
|
if (!hasAConnection) { |
|
|
|
if (!hasAConnection) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
boolean isEmpty = torrents == null || torrentsList.getAdapter().isEmpty(); |
|
|
|
boolean isEmpty = torrents == null || torrentsList.getAdapter() != null && torrentsList.getAdapter().isEmpty(); |
|
|
|
boolean hasError = connectionErrorMessage != null; |
|
|
|
boolean hasError = connectionErrorMessage != null; |
|
|
|
nosettingsText.setVisibility(View.GONE); |
|
|
|
nosettingsText.setVisibility(View.GONE); |
|
|
|
errorText.setVisibility(hasError ? View.VISIBLE : View.GONE); |
|
|
|
errorText.setVisibility(hasError ? View.VISIBLE : View.GONE); |
|
|
|