Code example for RelativeLayout.LayoutParams

Methods: setMargins

0
	} 
	 
	public void addPiece(int l, int t) {
		this.l=l;
		this.t=t;
        RelativeLayout.LayoutParams a = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        a.setMargins(l,t,0,0);
		container.addView(this, a);
	} 
	 
	public void setPieceImage(char t, int s) {
		this.pieceType = t;
		this.pieceSide = s;
		this.setImageResource(
			( 
				t == 'o' 
				? (s == 0 ? R.drawable.o0 : R.drawable.o1) 
				: (s == 0 ? R.drawable.p0 : R.drawable.p1)
			) 
		); 
Connect your IDE to all the code out there  Get Codota for Java