mobile/android/thirdparty/com/squareup/picasso/Target.java

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mobile/android/thirdparty/com/squareup/picasso/Target.java	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,45 @@
     1.4 +/*
     1.5 + * Copyright (C) 2013 Square, Inc.
     1.6 + *
     1.7 + * Licensed under the Apache License, Version 2.0 (the "License");
     1.8 + * you may not use this file except in compliance with the License.
     1.9 + * You may obtain a copy of the License at
    1.10 + *
    1.11 + *      http://www.apache.org/licenses/LICENSE-2.0
    1.12 + *
    1.13 + * Unless required by applicable law or agreed to in writing, software
    1.14 + * distributed under the License is distributed on an "AS IS" BASIS,
    1.15 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    1.16 + * See the License for the specific language governing permissions and
    1.17 + * limitations under the License.
    1.18 + */
    1.19 +package com.squareup.picasso;
    1.20 +
    1.21 +import android.graphics.Bitmap;
    1.22 +import android.graphics.drawable.Drawable;
    1.23 +
    1.24 +import static com.squareup.picasso.Picasso.LoadedFrom;
    1.25 +
    1.26 +/**
    1.27 + * Represents an arbitrary listener for image loading.
    1.28 + * <p/>
    1.29 + * Objects implementing this class <strong>must</strong> have a working implementation of
    1.30 + * {@link #equals(Object)} and {@link #hashCode()} for proper storage internally. Instances of this
    1.31 + * interface will also be compared to determine if view recycling is occurring. It is recommended
    1.32 + * that you add this interface directly on to a custom view type when using in an adapter to ensure
    1.33 + * correct recycling behavior.
    1.34 + */
    1.35 +public interface Target {
    1.36 +  /**
    1.37 +   * Callback when an image has been successfully loaded.
    1.38 +   * <p/>
    1.39 +   * <strong>Note:</strong> You must not recycle the bitmap.
    1.40 +   */
    1.41 +  void onBitmapLoaded(Bitmap bitmap, LoadedFrom from);
    1.42 +
    1.43 +  /** Callback indicating the image could not be successfully loaded. */
    1.44 +  void onBitmapFailed(Drawable errorDrawable);
    1.45 +
    1.46 +  /** Callback invoked right before your request is submitted. */
    1.47 +  void onPrepareLoad(Drawable placeHolderDrawable);
    1.48 +}

mercurial