List of usage examples for android.widget LinearLayout.LayoutParams LinearLayout.LayoutParams
public LayoutParams(LayoutParams source)
From source file:com.liangxun.university.huanxin.chat.activity.ChatActivity.java
/** * ?//from w ww .j a va 2s . c o m */ private void Init_Point() { pointViews = new ArrayList<ImageView>(); ImageView imageView; for (int i = 0; i < views.size(); i++) { imageView = new ImageView(this); imageView.setBackgroundResource(R.drawable.d1); LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(new ViewGroup.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT)); layoutParams.leftMargin = 10; layoutParams.rightMargin = 10; layoutParams.width = 8; layoutParams.height = 8; layout_point.addView(imageView, layoutParams); // if (i == 0 || i == views.size() - 1) { // imageView.setVisibility(View.GONE); // } if (i == 0) { imageView.setBackgroundResource(R.drawable.d2); } pointViews.add(imageView); } }