Code example for RelativeLayout.LayoutParams

Methods: addRule

0
	bar.setProgress(fps);
	bar.setLayoutParams(barLayout);
	bar.setId(7778); //another random id
	bar.setOnSeekBarChangeListener(this);//set up scrolling detection
	//fps box 
	RelativeLayout.LayoutParams fpsBoxLayout = new RelativeLayout
	    .LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT,
			   RelativeLayout.LayoutParams.WRAP_CONTENT );
	fpsBoxLayout.addRule(RelativeLayout.BELOW,bar.getId());
	fpsBoxLayout.addRule(RelativeLayout.CENTER_HORIZONTAL);
	fpsBox = new TextView(getContext());
	fpsBox.setTextSize(TypedValue.COMPLEX_UNIT_SP,18);
	fpsBox.setText(bar.getProgress()+" fps");
	fpsBox.setLayoutParams(fpsBoxLayout);
	//add views to layout 
	layout.addView(titleView);
	layout.addView(bar);
	layout.addView(fpsBox);
	//layout.setId(android.R.id.preference_slider); 
	//setup shared preferences 
Stop searching for code, let great code find you!  Add Codota to your java IDE