/*
 * Copyright © 2017 Yan Zhenjie.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.yanzhenjie.album;

import android.widget.ImageView;

/**
 * <p>
 *      Customizing the Album Loader, you can do some optimization work.
 * </p>
 * Created by Yan Zhenjie on 2017/3/31.
 */
public interface AlbumLoader {

    /**
     * Load a preview of the album file.
     *
     * @param imageView  {@link ImageView}.
     * @param albumFile  the media object may be a picture or video.
     * @param viewWidth  the width fo target view.
     * @param viewHeight the width fo target view.
     */
    void loadAlbumFile(ImageView imageView, AlbumFile albumFile, int viewWidth, int viewHeight);

    /**
     * Load a preview of the picture.
     *
     * @param imageView  {@link ImageView}.
     * @param imagePath  file path, which may be a local path or a network path.
     * @param viewWidth  the width fo target view.
     * @param viewHeight the width fo target view.
     */
    void loadImage(ImageView imageView, String imagePath, int viewWidth, int viewHeight);

}

@@ -12,10 +12,8 @@
 ight
- %C2%A9
  201
@@ -669,85 +669,58 @@
  %3Cp%3E
-%0A *      Customizing the Album Loader, you can do some optimization work.%0A * 
+Used to load the preview, it should be customized.
 %3C/p%3E
@@ -796,16 +796,256 @@
 ader %7B%0A%0A
+    AlbumLoader DEFAULT = new AlbumLoader() %7B%0A        @Override%0A        public void load(ImageView imageView, AlbumFile albumFile) %7B%0A        %7D%0A%0A        @Override%0A        public void load(ImageView imageView, String url) %7B%0A        %7D%0A    %7D;%0A%0A
     /**%0A
@@ -1108,33 +1108,32 @@
 param imageView 
- 
 %7B@link ImageView
@@ -1159,17 +1159,16 @@
 bumFile 
- 
 the medi
@@ -1207,110 +1207,8 @@
 eo.%0A
-     * @param viewWidth  the width fo target view.%0A     * @param viewHeight the width fo target view.%0A
     
@@ -1224,25 +1224,16 @@
 oid load
-AlbumFile
 (ImageVi
@@ -1269,86 +1269,97 @@
 File
-, int viewWidth, int viewHeight);%0A%0A    /**%0A     * Load a preview of the pictur
+);%0A%0A    /**%0A     * Load thumbnails of pictures or videos, either local file or remote fil
 e.%0A 
@@ -1388,17 +1388,16 @@
 ageView 
- 
 %7B@link I
@@ -1425,175 +1425,64 @@
 ram 
-imagePath  file path, which may be a local path or a network path.%0A     * @param viewWidth  the width fo target view.%0A     * @param viewHeight the width fo target view
+url       The url of the file, local path or remote path
 .%0A  
@@ -1500,21 +1500,16 @@
 oid load
-Image
 (ImageVi
@@ -1533,50 +1533,12 @@
 ing 
-imagePath, int viewWidth, int viewHeight
+url
 );%0A%0A%7D
-%0A

Optimize the loader.