Code example for RelativeLayout.LayoutParams

Methods: addRule

0
	} 
	 
	@Override 
	public void showCurrentPage(int pageIdx) {
		if (image != null){
			RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
			params.addRule(RelativeLayout.ALIGN_PARENT_LEFT,(pageIdx == 1)?RelativeLayout.TRUE:0);
			params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT,(pageIdx == 1)?0:RelativeLayout.TRUE);
			 
			image.setLayoutParams(params);
			Log.d("la-cuenta", 
			((RelativeLayout.LayoutParams)image.getLayoutParams()).debug("La cuenta image layout"));
		} 
	} 
 
} 
Experience pair programming with AI  Get Codota for Java