/*
 * Copyright (C) 2015 Pedro Vicente Gomez Sanchez.
 *
 * 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.github.pedrovgs.nox.imageloader;

import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;

/**
 * Download images in background and notifies the result using a listener mechanism. This
 * abstraction is needed to hide the usage of concrete image management libraries and to improve
 * the project testability.
 *
 * @author Pedro Vicente Gomez Sanchez.
 */
public interface ImageLoader {

  ImageLoader load(String url);

  ImageLoader load(Integer resourceId);

  ImageLoader withPlaceholder(Integer placeholderId);

  ImageLoader useCircularTransformation();

  ImageLoader size(int size);

  void notify(Listener listener);

  void pause();

  void resume();

  public interface Listener {

    void onPlaceholderLoaded(Drawable placeholder);

    void onImageLoaded(Bitmap image);

    void onError();

  }
}

@@ -950,370 +950,1544 @@
 ity.
-%0A *%0A * @author Pedro Vicente Gomez Sanchez.%0A */%0Apublic interface ImageLoader %7B%0A%0A  ImageLoader load(String url);%0A%0A  ImageLoader load(Integer resourceId);%0A%0A  ImageLoader withPlaceholder(Integer placeholderId);%0A%0A  ImageLoader useCircularTransformation();%0A%0A  ImageLoader size(int size);%0A%0A  void notify(Listener listener);%0A%0A  void pause();%0A%0A  void resume();%0A%0A  public
+ This ImageLoader interface offers a fluent API similar to the most used%0A * Android libraries. The resource will be downloaded asynchronously.%0A *%0A * @author Pedro Vicente Gomez Sanchez.%0A */%0Apublic interface ImageLoader %7B%0A%0A  /**%0A   * Configures an url to be downloaded.%0A   */%0A  ImageLoader load(String url);%0A%0A  /**%0A   * Configures a resource id to be loaded.%0A   */%0A  ImageLoader load(Integer resourceId);%0A%0A  /**%0A   * Loads a placeholder using a resource id to be shown while the external resource is being%0A   * downloaded.%0A   */%0A  ImageLoader withPlaceholder(Integer placeholderId);%0A%0A  /**%0A   * Applies a circular transformation to transform the source bitmap into a circular one.%0A   */%0A  ImageLoader useCircularTransformation();%0A%0A  /**%0A   * Changes the external resource size once it downloaded and before to notify the listener.%0A   */%0A  ImageLoader size(int size);%0A%0A  /**%0A   * Configures a listener where the ImageLoader will notify once the resource be loaded. This%0A   * method has to be called to start the resource download. The listener used can't be null.%0A   */%0A  void notify(Listener listener);%0A%0A  /**%0A   * Pauses all the resource downloads associated to this library.%0A   */%0A  void pause();%0A%0A  /**%0A   * Resumes all the resource downloads associated to this library.%0A   */%0A  void resume();%0A%0A  /**%0A   * Declares some methods which will be called during the resource download process implemented by%0A   * the ImageLoader. Use this interface to be notified when the placeholder and the final resource%0A   * be ready to be used.%0A   */%0A 
  int
@@ -2617,15 +2617,14 @@
 rror();%0A
-%0A
   %7D%0A%7D%0A

Add javadoc to ImageLoader interface