From 8d9aee40bfceae0038af37cbf0b70dfb657359af Mon Sep 17 00:00:00 2001 From: Eric Kok Date: Thu, 13 Jun 2013 17:41:52 +0200 Subject: [PATCH] Some UI fixes in details screen. --- core/res/layout/list_item_simple.xml | 3 ++- core/src/org/transdroid/core/gui/DetailsActivity.java | 2 ++ core/src/org/transdroid/core/gui/DetailsFragment.java | 3 +-- core/src/org/transdroid/core/gui/lists/DetailsAdapter.java | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/res/layout/list_item_simple.xml b/core/res/layout/list_item_simple.xml index cc5133ab..186cc380 100644 --- a/core/res/layout/list_item_simple.xml +++ b/core/res/layout/list_item_simple.xml @@ -12,6 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="15sp" - android:textIsSelectable="false" /> + android:textIsSelectable="false" + android:autoLink="web" /> \ No newline at end of file diff --git a/core/src/org/transdroid/core/gui/DetailsActivity.java b/core/src/org/transdroid/core/gui/DetailsActivity.java index 13c18192..8778dc9c 100644 --- a/core/src/org/transdroid/core/gui/DetailsActivity.java +++ b/core/src/org/transdroid/core/gui/DetailsActivity.java @@ -113,6 +113,8 @@ public class DetailsActivity extends SherlockFragmentActivity implements Torrent protected void refreshScreen() { fragmentDetails.updateIsLoading(true); refreshTorrent(); + refreshTorrentDetails(torrent); + refreshTorrentFiles(torrent); } @Background diff --git a/core/src/org/transdroid/core/gui/DetailsFragment.java b/core/src/org/transdroid/core/gui/DetailsFragment.java index 96d0606f..2ead71f1 100644 --- a/core/src/org/transdroid/core/gui/DetailsFragment.java +++ b/core/src/org/transdroid/core/gui/DetailsFragment.java @@ -141,10 +141,9 @@ public class DetailsFragment extends SherlockFragment { detailsList.setVisibility(View.GONE); emptyText.setVisibility(!isLoadingTorrent? View.VISIBLE: View.GONE); loadingProgress.setVisibility(isLoadingTorrent? View.VISIBLE: View.GONE); - torrent = null; + // Note: this.torrent is not cleared as we need to know later what the fragment was originally bound to torrentDetails = null; torrentFiles = null; - getActivity().supportInvalidateOptionsMenu(); } /** diff --git a/core/src/org/transdroid/core/gui/lists/DetailsAdapter.java b/core/src/org/transdroid/core/gui/lists/DetailsAdapter.java index 77460a11..5335ec7f 100644 --- a/core/src/org/transdroid/core/gui/lists/DetailsAdapter.java +++ b/core/src/org/transdroid/core/gui/lists/DetailsAdapter.java @@ -90,7 +90,7 @@ public class DetailsAdapter extends MergeAdapter { * @param trackers The new list of trackers known for this torrent, or null if the list and header should be hidden */ public void updateTrackers(List trackers) { - if (trackers == null) { + if (trackers == null || trackers.isEmpty()) { trackersAdapter.update(new ArrayList()); trackersSeparatorView.setVisibility(View.GONE); } else { @@ -104,7 +104,7 @@ public class DetailsAdapter extends MergeAdapter { * @param errors The new list of errors known for this torrent, or null if the list and header should be hidden */ public void updateErrors(List errors) { - if (errors == null) { + if (errors == null || errors.isEmpty()) { errorsAdapter.update(new ArrayList()); errorsSeparatorView.setVisibility(View.GONE); } else {