diff -r 000000000000 -r 6474c204b198 mobile/android/thirdparty/com/squareup/picasso/Picasso.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mobile/android/thirdparty/com/squareup/picasso/Picasso.java Wed Dec 31 06:09:35 2014 +0100
@@ -0,0 +1,522 @@
+/*
+ * Copyright (C) 2013 Square, Inc.
+ *
+ * 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.squareup.picasso;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.Color;
+import android.net.Uri;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.os.Process;
+import android.widget.ImageView;
+import java.io.File;
+import java.lang.ref.ReferenceQueue;
+import java.util.List;
+import java.util.Map;
+import java.util.WeakHashMap;
+import java.util.concurrent.ExecutorService;
+
+import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
+import static com.squareup.picasso.Action.RequestWeakReference;
+import static com.squareup.picasso.Dispatcher.HUNTER_BATCH_COMPLETE;
+import static com.squareup.picasso.Dispatcher.REQUEST_GCED;
+import static com.squareup.picasso.Utils.THREAD_PREFIX;
+
+/**
+ * Image downloading, transformation, and caching manager.
+ *
+ * Use {@link #with(android.content.Context)} for the global singleton instance or construct your
+ * own instance with {@link Builder}.
+ */
+public class Picasso {
+
+ /** Callbacks for Picasso events. */
+ public interface Listener {
+ /**
+ * Invoked when an image has failed to load. This is useful for reporting image failures to a
+ * remote analytics service, for example.
+ */
+ void onImageLoadFailed(Picasso picasso, Uri uri, Exception exception);
+ }
+
+ /**
+ * A transformer that is called immediately before every request is submitted. This can be used to
+ * modify any information about a request.
+ *
+ * For example, if you use a CDN you can change the hostname for the image based on the current
+ * location of the user in order to get faster download speeds.
+ *
+ * NOTE: This is a beta feature. The API is subject to change in a backwards incompatible
+ * way at any time.
+ */
+ public interface RequestTransformer {
+ /**
+ * Transform a request before it is submitted to be processed.
+ *
+ * @return The original request or a new request to replace it. Must not be null.
+ */
+ Request transformRequest(Request request);
+
+ /** A {@link RequestTransformer} which returns the original request. */
+ RequestTransformer IDENTITY = new RequestTransformer() {
+ @Override public Request transformRequest(Request request) {
+ return request;
+ }
+ };
+ }
+
+ static final Handler HANDLER = new Handler(Looper.getMainLooper()) {
+ @Override public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case HUNTER_BATCH_COMPLETE: {
+ @SuppressWarnings("unchecked") List batch = (List) msg.obj;
+ for (BitmapHunter hunter : batch) {
+ hunter.picasso.complete(hunter);
+ }
+ break;
+ }
+ case REQUEST_GCED: {
+ Action action = (Action) msg.obj;
+ action.picasso.cancelExistingRequest(action.getTarget());
+ break;
+ }
+ default:
+ throw new AssertionError("Unknown handler message received: " + msg.what);
+ }
+ }
+ };
+
+ static Picasso singleton = null;
+
+ private final Listener listener;
+ private final RequestTransformer requestTransformer;
+ private final CleanupThread cleanupThread;
+
+ final Context context;
+ final Dispatcher dispatcher;
+ final Cache cache;
+ final Stats stats;
+ final Map