ScrollView setFillViewport - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ScrollView setFillViewport method.

This code example shows how to use the following methods:setBackgroundColor, setLayoutParams, setScrollContainer, addView, setFillViewport
7
CodeRank
This code example shows how to use the following methods:setLayoutParams, addView, setFillViewport
				actionLayoutView = container.getBean("actionDetailLayoutView", bundleKeys);
				 
				LayoutParams scrollViewLayout = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT);
				LayoutParams childViewLayout = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT);
				 
				ScrollView scrollView = new ScrollView(getContext());
				scrollView.setFillViewport(true);
				scrollView.setLayoutParams(scrollViewLayout);
				scrollView.addView(actionLayoutView, childViewLayout);	
				 
				LinearLayout layout = new LinearLayout(getContext());
				LayoutParams masterParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT);
				 
				layout.setLayoutParams(masterParams);
				layout.setBackgroundDrawable(((Drawables)container.getBean("drawables")).getDrawable("slate.png", true, true, true));
				 
				layout.addView(scrollView);
				 
				view = layout;
			} 
7
CodeRank
This code example shows how to use the following methods:addView, setFillViewport
	public final static String KEY_SUBJECTS = "subjects";
 
	@Override 
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ScrollView scroll = new ScrollView(this);
		scroll.setFillViewport(true);
		ZoomView zv = new ZoomView(this);
 
		zv.addView(new TimeTableView(this, (Subject[]) arrayFromJson(
				KEY_SUBJECTS, Subject[].class)));
		scroll.addView(zv);
 
		setContentView(scroll);
 
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:addView, setFillViewport
	private ScrollView scrollView;
	 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        scrollView = new ScrollView(this);
        scrollView.setFillViewport(true);
		try { 
			scoreView = new ScoreView(this, retrieveOrCreateScore());
		} catch (RecordNotFoundException e) {
			// TODO: What should happen here? Can't find the score in the database. Display error 
		} 
		scrollView.addView(scoreView);
		setContentView(scrollView);
        scoreView.requestFocus();
	} 
	 
	private Score retrieveOrCreateScore() throws RecordNotFoundException { 
		Bundle extras = getIntent().getExtras();
        Integer scoreId = (extras != null) ? extras.getInt(Constants.SCORE_ID) : null;
5
CodeRank
This code example shows how to use the following methods:addView, setFillViewport
					LayoutParams.WRAP_CONTENT));
		} 
		android.widget.LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
				LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
		if (this.needScrollView()) {
			ScrollView scrollView = new ScrollView(context);
			scrollView.setFillViewport(true);
			scrollView.addView(this.createContents());
			params.weight = 2;
			layout.addView(scrollView, params);
		} else { 
			layout.addView(this.createContents(), params);
		} 
		this.setContentView(layout);
	} 
 
	protected void performCancel() { 
		this.dismiss();
	} 
 
5
CodeRank

Related ScrollView setFillViewport Questions & Answers:

setFillViewport Method Overview
Indicates this ScrollView whether it should stretch its content height to fill the viewport or not.
See Code Examples for other Android ScrollView Methods: