com.squareup.picasso.Picasso类的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中com.squareup.picasso.Picasso类的一些代码示例,展示了Picasso类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Picasso类的具体详情如下:
包路径:com.squareup.picasso.Picasso
类名称:Picasso

Picasso介绍

暂无

代码示例

代码示例来源:origin: pinguo-zhouwei/MZBannerView

@Override
  public void onBind(Context context, int i, Movie movie) {
    Log.e("zhouwei","current position:"+i);
    Picasso.with(context).load(movie.images.large).into(mImageView);
  }
}

代码示例来源:origin: lovetuzitong/MultiImageSelector

@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
  if (scrollState == SCROLL_STATE_FLING) {
    Picasso.with(view.getContext()).pauseTag(TAG);
  } else {
    Picasso.with(view.getContext()).resumeTag(TAG);
  }
}

代码示例来源:origin: siyamed/android-shape-imageview

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.fragment_list_sample, container, false);
  final Picasso picasso = Picasso.with(getActivity());
  picasso.setLoggingEnabled(true);
  picasso.setIndicatorsEnabled(false);
  int listLayout = getArguments().getInt(ARG_LAYOUT);
  final ListView listView = (ListView) view.findViewById(R.id.list);
  Adapter adapter = new Adapter(getActivity(), picasso, listLayout);
  listView.setAdapter(adapter);
  return view;
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
 public View getView(int position, View convertView, ViewGroup parent) {
  View row=super.getView(position, convertView, parent);
  Item item=getItem(position);
  ImageView icon=(ImageView)row.findViewById(R.id.icon);
  picasso.load(item.owner.profileImage)
      .fit().centerCrop()
      .placeholder(R.drawable.owner_placeholder)
      .error(R.drawable.owner_error).into(icon);
  TextView title=(TextView)row.findViewById(R.id.title);
  title.setText(Html.fromHtml(getItem(position).title));
  return(row);
 }
}

代码示例来源:origin: lyft/scissors

public static BitmapLoader createUsing(CropView cropView) {
  return createUsing(cropView, Picasso.with(cropView.getContext()));
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
 public View getView(int position, View convertView, ViewGroup parent) {
  View row=super.getView(position, convertView, parent);
  Item item=getItem(position);
  ImageView icon=(ImageView)row.findViewById(R.id.icon);
  picasso.load(item.owner.profileImage)
      .fit().centerCrop()
      .placeholder(R.drawable.owner_placeholder)
      .error(R.drawable.owner_error).into(icon);
  TextView title=(TextView)row.findViewById(R.id.title);
  title.setText(Html.fromHtml(getItem(position).title));
  return(row);
 }
}

代码示例来源:origin: siyamed/android-shape-imageview

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.fragment_chat_sample, container, false);
  final Picasso picasso = Picasso.with(getActivity());
  picasso.setLoggingEnabled(true);
  picasso.setIndicatorsEnabled(false);
  int listLayout1 = getArguments().getInt(ARG_LAYOUT_1);
  int listLayout2 = getArguments().getInt(ARG_LAYOUT_2);
  final ListView listView = (ListView) view.findViewById(R.id.list);
  Adapter adapter = new Adapter(getActivity(), picasso, listLayout1, listLayout2);
  listView.setAdapter(adapter);
  return view;
}

代码示例来源:origin: alibaba/Tangram-Android

@Override
  public <IMAGE extends ImageView> void doLoadImageUrl(@NonNull IMAGE view,
                             @Nullable String url) {
    Picasso.with(TangramDataParserActivity.this).load(url).into(view);
  }
}, ImageView.class);

代码示例来源:origin: alibaba/Tangram-Android

@Override
  public <IMAGE extends ImageView> void doLoadImageUrl(@NonNull IMAGE view,
    @Nullable String url) {
    Picasso.with(RxTangramActivity.this).load(url).into(view);
  }
}, ImageView.class);

代码示例来源:origin: chrisbanes/PhotoView

@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_simple);

    final PhotoView photoView = findViewById(R.id.iv_photo);

    Picasso.with(this)
        .load("http://pbs.twimg.com/media/Bist9mvIYAAeAyQ.jpg")
        .into(photoView);
  }
}

代码示例来源:origin: commonsguy/cw-omnibus

void setSlideContent(Uri slideUri) {
  Picasso.with(getContext()).load(slideUri).into(slide);
 }
}

代码示例来源:origin: iammert/MaterialIntroView

@Override
public void onBindViewHolder(RecyclerViewAdapter.ExampleViewHolder holder, int position) {
  Song song = songList.get(position);
  holder.coverName.setText(song.songName);
  holder.singerName.setText(song.singerName);
  Picasso.with(context).load(song.songArt).into(holder.coverIamge);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public Object instantiateItem(ViewGroup container, int position) {
 ImageView page=new ImageView(ctxt);
 ViewGroup.LayoutParams p=
  new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
   ViewGroup.LayoutParams.MATCH_PARENT);
 container.addView(page, p);
 Picasso.with(ctxt).load(getSlideImageUri(position)).into(page);
 return(page);
}

代码示例来源:origin: siyamed/android-shape-imageview

@Override
  public void run() {
    Picasso.with(getActivity()).load(Constants.IMAGES[0][0]).into(imageView);
  }
}, 3000);

代码示例来源:origin: alibaba/Tangram-Android

@Override
  public <IMAGE extends ImageView> void doLoadImageUrl(@NonNull IMAGE view,
                             @Nullable String url) {
    Picasso.with(Tangram3Activity.this.getApplicationContext()).load(url).into(view);
  }
}, ImageView.class);

代码示例来源:origin: jiangqqlmj/FastDev4Android

/**
 * Will download an image from a URL and put it in an ImageView.<br/>
 * It uses Square's Picasso library to download the image asynchronously and put the result into the ImageView.<br/>
 * Picasso manages recycling of views in a ListView.<br/>
 * If you need more control over the Picasso settings, use {BaseAdapterHelper#setImageBuilder}.
 * @param viewId   The view id.
 * @param imageUrl The image URL.
 * @return The BaseAdapterHelper for chaining.
 */
public BaseAdapterHelper setImageUrl(int viewId, String imageUrl) {
  ImageView view = retrieveView(viewId);
  Picasso.with(context).load(imageUrl).into(view);
  return this;
}

代码示例来源:origin: alibaba/Tangram-Android

@Override
  public <IMAGE extends ImageView> void doLoadImageUrl(@NonNull IMAGE view,
                             @Nullable String url) {
    Picasso.with(TangramActivity.this.getApplicationContext()).load(url).into(view);
  }
}, ImageView.class);

代码示例来源:origin: ivacf/archi

@BindingAdapter({"imageUrl"})
public static void loadImage(ImageView view, String imageUrl) {
  Picasso.with(view.getContext())
      .load(imageUrl)
      .placeholder(R.drawable.placeholder)
      .into(view);
}

代码示例来源:origin: zhihu/Matisse

@Override
public void loadImage(Context context, int resizeX, int resizeY, ImageView imageView, Uri uri) {
  Picasso.with(context).load(uri).resize(resizeX, resizeY).priority(Picasso.Priority.HIGH)
      .centerInside().into(imageView);
}

代码示例来源:origin: LyndonChin/MasteringAndroidDataBinding

@BindingAdapter({"imageUrl", "error"})
  public static void loadImage(ImageView view, String url, Drawable error) {
    Log.d(App.TAG, "load image");
    Picasso.with(view.getContext()).load(url).error(error).into(view);
  }
}

相关文章