Back to project page MaterialManager.
The source code is released under:
There is no license, someone decided to pretty much republish Cabinet with no credit so I?m taking away the license altogether.
If you think the Android project MaterialManager listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.afollestad.cabinet.comparators; //from w w w . jav a 2s .c om import com.afollestad.cabinet.file.base.File; /** * Sorts files and folders by size, from large to small. Folders are considered large. * * @author Aidan Follestad (afollestad) */ public class HighLowSizeComparator implements java.util.Comparator<File> { @Override public int compare(File lhs, File rhs) { if (lhs.isDirectory() && !rhs.isDirectory()) { // Folders before files return -1; } else if (lhs.isDirectory() && rhs.isDirectory() || !lhs.isDirectory() && !rhs.isDirectory()) { return Long.valueOf(rhs.length()).compareTo(lhs.length()); } else if (!lhs.isDirectory() && rhs.isDirectory()) { // Files below folders return 1; } else return 0; // stay where it is now } }