Code example for LinearLayout

Methods: setPaddingaddViewsetOrientation

0
	} 
 
	@Override 
	protected View onCreateDialogView() {
		LinearLayout.LayoutParams params;
		final LinearLayout layout = new LinearLayout(context);
		layout.setOrientation(LinearLayout.VERTICAL);
		layout.setPadding(6, 6, 6, 6);
 
		dialogTextView = new TextView(context);
		if (dialogText != null) {
			dialogTextView.setText(dialogText);
		} 
		layout.addView(dialogTextView);
 
		valueTextView = new TextView(context);
		valueTextView.setGravity(Gravity.CENTER_HORIZONTAL);
		valueTextView.setTextSize(32);
		params = new LinearLayout.LayoutParams(
				LinearLayout.LayoutParams.FILL_PARENT,
				LinearLayout.LayoutParams.WRAP_CONTENT);
		layout.addView(valueTextView, params);
 
		seekBar = new SeekBar(context);
		seekBar.setOnSeekBarChangeListener(this);
		layout.addView(seekBar, new LinearLayout.LayoutParams(
				LinearLayout.LayoutParams.FILL_PARENT,
				LinearLayout.LayoutParams.WRAP_CONTENT));
 
		if (shouldPersist()) { 
			value = getPersistedInt(defaultValue);
Experience pair programming with AI  Get Codota for Java