Java Code Examples for com.android.volley.toolbox.NetworkImageView#setLayoutParams()

The following examples show how to use com.android.volley.toolbox.NetworkImageView#setLayoutParams() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PreviewPhotoActivity.java    From TraceByAmap with MIT License 5 votes vote down vote up
@SuppressLint({ "NewApi", "InlinedApi" })
private void initListViews() {
	if (listViews == null) {
		listViews = new ArrayList<NetworkImageView>();
	}
	NetworkImageView img = new NetworkImageView(this);
	img.setBackgroundColor(0xff000000);// 黑色
	img.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
			LayoutParams.MATCH_PARENT));
	img.setScaleType(ScaleType.FIT_CENTER);// 图片填充方式
	listViews.add(img);// 添加view
}
 
Example 2
Source File: HorizontalImageRecyclerViewAdapter.java    From Netease with GNU General Public License v3.0 5 votes vote down vote up
ImageViewHolder(View view , int weight, int height, int i) {
    super(view);
    index = i;

    //第一张图不要边距
    if (index == 0) {
        RelativeLayout.LayoutParams rl = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.MATCH_PARENT);
        RelativeLayout rv = (RelativeLayout) view.findViewById(R.id.rlContainer);
        rl.setMargins(0, 0, 0, 0);
        rv.setLayoutParams(rl);
    }
    imageView = (NetworkImageView) view.findViewById(R.id.iv_sub_image);
    imageView.setLayoutParams(new RelativeLayout.LayoutParams(weight, height));
}