com.davemorrissey.labs.subscaleview

## Class SubsamplingScaleImageView.DefaultOnImageEventListener

- java.lang.Object
- - com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView.DefaultOnImageEventListener

All Implemented Interfaces:
  SubsamplingScaleImageView.OnImageEventListener

Enclosing class:
  SubsamplingScaleImageView

    public static class SubsamplingScaleImageView.DefaultOnImageEventListener
    extends Object
    implements SubsamplingScaleImageView.OnImageEventListener

Default implementation of `SubsamplingScaleImageView.OnImageEventListener` for extension. This does nothing in any method.

### Constructor Summary

Constructors
Constructor and Description
`DefaultOnImageEventListener()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `onImageLoaded()` Called when the full size image is ready.
`void` `onImageLoadError(Exception e)` Indicates an error initiliasing the decoder when using a tiling, or when loading the full size bitmap when tiling is disabled.
`void` `onPreviewLoadError(Exception e)` Called when a preview image could not be loaded.
`void` `onPreviewReleased()` Called when a bitmap set using ImageSource.cachedBitmap is no longer being used by the View.
`void` `onReady()` Called when the dimensions of the image and view are known, and either a preview image, the full size image, or base layer tiles are loaded.
`void` `onTileLoadError(Exception e)` Called when an image tile could not be loaded.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DefaultOnImageEventListener

    public DefaultOnImageEventListener()

### Method Detail

#### onReady

    public void onReady()

Description copied from interface: `SubsamplingScaleImageView.OnImageEventListener`
Called when the dimensions of the image and view are known, and either a preview image, the full size image, or base layer tiles are loaded. This indicates the scale and translate are known and the next draw will display an image. This event can be used to hide a loading graphic, or inform a subclass that it is safe to draw overlays.

Specified by:
  `onReady` in interface `SubsamplingScaleImageView.OnImageEventListener`

#### onImageLoaded

    public void onImageLoaded()

Description copied from interface: `SubsamplingScaleImageView.OnImageEventListener`
Called when the full size image is ready. When using tiling, this means the lowest resolution base layer of tiles are loaded, and when tiling is disabled, the image bitmap is loaded. This event could be used as a trigger to enable gestures if you wanted interaction disabled while only a preview is displayed, otherwise for most cases `SubsamplingScaleImageView.OnImageEventListener.onReady()` is the best event to listen to.

Specified by:
  `onImageLoaded` in interface `SubsamplingScaleImageView.OnImageEventListener`

#### onPreviewLoadError

    public void onPreviewLoadError(Exception e)

Description copied from interface: `SubsamplingScaleImageView.OnImageEventListener`
Called when a preview image could not be loaded. This method cannot be relied upon; certain encoding types of supported image formats can result in corrupt or blank images being loaded and displayed with no detectable error. The view will continue to load the full size image.

Specified by:
  `onPreviewLoadError` in interface `SubsamplingScaleImageView.OnImageEventListener`
Parameters:
  `e` - The exception thrown. This error is logged by the view.

#### onImageLoadError

    public void onImageLoadError(Exception e)

Description copied from interface: `SubsamplingScaleImageView.OnImageEventListener`
Indicates an error initiliasing the decoder when using a tiling, or when loading the full size bitmap when tiling is disabled. This method cannot be relied upon; certain encoding types of supported image formats can result in corrupt or blank images being loaded and displayed with no detectable error.

Specified by:
  `onImageLoadError` in interface `SubsamplingScaleImageView.OnImageEventListener`
Parameters:
  `e` - The exception thrown. This error is also logged by the view.

#### onTileLoadError

    public void onTileLoadError(Exception e)

Description copied from interface: `SubsamplingScaleImageView.OnImageEventListener`
Called when an image tile could not be loaded. This method cannot be relied upon; certain encoding types of supported image formats can result in corrupt or blank images being loaded and displayed with no detectable error. Most cases where an unsupported file is used will result in an error caught by `SubsamplingScaleImageView.OnImageEventListener.onImageLoadError(Exception)`.

Specified by:
  `onTileLoadError` in interface `SubsamplingScaleImageView.OnImageEventListener`
Parameters:
  `e` - The exception thrown. This error is logged by the view.

#### onPreviewReleased

    public void onPreviewReleased()

Description copied from interface: `SubsamplingScaleImageView.OnImageEventListener`
Called when a bitmap set using ImageSource.cachedBitmap is no longer being used by the View. This is useful if you wish to manage the bitmap after the preview is shown

Specified by:
  `onPreviewReleased` in interface `SubsamplingScaleImageView.OnImageEventListener`