コード例 #1
0
ファイル: BitmapUtils.java プロジェクト: 237602679/xUtils
  public void display(
      ImageView imageView, String uri, Bitmap loadingBitmap, CompressFormat compressFormat) {
    BitmapDisplayConfig displayConfig = displayConfigMap.get(String.valueOf(loadingBitmap));
    if (displayConfig == null) {
      displayConfig = globalConfig.getDefaultDisplayConfig();
      displayConfig.setLoadingBitmap(loadingBitmap);
      displayConfigMap.put(String.valueOf(loadingBitmap), displayConfig);
    }

    doDisplay(imageView, uri, displayConfig, compressFormat);
  }
コード例 #2
0
ファイル: BitmapUtils.java プロジェクト: 237602679/xUtils
  public void display(
      ImageView imageView,
      String uri,
      int imageWidth,
      int imageHeight,
      Bitmap loadingBitmap,
      Bitmap loadFailedBitmap,
      CompressFormat compressFormat) {
    BitmapDisplayConfig displayConfig =
        displayConfigMap.get(
            imageWidth
                + "_"
                + imageHeight
                + "_"
                + String.valueOf(loadingBitmap)
                + "_"
                + String.valueOf(loadFailedBitmap));
    if (displayConfig == null) {
      displayConfig = globalConfig.getDefaultDisplayConfig();
      displayConfig.setBitmapHeight(imageHeight);
      displayConfig.setBitmapWidth(imageWidth);
      displayConfig.setLoadingBitmap(loadingBitmap);
      displayConfig.setLoadFailedBitmap(loadFailedBitmap);
      displayConfigMap.put(
          imageWidth
              + "_"
              + imageHeight
              + "_"
              + String.valueOf(loadingBitmap)
              + "_"
              + String.valueOf(loadFailedBitmap),
          displayConfig);
    }

    doDisplay(imageView, uri, displayConfig, compressFormat);
  }