1override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
2 val view = LayoutInflater.from(context).inflate(R.layout.row, parent, false);
3 view.layoutParams = ViewGroup.LayoutParams((parent.width * 0.5).toInt(),ViewGroup.LayoutParams.MATCH_PARENT)
4 return ViewHolder(view);
5 }
1 @Override
2 public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
3 View v = LayoutInflater.from(parent.getContext())
4 .inflate(R.layout.design_item, parent, false);
5 v.setLayoutParams(new ViewGroup.LayoutParams((int) (parent.getWidth() * 0.5),ViewGroup.LayoutParams.MATCH_PARENT));
6
7 return new ViewHolder(v);
8 }