picasso源碼解析

picasso的使用非常簡(jiǎn)單

Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);

1.0 單例模式 生成一個(gè)Picasso對(duì)象

 public static Picasso with(Context context) {
    if (singleton == null) {
      synchronized (Picasso.class) {
        if (singleton == null) {
          singleton = new Builder(context).build();
        }
      }
    }
    return singleton;
  }

2.0 構(gòu)建Picasso對(duì)象時(shí)進(jìn)行初始化各個(gè)成員變量

public Picasso build() {
      Context context = this.context;
// 2.1 實(shí)現(xiàn)Downloader的接口,這個(gè)接口主要有以下抽象方法
// Response load(Uri uri, int networkPolicy) throws IOException;
// 此Response非OkHttp里面的Response序目,而是Downloader的內(nèi)部類塘幅,主要存儲(chǔ)了Bitmap,InputStream對(duì)象 圖片數(shù)據(jù)

      if (downloader == null) {
        downloader = Utils.createDefaultDownloader(context);
      }
// 2.2 內(nèi)存緩存途事,使用最近最少使用算法
      if (cache == null) {
        cache = new LruCache(context);
      }
// 2.3 構(gòu)建線程池
      if (service == null) {
        service = new PicassoExecutorService();
      }
// 2.4 對(duì)Request對(duì)象(非OkHttp里面的Request)進(jìn)行轉(zhuǎn)換接口访惜,默認(rèn)不做任何操作,給用戶自定義
      if (transformer == null) {
        transformer = RequestTransformer.IDENTITY;
      }
      
// 2.5 創(chuàng)建Stats對(duì)象主要用來(lái)統(tǒng)計(jì)的,日志記錄葛假。

      Stats stats = new Stats(cache);
// 2.6 創(chuàng)建Dispatcher對(duì)象
      Dispatcher dispatcher = new Dispatcher(context, service, HANDLER, downloader, cache, stats);
      
// 2.7 生成Picasso對(duì)象
      return new Picasso(context, dispatcher, cache, listener, transformer, requestHandlers, stats,
          defaultBitmapConfig, indicatorsEnabled, loggingEnabled);
    }

2.1.1 若有OkHttpClient類就使用OkHttp庫(kù)進(jìn)行網(wǎng)絡(luò)請(qǐng)求下載圖片,否則使用UrlConnection

  static Downloader createDefaultDownloader(Context context) {
    try {
      Class.forName("com.squareup.okhttp.OkHttpClient");
      return OkHttpLoaderCreator.create(context);
    } catch (ClassNotFoundException ignored) {
    }
    return new UrlConnectionDownloader(context);
  }

2.1.2 創(chuàng)建OkHttpDownloader對(duì)象滋恬,并設(shè)置硬盤緩存聊训,硬盤緩存大小為硬盤的50分之1 緩存大小為最大50M,最小5M.

  private static class OkHttpLoaderCreator {
    static Downloader create(Context context) {
      return new OkHttpDownloader(context);
    }
  }
  
public OkHttpDownloader(final Context context) {
    this(Utils.createDefaultCacheDir(context));
  }
  

static File createDefaultCacheDir(Context context) {
    File cache = new File(context.getApplicationContext().getCacheDir(), PICASSO_CACHE);
    if (!cache.exists()) {
      //noinspection ResultOfMethodCallIgnored
      cache.mkdirs();
    }
    return cache;
  }
public OkHttpDownloader(final File cacheDir) {
    this(cacheDir, Utils.calculateDiskCacheSize(cacheDir));
  }
  
  static long calculateDiskCacheSize(File dir) {
    long size = MIN_DISK_CACHE_SIZE;

    try {
      StatFs statFs = new StatFs(dir.getAbsolutePath());
      long available = ((long) statFs.getBlockCount()) * statFs.getBlockSize();
      // Target 2% of the total space.
      size = available / 50;
    } catch (IllegalArgumentException ignored) {
    }

    // Bound inside min/max size for disk cache.
    return Math.max(Math.min(size, MAX_DISK_CACHE_SIZE), MIN_DISK_CACHE_SIZE);
  }
  public OkHttpDownloader(final File cacheDir, final long maxSize) {
    this(defaultOkHttpClient());
    try {
      client.setCache(new com.squareup.okhttp.Cache(cacheDir, maxSize));
    } catch (IOException ignored) {
    }
  }

2.2.1 內(nèi)存緩存,大小為app最大使用內(nèi)存的7分之1

  public LruCache(Context context) {
    this(Utils.calculateMemoryCacheSize(context));
  }
  
 static int calculateMemoryCacheSize(Context context) {
    ActivityManager am = getService(context, ACTIVITY_SERVICE);
    boolean largeHeap = (context.getApplicationInfo().flags & FLAG_LARGE_HEAP) != 0;
    int memoryClass = am.getMemoryClass();
    if (largeHeap && SDK_INT >= HONEYCOMB) {
      memoryClass = ActivityManagerHoneycomb.getLargeMemoryClass(am);
    }
    // Target ~15% of the available heap.
    return 1024 * 1024 * memoryClass / 7;
  }

2.3.1 創(chuàng)建線程池

  PicassoExecutorService() {
    super(DEFAULT_THREAD_COUNT, DEFAULT_THREAD_COUNT, 0, TimeUnit.MILLISECONDS,
        new PriorityBlockingQueue<Runnable>(), new Utils.PicassoThreadFactory());
  }

2.4.1. 默認(rèn)不做任何操作恢氯,用戶可自定義

    RequestTransformer IDENTITY = new RequestTransformer() {
      @Override public Request transformRequest(Request request) {
        return request;
      }
    };
  }

2.5.1.創(chuàng)建一個(gè)后臺(tái)線程带斑,進(jìn)行記錄Picasso運(yùn)行狀態(tài)

  Stats(Cache cache) {
    this.cache = cache;
    this.statsThread = new HandlerThread(STATS_THREAD_NAME, THREAD_PRIORITY_BACKGROUND);
    this.statsThread.start();
    Utils.flushStackLocalLeaks(statsThread.getLooper());
    this.handler = new StatsHandler(statsThread.getLooper(), this);
  }

2.6.1 創(chuàng)建Dispatcher對(duì)象

  Dispatcher(Context context, ExecutorService service, Handler mainThreadHandler,
      Downloader downloader, Cache cache, Stats stats) {
...
    this.handler = new DispatcherHandler(dispatcherThread.getLooper(), this);
    this.downloader = downloader;
    this.mainThreadHandler = mainThreadHandler;
...
  }

2.7.1 創(chuàng)建7個(gè)RequestHandler 處理不同數(shù)據(jù)來(lái)源的生成Result包含Bitmap,InputStream對(duì)象

RequestHandler是一個(gè)抽象類 抽象方法如下

public abstract Result load(Request request, int networkPolicy) throws IOException;
 public abstract boolean canHandleRequest(Request data);

這7個(gè)RequestHandler勋拟,除ResourceRequestHandler大多用Request的Uri對(duì)象進(jìn)行區(qū)分勋磕,我們也可以實(shí)現(xiàn)以上抽象方法自定義自己的RequestHandler進(jìn)行擴(kuò)展,以便處理這7個(gè)以外的特殊圖片數(shù)據(jù)來(lái)源

Picasso(Context context, Dispatcher dispatcher, Cache cache, Listener listener,
      RequestTransformer requestTransformer, List<RequestHandler> extraRequestHandlers, Stats stats,
      Bitmap.Config defaultBitmapConfig, boolean indicatorsEnabled, boolean loggingEnabled) {
...

    int builtInHandlers = 7; // Adjust this as internal handlers are added or removed.
    int extraCount = (extraRequestHandlers != null ? extraRequestHandlers.size() : 0);
    List<RequestHandler> allRequestHandlers =
        new ArrayList<RequestHandler>(builtInHandlers + extraCount);

    allRequestHandlers.add(new ResourceRequestHandler(context));
    if (extraRequestHandlers != null) {
      allRequestHandlers.addAll(extraRequestHandlers);
    }
    allRequestHandlers.add(new ContactsPhotoRequestHandler(context));
    allRequestHandlers.add(new MediaStoreRequestHandler(context));
    allRequestHandlers.add(new ContentStreamRequestHandler(context));
    allRequestHandlers.add(new AssetRequestHandler(context));
    allRequestHandlers.add(new FileRequestHandler(context));
    allRequestHandlers.add(new NetworkRequestHandler(dispatcher.downloader, stats));
    requestHandlers = Collections.unmodifiableList(allRequestHandlers);
...
  }

以上就是第一次調(diào)用with方法所做的操作

3.0. load方法

創(chuàng)建RequestCreator對(duì)象敢靡,配置好uri挂滓,resourceId;若是從網(wǎng)絡(luò)中讀取圖片,resourceId為0

  public RequestCreator load(String path) {
    if (path == null) {
      return new RequestCreator(this, null, 0);
    }
    if (path.trim().length() == 0) {
      throw new IllegalArgumentException("Path must not be empty.");
    }
    // 
    return load(Uri.parse(path));
  }
  
  public RequestCreator load(Uri uri) {
  
  // 
    return new RequestCreator(this, uri, 0);
  }
  
  
 RequestCreator(Picasso picasso, Uri uri, int resourceId) {
    if (picasso.shutdown) {
      throw new IllegalStateException(
          "Picasso instance already shut down. Cannot submit new requests.");
    }
    this.picasso = picasso;
// 
    this.data = new Request.Builder(uri, resourceId, picasso.defaultBitmapConfig);
  }
 // 

  Builder(Uri uri, int resourceId, Bitmap.Config bitmapConfig) {
      this.uri = uri;
      this.resourceId = resourceId;
      this.config = bitmapConfig;
    }

4. into 方法

4.1. 圖片綁定到ImageView

  public void into(ImageView target) {
    into(target, null);
  }

4.2 into方法的解析

public void into(ImageView target, Callback callback) {
    long started = System.nanoTime();
    // 檢查是否是在主線程中操作UI
    checkMain();

    if (target == null) {
      throw new IllegalArgumentException("Target must not be null.");
    }
// 是否設(shè)置了uri,或者resourceId醋安,在load方法已經(jīng)設(shè)置了uri杂彭,為false不執(zhí)行
    if (!data.hasImage()) {
      picasso.cancelRequest(target);
      if (setPlaceholder) {
        setPlaceholder(target, getPlaceholderDrawable());
      }
      return;
    }
// deferred 默認(rèn)為false,不執(zhí)行。除非調(diào)用了fit()方法
    if (deferred) {
      if (data.hasSize()) {
        throw new IllegalStateException("Fit cannot be used with resize.");
      }
      int width = target.getWidth();
      int height = target.getHeight();
      if (width == 0 || height == 0) {
        if (setPlaceholder) {
          setPlaceholder(target, getPlaceholderDrawable());
        }
        picasso.defer(target, new DeferredRequestCreator(this, target, callback));
        return;
      }
      data.resize(width, height);
    }

// 4.2.1
    Request request = createRequest(started);
    
// 根據(jù)Request的特性生成獨(dú)一無(wú)二的requestKey
    String requestKey = createKey(request);

// 4.2.2 若未設(shè)置memoryPolicy 此為ture
    if (shouldReadFromMemoryCache(memoryPolicy)) {
    // 通過(guò)requestKey從內(nèi)存緩存中獲取吓揪,第一次網(wǎng)絡(luò)請(qǐng)求未存儲(chǔ)獲取不到亲怠,bitmap為null
      Bitmap bitmap = picasso.quickMemoryCacheCheck(requestKey);
      if (bitmap != null) {
        picasso.cancelRequest(target);
        setBitmap(target, picasso.context, bitmap, MEMORY, noFade, picasso.indicatorsEnabled);
...
        if (callback != null) {
          callback.onSuccess();
        }
        return;
      }
    }
// 設(shè)置Placeholder,若未Placeholder顯示空白,等待下載圖片時(shí) 的替代圖片顯示到ImageView
    if (setPlaceholder) {
      setPlaceholder(target, getPlaceholderDrawable());
    }
// 4.2.3 
    Action action =
        new ImageViewAction(picasso, target, request, memoryPolicy, networkPolicy, errorResId,
            errorDrawable, requestKey, tag, callback, noFade);
// 4.2.4
    picasso.enqueueAndSubmit(action);
  }

4.2.1 生成Request對(duì)象

  private Request createRequest(long started) {
   // 生成獨(dú)一無(wú)二的ID
    int id = nextId.getAndIncrement();
  // 3.3 生成的Request.Builder
    Request request = data.build();
    request.id = id;
    request.started = started;

    boolean loggingEnabled = picasso.loggingEnabled;
    if (loggingEnabled) {
      log(OWNER_MAIN, VERB_CREATED, request.plainId(), request.toString());
    }
//  參考2.4 RequestTransformer對(duì)象進(jìn)行轉(zhuǎn)換處理Request柠辞,id和started開始時(shí)間不變
    Request transformed = picasso.transformRequest(request);
    if (transformed != request) {
      // If the request was changed, copy over the id and timestamp from the original.
      transformed.id = id;
      transformed.started = started;

      if (loggingEnabled) {
        log(OWNER_MAIN, VERB_CHANGED, transformed.logId(), "into " + transformed);
      }
    }

    return transformed;
  }

4.2.2 獲取存儲(chǔ)策略

  /** Skips memory cache lookup when processing a request. */
  NO_CACHE(1 << 0),
  /**
   * Skips storing the final result into memory cache. Useful for one-off requests
   * to avoid evicting other bitmaps from the cache.
   */
  NO_STORE(1 << 1);

  static boolean shouldReadFromMemoryCache(int memoryPolicy) {
    return (memoryPolicy & MemoryPolicy.NO_CACHE.index) == 0;
  }

  static boolean shouldWriteToMemoryCache(int memoryPolicy) {
    return (memoryPolicy & MemoryPolicy.NO_STORE.index) == 0;
  }

4.2.3 創(chuàng)建ImageViewAction對(duì)象

  ImageViewAction(Picasso picasso, ImageView imageView, Request data, int memoryPolicy,
      int networkPolicy, int errorResId, Drawable errorDrawable, String key, Object tag,
      Callback callback, boolean noFade) {
    super(picasso, imageView, data, memoryPolicy, networkPolicy, errorResId, errorDrawable, key,
        tag, noFade);
    this.callback = callback;
  }

4.2.4 調(diào)用enqueueAndSubmit方法

  void enqueueAndSubmit(Action action) {
    Object target = action.getTarget();
    if (target != null && targetToAction.get(target) != action) {
      // This will also check we are on the main thread.
      cancelExistingRequest(target);
      targetToAction.put(target, action);
    }
    submit(action);
  }
  
    void submit(Action action) {
    dispatcher.dispatchSubmit(action);
  }
  
    void dispatchSubmit(Action action) {
    handler.sendMessage(handler.obtainMessage(REQUEST_SUBMIT, action));
  }
  
      @Override public void handleMessage(final Message msg) {
      switch (msg.what) {
        case REQUEST_SUBMIT: {
          Action action = (Action) msg.obj;
          dispatcher.performSubmit(action);
          break;
        }
        
  void performSubmit(Action action) {
    performSubmit(action, true);
  }
  
  void performSubmit(Action action, boolean dismissFailed) {
  // pausedTags暫停對(duì)象集合 若是Action設(shè)置了tag 同一個(gè)對(duì)象就會(huì)暫停執(zhí)行
    if (pausedTags.contains(action.getTag())) {
      pausedActions.put(action.getTarget(), action);
...
...
      return;
    }
// hunterMap若是存儲(chǔ)了BitmapHunter對(duì)象就不用生成BitmapHunter团秽,第一次未存儲(chǔ)未null
    BitmapHunter hunter = hunterMap.get(action.getKey());
    if (hunter != null) {
      hunter.attach(action);
      return;
    }

    if (service.isShutdown()) {
...
...
      return;
    }
// 4.2.4.1
    hunter = forRequest(action.getPicasso(), this, cache, stats, action);
// 4.2.4.2
// 添加到線程池會(huì)執(zhí)行BitmapHunter的 run()方法
    hunter.future = service.submit(hunter);
// 放入hunterMap,下次就可直接使用
    hunterMap.put(action.getKey(), hunter);
// 若是之前失敗過(guò),移除掉失敗的ImageView的對(duì)應(yīng)的BitmapHunter對(duì)象
    if (dismissFailed) {
      failedActions.remove(action.getTarget());
    }
...
...
  }

4.2.4.1 構(gòu)建BitmapHunter對(duì)象

  static BitmapHunter forRequest(Picasso picasso, Dispatcher dispatcher, Cache cache, Stats stats,
      Action action) {
    Request request = action.getRequest();
    List<RequestHandler> requestHandlers = picasso.getRequestHandlers();

    for (int i = 0, count = requestHandlers.size(); i < count; i++) {
      RequestHandler requestHandler = requestHandlers.get(i);
// 參考 2.7.1設(shè)置的7個(gè)RequestHandler 
// 每個(gè)RequestHandler都實(shí)現(xiàn)了canHandleRequest习勤,判斷處理不同的圖片數(shù)據(jù)源
// 我們?cè)O(shè)置的是通過(guò) NetworkRequestHandler處理
      if (requestHandler.canHandleRequest(request)) {
        return new BitmapHunter(picasso, dispatcher, cache, stats, action, requestHandler);
      }
    }

    return new BitmapHunter(picasso, dispatcher, cache, stats, action, ERRORING_HANDLER);
  }
  


    BitmapHunter(Picasso picasso, Dispatcher dispatcher, Cache cache, Stats stats, Action action,
      RequestHandler requestHandler) {
    this.sequence = SEQUENCE_GENERATOR.incrementAndGet();
    this.picasso = picasso;
    this.dispatcher = dispatcher;
    this.cache = cache;
    this.stats = stats;
    this.action = action;
    this.key = action.getKey();
    this.data = action.getRequest();
    this.priority = action.getPriority();
    this.memoryPolicy = action.getMemoryPolicy();
    this.networkPolicy = action.getNetworkPolicy();
    this.requestHandler = requestHandler;
    this.retryCount = requestHandler.getRetryCount();
  }
  
 

4.2.4.2 添加到線程池會(huì)執(zhí)行BitmapHunter的 run()方法

 
 @Override public void run() {
    try {
...
    // 4.2.4.2.1
      result = hunt();
      if (result == null) {
        dispatcher.dispatchFailed(this);
      } else {
    // 4.2.4.2.2
        dispatcher.dispatchComplete(this);
      }
...

  }

4.2.4.2.1 hunt方法解析

  Bitmap hunt() throws IOException {
    Bitmap bitmap = null;
 //  從內(nèi)存緩存中獲取踪栋,第一次未緩存bitmap為null
    if (shouldReadFromMemoryCache(memoryPolicy)) {
      bitmap = cache.get(key);
      if (bitmap != null) {
...
        return bitmap;
      }
    }
//  NetworkRequestHandler設(shè)置的retryCount為2 
    data.networkPolicy = retryCount == 0 ? NetworkPolicy.OFFLINE.index : networkPolicy;
// 4.2.4.2.1.1
    RequestHandler.Result result = requestHandler.load(data, networkPolicy);
    if (result != null) {
      loadedFrom = result.getLoadedFrom();
      exifRotation = result.getExifOrientation();

      bitmap = result.getBitmap();

    
      //okhttp下載,bitmap==null,從流中加載生成bitmap
      if (bitmap == null) {
        InputStream is = result.getStream();
        try {
          bitmap = decodeStream(is, data);
        } finally {
          Utils.closeQuietly(is);
        }
      }
    }

    if (bitmap != null) {
...
    // RequestCreator并未設(shè)置平移或者旋轉(zhuǎn)图毕,此為false
      if (data.needsTransformation() || exifRotation != 0) {
        synchronized (DECODE_LOCK) {
          if (data.needsMatrixTransform() || exifRotation != 0) {
            bitmap = transformResult(data, bitmap, exifRotation);
...
          }
          if (data.hasCustomTransformations()) {
            bitmap = applyCustomTransformations(data.transformations, bitmap);
...
          }
        }
...
      }
    }

    return bitmap;
  }
4.2.4.2.1.1 load方法解析
  @Override public Result load(Request request, int networkPolicy) throws IOException {
// 利用OkHttpDownloader下載圖片夷都,參看2.1 及OKHttp的使用
    Response response = downloader.load(request.uri, request.networkPolicy);
    if (response == null) {
      return null;
    }

    Picasso.LoadedFrom loadedFrom = response.cached ? DISK : NETWORK;

    Bitmap bitmap = response.getBitmap();
    if (bitmap != null) {
      return new Result(bitmap, loadedFrom);
    }

    InputStream is = response.getInputStream();
    if (is == null) {
      return null;
    }
...
    return new Result(is, loadedFrom);
  }
4.2.4.2.2 完成Bitmap加載到ImageView
    // 參看2.6.1 此handler為DispatcherHandler會(huì)發(fā)送消息到為主線程處理
  void dispatchComplete(BitmapHunter hunter) {
    handler.sendMessage(handler.obtainMessage(HUNTER_COMPLETE, hunter));
  }
  
     case HUNTER_COMPLETE: {
          BitmapHunter hunter = (BitmapHunter) msg.obj;
          //
          dispatcher.performComplete(hunter);
          break;
        }
        
  void performComplete(BitmapHunter hunter) {
  // 根據(jù)MemoryPolicy會(huì)把下載好的圖片放入到內(nèi)存緩存當(dāng)中
    if (shouldWriteToMemoryCache(hunter.getMemoryPolicy())) {
      cache.set(hunter.getKey(), hunter.getResult());
    }
    hunterMap.remove(hunter.getKey());
    // 
    batch(hunter);
 ...
  }
  
    private void batch(BitmapHunter hunter) {
    if (hunter.isCancelled()) {
      return;
    }
    batch.add(hunter);
    if (!handler.hasMessages(HUNTER_DELAY_NEXT_BATCH)) {
    //
      handler.sendEmptyMessageDelayed(HUNTER_DELAY_NEXT_BATCH, BATCH_DELAY);
    }
  }
  
    case HUNTER_DELAY_NEXT_BATCH: {
    //
          dispatcher.performBatchComplete();
          break;
        }
        
  void performBatchComplete() {
    List<BitmapHunter> copy = new ArrayList<BitmapHunter>(batch);
    batch.clear();
    // 
    mainThreadHandler.sendMessage(mainThreadHandler.obtainMessage(HUNTER_BATCH_COMPLETE, copy));
    logBatch(copy);
  }
  
  
  case HUNTER_BATCH_COMPLETE: {
          @SuppressWarnings("unchecked") List<BitmapHunter> batch = (List<BitmapHunter>) msg.obj;
          //noinspection ForLoopReplaceableByForEach
          for (int i = 0, n = batch.size(); i < n; i++) {
            BitmapHunter hunter = batch.get(i);
            // 
            hunter.picasso.complete(hunter);
          }
          break;
        }
        
 void complete(BitmapHunter hunter) {
    Action single = hunter.getAction();
...

    if (single != null) {
    //
      deliverAction(result, from, single);
    }

...
  }
  
    private void deliverAction(Bitmap result, LoadedFrom from, Action action) {
...
//
      action.complete(result, from);
...
  }
  
  
    @Override public void complete(Bitmap result, Picasso.LoadedFrom from) {
...
    ImageView target = this.target.get();
    if (target == null) {
      return;
    }
    Context context = picasso.context;
    boolean indicatorsEnabled = picasso.indicatorsEnabled;
    //
    PicassoDrawable.setBitmap(target, context, result, from, noFade, indicatorsEnabled);
...
  }
  
  
    static void setBitmap(ImageView target, Context context, Bitmap bitmap,
      Picasso.LoadedFrom loadedFrom, boolean noFade, boolean debugging) {
...
    PicassoDrawable drawable =
        new PicassoDrawable(context, bitmap, placeholder, loadedFrom, noFade, debugging);
    // 終于看到了我們熟悉的ImageView.setImageDrawable()方法設(shè)置圖片
    target.setImageDrawable(drawable);
  }
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市予颤,隨后出現(xiàn)的幾起案子囤官,更是在濱河造成了極大的恐慌,老刑警劉巖蛤虐,帶你破解...
    沈念sama閱讀 207,113評(píng)論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件党饮,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡驳庭,警方通過(guò)查閱死者的電腦和手機(jī)刑顺,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,644評(píng)論 2 381
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)饲常,“玉大人蹲堂,你說(shuō)我怎么就攤上這事〔唤裕” “怎么了贯城?”我有些...
    開封第一講書人閱讀 153,340評(píng)論 0 344
  • 文/不壞的土叔 我叫張陵熊楼,是天一觀的道長(zhǎng)霹娄。 經(jīng)常有香客問(wèn)我,道長(zhǎng)鲫骗,這世上最難降的妖魔是什么犬耻? 我笑而不...
    開封第一講書人閱讀 55,449評(píng)論 1 279
  • 正文 為了忘掉前任,我火速辦了婚禮执泰,結(jié)果婚禮上枕磁,老公的妹妹穿的比我還像新娘。我一直安慰自己术吝,他們只是感情好计济,可當(dāng)我...
    茶點(diǎn)故事閱讀 64,445評(píng)論 5 374
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著排苍,像睡著了一般沦寂。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上淘衙,一...
    開封第一講書人閱讀 49,166評(píng)論 1 284
  • 那天传藏,我揣著相機(jī)與錄音,去河邊找鬼。 笑死毯侦,一個(gè)胖子當(dāng)著我的面吹牛哭靖,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播侈离,決...
    沈念sama閱讀 38,442評(píng)論 3 401
  • 文/蒼蘭香墨 我猛地睜開眼试幽,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了卦碾?” 一聲冷哼從身側(cè)響起抡草,我...
    開封第一講書人閱讀 37,105評(píng)論 0 261
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎蔗坯,沒(méi)想到半個(gè)月后康震,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 43,601評(píng)論 1 300
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡宾濒,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,066評(píng)論 2 325
  • 正文 我和宋清朗相戀三年腿短,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片绘梦。...
    茶點(diǎn)故事閱讀 38,161評(píng)論 1 334
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡橘忱,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出卸奉,到底是詐尸還是另有隱情钝诚,我是刑警寧澤,帶...
    沈念sama閱讀 33,792評(píng)論 4 323
  • 正文 年R本政府宣布榄棵,位于F島的核電站凝颇,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏疹鳄。R本人自食惡果不足惜拧略,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,351評(píng)論 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望瘪弓。 院中可真熱鬧垫蛆,春花似錦、人聲如沸腺怯。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,352評(píng)論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)呛占。三九已至虑乖,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間栓票,已是汗流浹背决左。 一陣腳步聲響...
    開封第一講書人閱讀 31,584評(píng)論 1 261
  • 我被黑心中介騙來(lái)泰國(guó)打工愕够, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人佛猛。 一個(gè)月前我還...
    沈念sama閱讀 45,618評(píng)論 2 355
  • 正文 我出身青樓惑芭,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親继找。 傳聞我的和親對(duì)象是個(gè)殘疾皇子遂跟,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 42,916評(píng)論 2 344

推薦閱讀更多精彩內(nèi)容

  • 一. 概述 Picasso是Square出品的一個(gè)非常精簡(jiǎn)的圖片加載及緩存庫(kù),其主要特點(diǎn)包括: 易寫易讀的流式編程...
    SparkInLee閱讀 1,079評(píng)論 2 11
  • Picasso婴渡,看的版本是v.2.5.2 使用方法幻锁,大概這么幾種加載資源的形式 還可以對(duì)圖片進(jìn)行一些操作:設(shè)置大小...
    Jinjins1129閱讀 342評(píng)論 0 3
  • *面試心聲:其實(shí)這些題本人都沒(méi)怎么背,但是在上海 兩周半 面了大約10家 收到差不多3個(gè)offer,總結(jié)起來(lái)就是把...
    Dove_iOS閱讀 27,125評(píng)論 29 470
  • 前一篇文章講了Picasso的詳細(xì)用法,Picasso 是一個(gè)強(qiáng)大的圖片加載緩存框架边臼,一個(gè)非常優(yōu)秀的開源庫(kù)哄尔,學(xué)習(xí)一...
    依然范特稀西閱讀 4,596評(píng)論 13 24
  • 金星閃閃亮薰香惹神醉中樞忘卻塵思緒橫跨十萬(wàn)八千里醉在當(dāng)下悠悠然淡看風(fēng)云與世不爭(zhēng)讀圣賢修心律身別人笑我癡我笑世人癲看...
    蔣光頭jL94430閱讀 308評(píng)論 23 43