Android TableLayout.LayoutParams - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android TableLayout.LayoutParams class.

This code example shows how to use the following methods:
 
	public static View getLabel(String text) {
		Context context = DragAndDropManager.getInstance().getContext();
		TextView textView = new TextView(context);
		textView.setText(text);
		textView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
		//textView.setGravity(Gravity.TOP + Gravity.LEFT); 
		return textView;
	} 
	 
} 
5
CodeRank
This code example shows how to use the following methods:
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		initializeGlobals(); 
		view = new MainMenuView(getApplicationContext(), this);
		 
		view.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
		 
		setContentView(view);
	} 
	 
	private void initializeGlobals() { 
		Display display = getWindowManager().getDefaultDisplay();
        int screenWidth = display.getWidth();
        int screenHeight = display.getHeight();
        //	if either dimension is below 800, assume phone screen 
        if (screenHeight < 600 || screenWidth < 600) SMALL_PHONE_VIEW = true;
        else if (screenHeight < 800 || screenWidth < 800) PHONE_VIEW = true;
        else TABLET_VIEW = true;
	} 
	 
5
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
	protected void onCreate(Bundle icicle) {
		super.onCreate(icicle);
 
		// Cria o layout 
		TableLayout tabela = new TableLayout(this);
		tabela.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
		// Expande a coluna 1 
		tabela.setColumnStretchable(1, true);
 
		// Linha 1 
		TableRow linha1 = new TableRow(this);
 
		TextView nome = new TextView(this);
		nome.setText("Nome:");
		linha1.addView(nome);
 
		EditText tnome = new EditText(this);
		// Focus no campo nome 
		tnome.requestFocus();
		linha1.addView(tnome);
4
CodeRank
This code example shows how to use the following methods:
 
public class UI { 
	public static TableRow addTableRow(Context context) {
    	// create a new TableRow   
        TableRow row = new TableRow(context);
        TableLayout.LayoutParams params = new LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT);
         
        row.setLayoutParams(params);
    	return row;
    } 
     
    public static TextView addTextView(String text, Context context) {
    	TextView tv = new TextView(context);
    	tv.setText(text);
    	 
    	return tv;
    } 
     
    public static Button addButton(String text, Context context) {
    	Button btn = new Button(context);
4
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
This code example shows how to use the following methods:
This code example shows how to use the following methods:
This code example shows how to use the following methods:

Related Android TableLayout.LayoutParams Questions & Answers:

See Code Examples for Android TableLayout.LayoutParams Methods: