Android TableLayout - 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 class.

This code example shows how to use the following methods: isColumnCollapsed, setColumnCollapsed
 
	} 
 
	public void toggleHiddenRows(View view) {
		// Second row has index 1 
		layout.setColumnCollapsed(1, !layout.isColumnCollapsed(1));
		if (layout.isColumnCollapsed(1)) {
			button.setText("Show second column");
		} else { 
			button.setText("Hide second column");
		} 
	} 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: removeView
		return spinner.getSelectedItem().toString() + selectionExtra;
	} 
	 
	private void remove() { 
		if(parentView != null)
			parentView.removeView(this);
		if(tagsFragment != null)
			tagsFragment.tagEntries.remove(this);
	} 
	 
	private View.OnClickListener removeListener = new View.OnClickListener() {
		public void onClick(View v) { 
			remove(); 
		} 
	}; 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setTag, addView, setColumnShrinkable, setColumnStretchable
        ViewWrapper wrap=null;
        View row=convertView;
 
        if (convertView==null) {
                         
            TableLayout layout = new TableLayout(ctxt);
            layout.setColumnStretchable(0, true);
            layout.setColumnShrinkable(0, true);
             
            TableRow tableRow = new TableRow(ctxt);           
            View guts=delegate.getView(position, null, parent);        
            CheckBox cb=new CheckBox(ctxt);
             
            cb.setLayoutParams(new TableRow.LayoutParams(
                    TableRow.LayoutParams.WRAP_CONTENT,
                    TableRow.LayoutParams.WRAP_CONTENT));
            guts.setLayoutParams(new TableRow.LayoutParams(
                    TableRow.LayoutParams.FILL_PARENT,
                    TableRow.LayoutParams.FILL_PARENT));
 

6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setLayoutParams, setGravity, setOrientation, addView
		super.onCreate(savedInstanceState);
		loadViews(); 
	} 
 
	private void loadViews() { 
		Container = new TableLayout(this.getBaseContext());
		Container.setOrientation(TableLayout.VERTICAL);
		TableLayout.LayoutParams tl =
				new TableLayout.LayoutParams(LayoutParams.FILL_PARENT,
						LayoutParams.FILL_PARENT);
		Container.setLayoutParams(tl);
		Container.setGravity(Gravity.CENTER_HORIZONTAL);
 
		TipsContainer = new LinearLayout(this.getBaseContext());
		TipsContainer.setOrientation(LinearLayout.VERTICAL);
		LinearLayout.LayoutParams lp = 
				new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
						LayoutParams.WRAP_CONTENT);
		lp.gravity = Gravity.CENTER_HORIZONTAL;
		TipsContainer.setGravity(Gravity.CENTER_HORIZONTAL);

6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setLayoutParams, setOrientation, addView, setShrinkAllColumns, setStretchAllColumns
		super.onCreate(savedInstanceState);
		bv = new BackgroundView(this);
		 
		duel = new Duel("P1", "P2");
		 
		layout = new TableLayout(this);
		frame = new FrameLayout(this);
				 
		layout.setOrientation(TableLayout.VERTICAL);
		layout.setShrinkAllColumns(false);
		layout.setStretchAllColumns(true);
		//frame.setLayoutParams(new FrameLayout.LayoutParams(GameRules.getScreenWidth(), FrameLayout.LayoutParams.FILL_PARENT)); 
		layout.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.FILL_PARENT));
 
		 
		TableRow round = new TableRow(this);
		TextView roundLbl = new TextView(this);
		roundLbl.setPadding(10, 5, 0, 20);
		roundLbl.setText("Round " + duel.getRound());
		round.addView(roundLbl);

6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android TableLayout Questions & Answers:

See Code Examples for Android TableLayout Methods: