├── picasso ├── src │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── squareup │ │ │ └── picasso │ │ │ ├── Callback.java │ │ │ ├── GetAction.java │ │ │ ├── Transformation.java │ │ │ ├── MemoryPolicy.java │ │ │ ├── FetchAction.java │ │ │ ├── ContentStreamRequestHandler.java │ │ │ ├── FileRequestHandler.java │ │ │ ├── NetworkPolicy.java │ │ │ ├── TargetAction.java │ │ │ ├── ResourceRequestHandler.java │ │ │ ├── Cache.java │ │ │ ├── AssetRequestHandler.java │ │ │ ├── Target.java │ │ │ ├── ImageViewAction.java │ │ │ ├── NetworkRequestHandler.java │ │ │ ├── Action.java │ │ │ ├── Downloader.java │ │ │ ├── ContactsPhotoRequestHandler.java │ │ │ ├── DeferredRequestCreator.java │ │ │ ├── PicassoExecutorService.java │ │ │ ├── RemoteViewsAction.java │ │ │ ├── OkHttp3Downloader.java │ │ │ ├── LruCache.java │ │ │ ├── MediaStoreRequestHandler.java │ │ │ ├── PicassoDrawable.java │ │ │ └── Stats.java │ └── test │ │ ├── resources │ │ └── robolectric.properties │ │ └── java │ │ └── com │ │ └── squareup │ │ └── picasso │ │ ├── AssetRequestHandlerTest.java │ │ ├── MemoryPolicyTest.java │ │ ├── Shadows.java │ │ ├── TestTransformation.java │ │ ├── PicassoDrawableTest.java │ │ ├── MarkableInputStreamTest.java │ │ ├── TargetActionTest.java │ │ ├── MediaStoreRequestHandlerTest.java │ │ ├── RemoteViewsActionTest.java │ │ ├── UtilsTest.java │ │ └── OkHttp3DownloaderTest.java ├── gradle.properties ├── lint.xml ├── consumer-proguard-rules.txt └── build.gradle ├── website └── static │ ├── debug.png │ ├── sample.png │ ├── icon-github.png │ ├── icon-square.png │ ├── logo-square.png │ ├── app-theme.css │ ├── jquery-maven-artifact.min.js │ ├── html5shiv.min.js │ ├── jquery.smooth-scroll.min.js │ └── app.css ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── settings.gradle ├── picasso-sample ├── src │ └── main │ │ ├── res │ │ ├── drawable │ │ │ ├── error.jpg │ │ │ ├── placeholder.jpg │ │ │ ├── overlay_selector.xml │ │ │ ├── button_selector.xml │ │ │ └── list_selector.xml │ │ ├── drawable-hdpi │ │ │ ├── icon.png │ │ │ ├── button_normal.9.png │ │ │ ├── list_focused.9.png │ │ │ ├── list_pressed.9.png │ │ │ ├── button_disabled.9.png │ │ │ ├── button_focused.9.png │ │ │ ├── button_pressed.9.png │ │ │ ├── button_disabled_focused.9.png │ │ │ ├── list_selector_disabled.9.png │ │ │ └── contact_picture_placeholder.png │ │ ├── drawable-mdpi │ │ │ ├── icon.png │ │ │ ├── button_normal.9.png │ │ │ ├── list_focused.9.png │ │ │ ├── list_pressed.9.png │ │ │ ├── button_disabled.9.png │ │ │ ├── button_focused.9.png │ │ │ ├── button_pressed.9.png │ │ │ ├── button_disabled_focused.9.png │ │ │ ├── list_selector_disabled.9.png │ │ │ └── contact_picture_placeholder.png │ │ ├── drawable-xhdpi │ │ │ ├── icon.png │ │ │ ├── list_focused.9.png │ │ │ ├── list_pressed.9.png │ │ │ ├── button_focused.9.png │ │ │ ├── button_normal.9.png │ │ │ ├── button_pressed.9.png │ │ │ ├── button_disabled.9.png │ │ │ ├── list_selector_disabled.9.png │ │ │ ├── button_disabled_focused.9.png │ │ │ └── contact_picture_placeholder.png │ │ ├── drawable-nodpi │ │ │ └── noise.png │ │ ├── drawable-xxhdpi │ │ │ └── icon.png │ │ ├── drawable-xxxhdpi │ │ │ └── icon.png │ │ ├── values │ │ │ ├── integers.xml │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── themes.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ ├── values-w500dp │ │ │ └── integers.xml │ │ ├── values-w600dp │ │ │ ├── integers.xml │ │ │ └── dimens.xml │ │ ├── values-w700dp │ │ │ └── integers.xml │ │ ├── values-land │ │ │ └── dimens.xml │ │ ├── layout │ │ │ ├── picasso_sample_activity_item.xml │ │ │ ├── sample_widget.xml │ │ │ ├── sample_list_detail_list.xml │ │ │ ├── sample_contacts_activity.xml │ │ │ ├── sample_gridview_activity.xml │ │ │ ├── notification_view.xml │ │ │ ├── sample_list_detail_item.xml │ │ │ ├── sample_gallery_activity.xml │ │ │ ├── sample_list_detail_detail.xml │ │ │ ├── sample_contacts_activity_item.xml │ │ │ └── picasso_sample_activity.xml │ │ └── xml │ │ │ └── sample_widget_info.xml │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── picasso │ │ │ ├── SampleGridViewActivity.java │ │ │ ├── SquaredImageView.java │ │ │ ├── SampleScrollListener.java │ │ │ ├── SampleWidgetProvider.java │ │ │ ├── SampleGridViewAdapter.java │ │ │ ├── SampleListDetailAdapter.java │ │ │ ├── PicassoSampleActivity.java │ │ │ ├── GrayscaleTransformation.java │ │ │ ├── SampleContactsAdapter.java │ │ │ ├── SampleGalleryActivity.java │ │ │ ├── SampleContactsActivity.java │ │ │ ├── SampleListDetailActivity.java │ │ │ └── PicassoSampleAdapter.java │ │ └── AndroidManifest.xml ├── lint.xml └── build.gradle ├── .gitignore ├── gradle.properties ├── CONTRIBUTING.md ├── deploy_website.sh ├── .travis.yml ├── .buildscript └── deploy_snapshot.sh ├── RELEASING.md ├── dependencies.gradle ├── README.md ├── gradlew.bat ├── checkstyle.xml └── gradlew /picasso/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /website/static/debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/website/static/debug.png -------------------------------------------------------------------------------- /website/static/sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/website/static/sample.png -------------------------------------------------------------------------------- /website/static/icon-github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/website/static/icon-github.png -------------------------------------------------------------------------------- /website/static/icon-square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/website/static/icon-square.png -------------------------------------------------------------------------------- /website/static/logo-square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/website/static/logo-square.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /picasso/src/test/resources/robolectric.properties: -------------------------------------------------------------------------------- 1 | sdk: 18 2 | constants: com.squareup.picasso.BuildConfig 3 | manifest: --default 4 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'picasso-root' 2 | 3 | include 'picasso' 4 | //include 'picasso-pollexor' 5 | include 'picasso-sample' 6 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable/error.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable/error.jpg -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-nodpi/noise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-nodpi/noise.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-xxxhdpi/icon.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable/placeholder.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable/placeholder.jpg -------------------------------------------------------------------------------- /picasso-sample/src/main/res/values/integers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2 4 | 5 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-hdpi/button_normal.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-hdpi/button_normal.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-hdpi/list_focused.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-hdpi/list_focused.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-hdpi/list_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-hdpi/list_pressed.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-mdpi/button_normal.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-mdpi/button_normal.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-mdpi/list_focused.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-mdpi/list_focused.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-mdpi/list_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-mdpi/list_pressed.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-xhdpi/list_focused.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-xhdpi/list_focused.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-xhdpi/list_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-xhdpi/list_pressed.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/values-w500dp/integers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 3 4 | 5 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/values-w600dp/integers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 4 | 5 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/values-w700dp/integers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 4 | 5 | -------------------------------------------------------------------------------- /picasso/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_ARTIFACT_ID=picasso 2 | POM_NAME=Picasso 3 | POM_DESCRIPTION=A powerful image downloading and caching library for Android 4 | POM_PACKAGING=aar 5 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-hdpi/button_disabled.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-hdpi/button_disabled.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-hdpi/button_focused.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-hdpi/button_focused.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-hdpi/button_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-hdpi/button_pressed.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-mdpi/button_disabled.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-mdpi/button_disabled.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-mdpi/button_focused.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-mdpi/button_focused.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-mdpi/button_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-mdpi/button_pressed.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-xhdpi/button_focused.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-xhdpi/button_focused.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-xhdpi/button_normal.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-xhdpi/button_normal.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-xhdpi/button_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-xhdpi/button_pressed.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/values-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 40dp 4 | 5 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/values-w600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 56dp 4 | 5 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-xhdpi/button_disabled.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-xhdpi/button_disabled.9.png -------------------------------------------------------------------------------- /picasso/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /picasso-sample/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-hdpi/button_disabled_focused.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-hdpi/button_disabled_focused.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-hdpi/list_selector_disabled.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-hdpi/list_selector_disabled.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-mdpi/button_disabled_focused.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-mdpi/button_disabled_focused.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-mdpi/list_selector_disabled.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-mdpi/list_selector_disabled.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-xhdpi/list_selector_disabled.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-xhdpi/list_selector_disabled.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-hdpi/contact_picture_placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-hdpi/contact_picture_placeholder.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-mdpi/contact_picture_placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-mdpi/contact_picture_placeholder.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-xhdpi/button_disabled_focused.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-xhdpi/button_disabled_focused.9.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable-xhdpi/contact_picture_placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-android/Picasso/HEAD/picasso-sample/src/main/res/drawable-xhdpi/contact_picture_placeholder.png -------------------------------------------------------------------------------- /picasso-sample/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #40000000 4 | #ff202020 5 | #ff555555 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Oct 20 20:22:56 EDT 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/layout/picasso_sample_activity_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable/overlay_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/layout/sample_widget.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/layout/sample_list_detail_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 48dp 4 | 60dp 5 | 110dp 6 | 110dp 7 | 64dp 8 | 9 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/layout/sample_contacts_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/xml/sample_widget_info.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /picasso/consumer-proguard-rules.txt: -------------------------------------------------------------------------------- 1 | ### OKHTTP 2 | 3 | # Platform calls Class.forName on types which do not exist on Android to determine platform. 4 | -dontnote okhttp3.internal.Platform 5 | 6 | 7 | ### OKIO 8 | 9 | # java.nio.file.* usage which cannot be used at runtime. Animal sniffer annotation. 10 | -dontwarn okio.Okio 11 | # JDK 7-only method which is @hide on Android. Animal sniffer annotation. 12 | -dontwarn okio.DeflaterSink 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse 2 | .classpath 3 | .project 4 | .settings 5 | eclipsebin 6 | 7 | # Ant 8 | bin 9 | gen 10 | build 11 | out 12 | lib 13 | 14 | # Maven 15 | target 16 | pom.xml.* 17 | release.properties 18 | coverage.ec 19 | 20 | # IntelliJ 21 | .idea 22 | *.iml 23 | *.iws 24 | *.ipr 25 | classes 26 | gen-external-apklibs 27 | 28 | # Robolectric 29 | tmp 30 | 31 | .DS_Store 32 | 33 | # Gradle 34 | .gradle 35 | jniLibs 36 | build 37 | local.properties 38 | reports 39 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/layout/sample_gridview_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | GROUP=com.squareup.picasso 2 | VERSION_NAME=3.0.0-SNAPSHOT 3 | 4 | POM_URL=https://github.com/square/picasso/ 5 | POM_SCM_URL=https://github.com/square/picasso/ 6 | POM_SCM_CONNECTION=scm:git:git://github.com/square/picasso.git 7 | POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/square/picasso.git 8 | 9 | POM_LICENCE_NAME=The Apache Software License, Version 2.0 10 | POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt 11 | POM_LICENCE_DIST=repo 12 | 13 | POM_DEVELOPER_ID=square 14 | POM_DEVELOPER_NAME=Square, Inc. 15 | -------------------------------------------------------------------------------- /picasso-sample/src/main/java/com/example/picasso/SampleGridViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.picasso; 2 | 3 | import android.os.Bundle; 4 | import android.widget.GridView; 5 | 6 | public class SampleGridViewActivity extends PicassoSampleActivity { 7 | @Override protected void onCreate(Bundle savedInstanceState) { 8 | super.onCreate(savedInstanceState); 9 | setContentView(R.layout.sample_gridview_activity); 10 | 11 | GridView gv = (GridView) findViewById(R.id.grid_view); 12 | gv.setAdapter(new SampleGridViewAdapter(this)); 13 | gv.setOnScrollListener(new SampleScrollListener(this)); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing 2 | ============ 3 | 4 | If you would like to contribute code to Picasso you can do so through GitHub by 5 | forking the repository and sending a pull request. 6 | 7 | When submitting code, please make every effort to follow existing conventions 8 | and style in order to keep the code as readable as possible. Please also make 9 | sure your code compiles by running `mvn clean verify`. 10 | 11 | Before your code can be accepted into the project you must also sign the 12 | [Individual Contributor License Agreement (CLA)][1]. 13 | 14 | 15 | [1]: https://spreadsheets.google.com/spreadsheet/viewform?formkey=dDViT2xzUHAwRkI3X3k5Z0lQM091OGc6MQ&ndplr=1 16 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Picasso Samples 4 | HIDE 5 | MORE 6 | Picasso Sample Widget 7 | Picasso Sample Notification 8 | Select Picture 9 | On Ice Cream Sandwich and above, a disk cache is 10 | automatically used so that subsequent requests for the same URL do not re-download the 11 | image.\n\nTo enable this functionality on pre-ICS use a standalone HTTP client with caching such 12 | as OkHttp. 13 | 14 | 15 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/layout/notification_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 13 | 21 | 22 | -------------------------------------------------------------------------------- /picasso-sample/src/main/java/com/example/picasso/SquaredImageView.java: -------------------------------------------------------------------------------- 1 | package com.example.picasso; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.ImageView; 6 | 7 | /** An image view which always remains square with respect to its width. */ 8 | public final class SquaredImageView extends ImageView { 9 | public SquaredImageView(Context context) { 10 | super(context); 11 | } 12 | 13 | public SquaredImageView(Context context, AttributeSet attrs) { 14 | super(context, attrs); 15 | } 16 | 17 | @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 18 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); 19 | setMeasuredDimension(getMeasuredWidth(), getMeasuredWidth()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/layout/sample_list_detail_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 13 | 21 | 22 | -------------------------------------------------------------------------------- /deploy_website.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | REPO="git@github.com:square/picasso.git" 6 | DIR=temp-clone 7 | 8 | # Delete any existing temporary website clone 9 | rm -rf $DIR 10 | 11 | # Clone the current repo into temp folder 12 | git clone $REPO $DIR 13 | 14 | # Move working directory into temp folder 15 | cd $DIR 16 | 17 | # Checkout and track the gh-pages branch 18 | git checkout -t origin/gh-pages 19 | 20 | # Delete everything that isn't versioned (1.x, 2.x) 21 | ls | grep -E -v '^\d+\.x$' | xargs rm -rf 22 | 23 | # Copy website files from real repo 24 | cp -R ../website/* . 25 | 26 | # Stage all files in git and create a commit 27 | git add . 28 | git add -u 29 | git commit -m "Website at $(date)" 30 | 31 | # Push the new files up to GitHub 32 | git push origin gh-pages 33 | 34 | # Delete our temp folder 35 | cd .. 36 | rm -rf $DIR 37 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | 3 | android: 4 | components: 5 | - tools 6 | - platform-tools 7 | - build-tools-25.0.2 8 | - extra-android-m2repository 9 | - android-25 10 | 11 | jdk: 12 | - oraclejdk8 13 | 14 | script: 15 | - ./gradlew clean check 16 | 17 | after_success: 18 | - .buildscript/deploy_snapshot.sh 19 | 20 | env: 21 | global: 22 | - secure: "ewGvOsV2RSG7Zt4RIwc53LhC5cxN7TP1Bo6Wy/LVNLNMfvD5X1+z1KPzP4j036zAQ6fq6Oi/Y2Mn0HLYrmVxHInXq9rMzHVDRC0ygO1r/rQ4SHli8ZjiMOjICLn2rBdgZMN2UVca6iFblIkSBu7lAsU0hSL/fn5V840YIysX8Rk=" 23 | - secure: "CO/LRw7XKHBOYrwY7uUhwcDpkmQReYKxEWn2jX37k5fHPFU9Jps1rLrXlOU0OD5H2sAdnT2SaLLAd0lW9/dvrYbSDcmvrlDtHitg+uWe6r67kXOQpQty7jj8QKt660ThSbwrO8nSTPXzbbUPBdisE5TMyrUj1AgEhvjEEH2uQAg=" 24 | 25 | branches: 26 | except: 27 | - gh-pages 28 | 29 | notifications: 30 | email: false 31 | 32 | sudo: false 33 | 34 | cache: 35 | directories: 36 | - $HOME/.gradle 37 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable/button_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 19 | -------------------------------------------------------------------------------- /picasso-sample/src/main/java/com/example/picasso/SampleScrollListener.java: -------------------------------------------------------------------------------- 1 | package com.example.picasso; 2 | 3 | import android.content.Context; 4 | import android.widget.AbsListView; 5 | 6 | import com.squareup.picasso.Picasso; 7 | 8 | public class SampleScrollListener implements AbsListView.OnScrollListener { 9 | private final Context context; 10 | 11 | public SampleScrollListener(Context context) { 12 | this.context = context; 13 | } 14 | 15 | @Override 16 | public void onScrollStateChanged(AbsListView view, int scrollState) { 17 | final Picasso picasso = Picasso.with(context); 18 | if (scrollState == SCROLL_STATE_IDLE || scrollState == SCROLL_STATE_TOUCH_SCROLL) { 19 | picasso.resumeTag(context); 20 | } else { 21 | picasso.pauseTag(context); 22 | } 23 | } 24 | 25 | @Override 26 | public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, 27 | int totalItemCount) { 28 | // Do nothing. 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /picasso/src/main/java/com/squareup/picasso/Callback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Square, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.squareup.picasso; 17 | 18 | public interface Callback { 19 | void onSuccess(); 20 | 21 | void onError(Exception e); 22 | 23 | class EmptyCallback implements Callback { 24 | 25 | @Override public void onSuccess() { 26 | } 27 | 28 | @Override public void onError(Exception e) { 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /picasso/src/test/java/com/squareup/picasso/AssetRequestHandlerTest.java: -------------------------------------------------------------------------------- 1 | package com.squareup.picasso; 2 | 3 | import android.content.Context; 4 | import android.net.Uri; 5 | import java.io.IOException; 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | import org.mockito.Mock; 10 | import org.robolectric.RobolectricGradleTestRunner; 11 | 12 | import static org.fest.assertions.api.Assertions.assertThat; 13 | import static org.mockito.MockitoAnnotations.initMocks; 14 | 15 | @RunWith(RobolectricGradleTestRunner.class) 16 | public class AssetRequestHandlerTest { 17 | @Mock Context context; 18 | 19 | @Before public void setUp() { 20 | initMocks(this); 21 | } 22 | 23 | @Test public void truncatesFilePrefix() throws IOException { 24 | Uri uri = Uri.parse("file:///android_asset/foo/bar.png"); 25 | Request request = new Request.Builder(uri).build(); 26 | 27 | String actual = AssetRequestHandler.getFilePath(request); 28 | assertThat(actual).isEqualTo("foo/bar.png"); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /.buildscript/deploy_snapshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Deploy a jar, source jar, and javadoc jar to Sonatype's snapshot repo. 4 | # 5 | # Adapted from https://coderwall.com/p/9b_lfq and 6 | # http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/ 7 | 8 | SLUG="square/picasso" 9 | JDK="oraclejdk8" 10 | BRANCH="master" 11 | 12 | set -e 13 | 14 | if [ "$TRAVIS_REPO_SLUG" != "$SLUG" ]; then 15 | echo "Skipping snapshot deployment: wrong repository. Expected '$SLUG' but was '$TRAVIS_REPO_SLUG'." 16 | elif [ "$TRAVIS_JDK_VERSION" != "$JDK" ]; then 17 | echo "Skipping snapshot deployment: wrong JDK. Expected '$JDK' but was '$TRAVIS_JDK_VERSION'." 18 | elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then 19 | echo "Skipping snapshot deployment: was pull request." 20 | elif [ "$TRAVIS_BRANCH" != "$BRANCH" ]; then 21 | echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '$TRAVIS_BRANCH'." 22 | else 23 | echo "Deploying snapshot..." 24 | ./gradlew clean uploadArchives 25 | echo "Snapshot deployed!" 26 | fi 27 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/drawable/list_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 11 | 13 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /RELEASING.md: -------------------------------------------------------------------------------- 1 | Releasing 2 | ======== 3 | 4 | 1. Change the version in `gradle.properties` to a non-SNAPSHOT version. 5 | 2. Update the `CHANGELOG.md` for the impending release. 6 | 3. Update the `README.md` with the new version. 7 | 4. `git commit -am "Prepare for release X.Y.Z."` (where X.Y.Z is the new version) 8 | 5. `git tag -a X.Y.Z -m "Version X.Y.Z"` (where X.Y.Z is the new version) 9 | 6. `./gradlew clean uploadArchives` 10 | 7. Update the `gradle.properties` to the next SNAPSHOT version. 11 | 8. `git commit -am "Prepare next development version."` 12 | 9. `git push && git push --tags` 13 | 10. Visit [Sonatype Nexus](https://oss.sonatype.org/) and promote the artifact. 14 | 15 | If step 6 or 7 fails, drop the Sonatype repo, fix the problem, commit, and start again at step 5. 16 | 17 | 18 | Prerequisites 19 | ------------- 20 | 21 | In `~/.gradle/gradle.properties`, set the following: 22 | 23 | * `SONATYPE_NEXUS_USERNAME` - Sonatype username for releasing to `com.squareup`. 24 | * `SONATYPE_NEXUS_PASSWORD` - Sonatype password for releasing to `com.squareup`. 25 | -------------------------------------------------------------------------------- /picasso-sample/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | dependencies { 3 | classpath dep.androidPlugin 4 | } 5 | } 6 | 7 | apply plugin: 'com.android.application' 8 | 9 | dependencies { 10 | compile dep.supportV4 11 | compile dep.supportAnnotations 12 | compile project(':picasso') 13 | } 14 | 15 | android { 16 | compileSdkVersion 24 17 | buildToolsVersion "25.0.2" 18 | 19 | compileOptions { 20 | sourceCompatibility rootProject.ext.sourceCompatibilityVersion 21 | targetCompatibility rootProject.ext.targetCompatibilityVersion 22 | } 23 | 24 | lintOptions { 25 | lintConfig file('lint.xml') 26 | textOutput 'stdout' 27 | textReport true 28 | 29 | // https://github.com/square/okhttp/issues/896 30 | ignore 'InvalidPackage' 31 | } 32 | 33 | dexOptions { 34 | preDexLibraries = !rootProject.ext.isCi 35 | } 36 | 37 | defaultConfig { 38 | minSdkVersion 15 39 | targetSdkVersion 24 40 | applicationId 'com.example.picasso' 41 | 42 | versionCode 1 43 | versionName '1.0' 44 | } 45 | 46 | buildTypes { 47 | debug { 48 | applicationIdSuffix '.development' 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /picasso/src/test/java/com/squareup/picasso/MemoryPolicyTest.java: -------------------------------------------------------------------------------- 1 | package com.squareup.picasso; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.fest.assertions.api.Assertions.assertThat; 6 | 7 | public class MemoryPolicyTest { 8 | 9 | @Test public void dontReadFromMemoryCache() { 10 | int memoryPolicy = 0; 11 | memoryPolicy |= MemoryPolicy.NO_CACHE.index; 12 | assertThat(MemoryPolicy.shouldReadFromMemoryCache(memoryPolicy)).isFalse(); 13 | } 14 | 15 | @Test public void readFromMemoryCache() { 16 | int memoryPolicy = 0; 17 | memoryPolicy |= MemoryPolicy.NO_STORE.index; 18 | assertThat(MemoryPolicy.shouldReadFromMemoryCache(memoryPolicy)).isTrue(); 19 | } 20 | 21 | @Test public void dontWriteToMemoryCache() { 22 | int memoryPolicy = 0; 23 | memoryPolicy |= MemoryPolicy.NO_STORE.index; 24 | assertThat(MemoryPolicy.shouldWriteToMemoryCache(memoryPolicy)).isFalse(); 25 | } 26 | 27 | @Test public void writeToMemoryCache() { 28 | int memoryPolicy = 0; 29 | memoryPolicy |= MemoryPolicy.NO_CACHE.index; 30 | assertThat(MemoryPolicy.shouldWriteToMemoryCache(memoryPolicy)).isTrue(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /picasso/src/main/java/com/squareup/picasso/GetAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Square, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.squareup.picasso; 17 | 18 | import android.graphics.Bitmap; 19 | 20 | class GetAction extends Action { 21 | GetAction(Picasso picasso, Request data, int memoryPolicy, int networkPolicy, Object tag, 22 | String key) { 23 | super(picasso, null, data, memoryPolicy, networkPolicy, 0, null, key, tag, false); 24 | } 25 | 26 | @Override void complete(Bitmap result, Picasso.LoadedFrom from) { 27 | } 28 | 29 | @Override public void error(Exception e) { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /dependencies.gradle: -------------------------------------------------------------------------------- 1 | ext { 2 | compileSdkVersion = 25 3 | buildToolsVersion = '25.0.2' 4 | minSdkVersion = 14 5 | targetSdkVersion = 25 6 | sourceCompatibilityVersion = JavaVersion.VERSION_1_7 7 | targetCompatibilityVersion = JavaVersion.VERSION_1_7 8 | okhttpVersion = '3.0.1' 9 | supportLibrariesVersion = '25.1.0' 10 | 11 | dep = [ 12 | androidPlugin : 'com.android.tools.build:gradle:2.1.3', 13 | okhttp : "com.squareup.okhttp3:okhttp:$okhttpVersion", 14 | mockWebServer : "com.squareup.okhttp3:mockwebserver:$okhttpVersion", 15 | pollexor : 'com.squareup:pollexor:2.0.4', 16 | supportV4 : "com.android.support:support-v4:$supportLibrariesVersion", 17 | supportAnnotations : "com.android.support:support-annotations:$supportLibrariesVersion", 18 | junit : 'junit:junit:4.10', 19 | fest : 'org.easytesting:fest-assert-core:2.0M10', 20 | festAndroid : 'com.squareup:fest-android:1.0.6', 21 | robolectric : 'org.robolectric:robolectric:3.1', 22 | mockito : 'org.mockito:mockito-core:1.9.5' 23 | ] 24 | 25 | isCi = "true".equals(System.getenv('CI')) 26 | } 27 | -------------------------------------------------------------------------------- /website/static/app-theme.css: -------------------------------------------------------------------------------- 1 | /* http://www.colorhexa.com/b94948 */ 2 | 3 | /*** Primary ***/ 4 | 5 | header, 6 | #subtitle, 7 | a.dl { 8 | background-color: #b94948; 9 | } 10 | 11 | .content-nav li.active a, 12 | .content-nav li.active a:hover { 13 | border-left-color: #b94948; 14 | } 15 | 16 | /*** One step left on the monochromatic scale ***/ 17 | 18 | header menu li a:hover, 19 | a.dl:hover { 20 | background-color: #a74140; 21 | } 22 | a { 23 | color: #a74140; 24 | } 25 | 26 | /*** Three steps left on the monochromatic scale ***/ 27 | 28 | a:hover { 29 | color: #833332; 30 | } 31 | 32 | 33 | /****************************************************************\ 34 | **** Syntax highlighting styles ******************************** 35 | \****************************************************************/ 36 | 37 | .pln { color: #000; } 38 | .str { color: #953a39; } 39 | .kwd { color: #666; } 40 | .com { color: #953a39; } 41 | .typ { color: #222; } 42 | .lit { color: #953a39; } 43 | .pun { color: #888; } 44 | .opn { color: #888; } 45 | .clo { color: #888; } 46 | .tag { color: #953a39; } 47 | .atn { color: #606; } 48 | .atv { color: #080; } 49 | .dec { color: #606; } 50 | .var { color: #606; } 51 | .fun { color: #f00; } 52 | -------------------------------------------------------------------------------- /picasso/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | dependencies { 3 | classpath dep.androidPlugin 4 | } 5 | } 6 | 7 | apply plugin: 'com.android.library' 8 | apply plugin: 'com.github.dcendents.android-maven'//固定不变 9 | group='com.github.open-android'//itcastsh:github账号 10 | android { 11 | compileSdkVersion 24 12 | buildToolsVersion "25.0.2" 13 | 14 | compileOptions { 15 | sourceCompatibility rootProject.ext.sourceCompatibilityVersion 16 | targetCompatibility rootProject.ext.targetCompatibilityVersion 17 | } 18 | 19 | lintOptions { 20 | textOutput 'stdout' 21 | textReport true 22 | lintConfig file('lint.xml') 23 | } 24 | 25 | dexOptions { 26 | preDexLibraries = !rootProject.ext.isCi 27 | } 28 | 29 | defaultConfig { 30 | minSdkVersion 15 31 | 32 | consumerProguardFiles 'consumer-proguard-rules.txt' 33 | } 34 | } 35 | 36 | dependencies { 37 | compile dep.okhttp 38 | compile dep.supportAnnotations 39 | testCompile dep.junit 40 | testCompile dep.fest 41 | testCompile dep.festAndroid 42 | testCompile dep.supportV4 43 | testCompile dep.robolectric 44 | testCompile dep.mockito 45 | testCompile dep.mockWebServer 46 | } 47 | 48 | //apply from: rootProject.file('gradle/gradle-mvn-push.gradle') 49 | -------------------------------------------------------------------------------- /picasso/src/test/java/com/squareup/picasso/Shadows.java: -------------------------------------------------------------------------------- 1 | package com.squareup.picasso; 2 | 3 | import android.content.ContentResolver; 4 | import android.graphics.Bitmap; 5 | import android.graphics.BitmapFactory; 6 | import android.net.Network; 7 | import android.provider.MediaStore; 8 | import org.robolectric.annotation.Implementation; 9 | import org.robolectric.annotation.Implements; 10 | 11 | import static com.squareup.picasso.TestUtils.makeBitmap; 12 | 13 | final class Shadows { 14 | 15 | @Implements(MediaStore.Video.Thumbnails.class) 16 | public static class ShadowVideoThumbnails { 17 | 18 | @Implementation 19 | public static Bitmap getThumbnail(ContentResolver cr, long origId, int kind, 20 | BitmapFactory.Options options) { 21 | return makeBitmap(); 22 | } 23 | } 24 | 25 | @Implements(MediaStore.Images.Thumbnails.class) 26 | public static class ShadowImageThumbnails { 27 | 28 | @Implementation 29 | public static Bitmap getThumbnail(ContentResolver cr, long origId, int kind, 30 | BitmapFactory.Options options) { 31 | return makeBitmap(20, 20); 32 | } 33 | } 34 | 35 | /** 36 | * Here because https://github.com/robolectric/robolectric/issues/2223 37 | */ 38 | @Implements(Network.class) 39 | public static class ShadowNetwork { 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /picasso/src/test/java/com/squareup/picasso/TestTransformation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Square, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.squareup.picasso; 17 | 18 | import android.graphics.Bitmap; 19 | 20 | class TestTransformation implements Transformation { 21 | private final String key; 22 | private final Bitmap result; 23 | 24 | TestTransformation(String key) { 25 | this(key, Bitmap.createBitmap(10, 10, null)); 26 | } 27 | 28 | TestTransformation(String key, Bitmap result) { 29 | this.key = key; 30 | this.result = result; 31 | } 32 | 33 | @Override public Bitmap transform(Bitmap source) { 34 | source.recycle(); 35 | return result; 36 | } 37 | 38 | @Override public String key() { 39 | return key; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /picasso-sample/src/main/res/layout/sample_gallery_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 15 | 20 | 26 | 27 | 28 |