// Path: library-lis/src/main/java/com/cocolover2/lis/entity/ImageBucket.java
// public class ImageBucket{
//     public int count = 0;
//     public String bucketName;//文件夹名
//     public ArrayList<ImageItem> imageList;//文件夹下所有文件的绝对路径
//     public boolean isSelected = false;//文件夹是否被选中
// }
// 
// Path: library-lis/src/main/java/com/cocolover2/lis/entity/ImageItem.java
// public class ImageItem implements Parcelable {
//     public int imageId;
//     public String imagePath;//原图的路径
//     public long imageSize;
//     public long createTime;
//     public boolean isSelected;
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeInt(imageId);
//         dest.writeString(imagePath);
//         dest.writeLong(imageSize);
//         dest.writeLong(createTime);
//         dest.writeByte((byte) (isSelected ? 1 : 0));
//     }
// 
//     public static final Parcelable.Creator<ImageItem> CREATOR = new Parcelable.Creator<ImageItem>() {
//         @Override
//         public ImageItem createFromParcel(Parcel source) {
//             //读取要和写入的顺序一致
//             ImageItem item = new ImageItem();
//             item.imageId = source.readInt();
//             item.imagePath = source.readString();
//             item.imageSize = source.readLong();
//             item.createTime = source.readLong();
//             item.isSelected = (source.readByte() != 0);
//             return item;
//         }
// 
//         @Override
//         public ImageItem[] newArray(int size) {
//             return new ImageItem[size];
//         }
//     };
// }


import android.content.Context;
import android.database.Cursor;
import android.provider.MediaStore.Images.Media;
import com.cocolover2.lis.entity.ImageBucket;
import com.cocolover2.lis.entity.ImageItem;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
                i.imageId = id;
                i.imagePath = path;
                i.imageSize = file.length();
                i.createTime = file.lastModified();
                imageList.add(i);
                ImageBucket bucket;
                if (this.bucketMap.containsKey(bucketId))
                    bucket = this.bucketMap.get(bucketId);
                else {
                    bucket = new ImageBucket();
                    bucketMap.put(bucketId, bucket);
                    bucket.bucketName = bucketname;
                    bucket.imageList = new ArrayList<>();
                }
                bucket.count++;
                bucket.imageList.add(i);
            } while (cur.moveToNext());
        }
        if (cur != null)
            cur.close();
    }

    /**
     * 获取图片的文件夹列表
     *
     * @return
     */
    public ArrayList<ImageBucket> getImageBucketList(Context context) {
        if (bucketMap == null || bucketMap.size() == 0)
            buildImagesBucketList(context);
// Path: library-lis/src/main/java/com/cocolover2/lis/entity/ImageBucket.java
// public class ImageBucket{
//     public int count = 0;
//     public String bucketName;//文件夹名
//     public ArrayList<ImageItem> imageList;//文件夹下所有文件的绝对路径
//     public boolean isSelected = false;//文件夹是否被选中
// }
// 
// Path: library-lis/src/main/java/com/cocolover2/lis/entity/ImageItem.java
// public class ImageItem implements Parcelable {
//     public int imageId;
//     public String imagePath;//原图的路径
//     public long imageSize;
//     public long createTime;
//     public boolean isSelected;
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeInt(imageId);
//         dest.writeString(imagePath);
//         dest.writeLong(imageSize);
//         dest.writeLong(createTime);
//         dest.writeByte((byte) (isSelected ? 1 : 0));
//     }
// 
//     public static final Parcelable.Creator<ImageItem> CREATOR = new Parcelable.Creator<ImageItem>() {
//         @Override
//         public ImageItem createFromParcel(Parcel source) {
//             //读取要和写入的顺序一致
//             ImageItem item = new ImageItem();
//             item.imageId = source.readInt();
//             item.imagePath = source.readString();
//             item.imageSize = source.readLong();
//             item.createTime = source.readLong();
//             item.isSelected = (source.readByte() != 0);
//             return item;
//         }
// 
//         @Override
//         public ImageItem[] newArray(int size) {
//             return new ImageItem[size];
//         }
//     };
// }


// Path: library-lis/src/main/java/com/cocolover2/lis/AlbumHelper.java
import android.content.Context;
import android.database.Cursor;
import android.provider.MediaStore.Images.Media;
import com.cocolover2.lis.entity.ImageBucket;
import com.cocolover2.lis.entity.ImageItem;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

                i.imageId = id;
                i.imagePath = path;
                i.imageSize = file.length();
                i.createTime = file.lastModified();
                imageList.add(i);
                ImageBucket bucket;
                if (this.bucketMap.containsKey(bucketId))
                    bucket = this.bucketMap.get(bucketId);
                else {
                    bucket = new ImageBucket();
                    bucketMap.put(bucketId, bucket);
                    bucket.bucketName = bucketname;
                    bucket.imageList = new ArrayList<>();
                }
                bucket.count++;
                bucket.imageList.add(i);
            } while (cur.moveToNext());
        }
        if (cur != null)
            cur.close();
    }

    /**
     * 获取图片的文件夹列表
     *
     * @return
     */
    public ArrayList<ImageBucket> getImageBucketList(Context context) {
        if (bucketMap == null || bucketMap.size() == 0)
            buildImagesBucketList(context);
        ArrayList<ImageBucket> allBuckets = new ArrayList<>();