Search in sources :

Example 6 with LocalMediaFolder

use of com.luck.picture.lib.weiui.library.entity.LocalMediaFolder in project weiui by kuaifan.

the class LocalMediaLoader method getImageFolder.

/**
 * 创建相应文件夹
 *
 * @param path
 * @param imageFolders
 * @return
 */
private LocalMediaFolder getImageFolder(String path, List<LocalMediaFolder> imageFolders) {
    File imageFile = new File(path);
    File folderFile = imageFile.getParentFile();
    for (LocalMediaFolder folder : imageFolders) {
        // 同一个文件夹下,返回自己,否则创建新文件夹
        if (folder.getName().equals(folderFile.getName())) {
            return folder;
        }
    }
    LocalMediaFolder newFolder = new LocalMediaFolder();
    newFolder.setName(folderFile.getName());
    newFolder.setPath(folderFile.getAbsolutePath());
    newFolder.setFirstImagePath(path);
    imageFolders.add(newFolder);
    return newFolder;
}
Also used : LocalMediaFolder(com.luck.picture.lib.weiui.library.entity.LocalMediaFolder) File(java.io.File)

Aggregations

LocalMediaFolder (com.luck.picture.lib.weiui.library.entity.LocalMediaFolder)6 File (java.io.File)2 Bitmap (android.graphics.Bitmap)1 RoundedBitmapDrawable (android.support.v4.graphics.drawable.RoundedBitmapDrawable)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 LocalMedia (com.luck.picture.lib.weiui.library.entity.LocalMedia)1 RequestOptions (vip.kuaifan.weiui.extend.integration.glide.request.RequestOptions)1 BitmapImageViewTarget (vip.kuaifan.weiui.extend.integration.glide.request.target.BitmapImageViewTarget)1