From d8947fff67ee818756a010e5f3e14c3df053d50f Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Thu, 20 Feb 2014 21:59:20 +0100 Subject: [PATCH] Removed unused comparison feature in FileArrayAdapter (this is done server-side). --- .../controldlna/utility/FileArrayAdapter.java | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/src/com/github/nutomic/controldlna/utility/FileArrayAdapter.java b/src/com/github/nutomic/controldlna/utility/FileArrayAdapter.java index d513e00..223b684 100644 --- a/src/com/github/nutomic/controldlna/utility/FileArrayAdapter.java +++ b/src/com/github/nutomic/controldlna/utility/FileArrayAdapter.java @@ -27,11 +27,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.github.nutomic.controldlna.utility; -import java.util.Comparator; import java.util.List; import org.teleal.cling.support.model.DIDLObject; -import org.teleal.cling.support.model.container.Container; import org.teleal.cling.support.model.item.Item; import org.teleal.cling.support.model.item.MusicTrack; @@ -45,35 +43,15 @@ import android.widget.TextView; import com.github.nutomic.controldlna.R; /** - * Allows displaying UPNP media server directory contents in a ListView. + * ArrayAdapter specialization for UPNP server directory contents. * * @author Felix Ableitner * */ public class FileArrayAdapter extends ArrayAdapter { - /** - * Provides sorting of elements by track number. - */ public FileArrayAdapter(Context context) { super(context, R.layout.list_item); - sort(new Comparator() { - - @Override - public int compare(DIDLObject lhs, DIDLObject rhs) { - if (lhs instanceof MusicTrack && rhs instanceof MusicTrack) - return ((MusicTrack) rhs).getOriginalTrackNumber() - - ((MusicTrack) lhs).getOriginalTrackNumber(); - else if (lhs instanceof Item && rhs instanceof Container) - return 1; - else if (rhs instanceof Item && lhs instanceof Container) - return -1; - else if (lhs instanceof Container && rhs instanceof Container) - return lhs.getTitle().compareTo(rhs.getTitle()); - else - return 0; - } - }); } /**