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

This code example shows how to use the following methods:setLayoutParams
        mDescription = res.getString(R.string.color_swatch_description);
        mDescriptionSelected = res.getString(R.string.color_swatch_description_selected);
    } 
 
    private TableRow createTableRow() {
        TableRow row = new TableRow(getContext());
        ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT,
                LayoutParams.WRAP_CONTENT);
        row.setLayoutParams(params);
        return row;
    } 
 
    /** 
     * Adds swatches to table in a serpentine format. 
     */ 
    public void drawPalette(int[] colors, int selectedColor) {
        if (colors == null) {
            return; 
        } 
 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getWidth, setBackgroundColor, setLayoutParams, addView
		} 
	} 
	 
	private void AddRow(int position, String textString)
	{ 
		TableRow tr = new TableRow(WTTagActivity.this);
		 
		Resources r = getResources();
		int trHeight = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 40 , r.getDisplayMetrics());
		LayoutParams trParams = new LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,trHeight);
		tr.setLayoutParams(trParams);
		tr.setBackgroundColor(Color.WHITE);
		 
		 
		final ImageView img = new ImageView(this);
		ClickableText text = new ClickableText(WTTagActivity.this, img, tr);
		text.setBackgroundColor(Color.TRANSPARENT);
		text.setHeight(trHeight);
		text.setWidth(tr.getWidth() - trHeight);
		 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setBackgroundColor, setPadding, addView
  private TableRow rowHelper(String textStr) {
    return rowHelper(textStr, 28);
  } 
 
  private TableRow rowHelper(String textStr, int textSize) {
    TableRow row = new TableRow(this);
 
    TextView text = new TextView(this);
    text.setText(textStr);
    text.setTextSize(textSize);
 
    row.setPadding(5, 5, 5, 5);
    row.setBackgroundColor(Color.argb(200, 51, 51, 51));
 
    row.addView(text);
    return row;
  } 
 
  public void onLocationChanged(android.location.Location location) {
    bestLocation = location;
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addView
	 */ 
	public SimpleFieldView(Context context, Field field) {
		super(context);
		mField = field;
		// TODO Auto-generated constructor stub 
		mTopRow = new TableRow(context);
		mFieldName = new TextView(context);
		mFieldName.setTextSize(18);
		mFieldName.setPadding(4, 4, 4, 4);
		mFieldName.setGravity(Gravity.LEFT);
 
		mFieldType = new TextView(context);
		mFieldType.setTextSize(16);
		mFieldType.setPadding(4, 4, 4, 8);
		mFieldType.setGravity(Gravity.RIGHT);
		mTopRow.addView(mFieldName);
		mTopRow.addView(mFieldType);
 
		mFieldDesc = new TextView(context);
		mFieldDesc.setPadding(12, 4, 4, 12);

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addView
		_characterView.setOnItemClickListener(this);
 
		_selectedActorIndex=0;
		_actorEditor= new ActorEditor(context, _actorList.get(_selectedActorIndex));
			 
		_workspace = new TableRow(context);
		_workspace.addView(_characterView, 0);		
		_workspace.addView(_actorEditor, 1);		
		this.addView(_workspace);
	} 
 
	public void onClick(View v) {		
		if(v==_newCharBtn){
			if(_actorList.size()>0){
				_characterView.setItemChecked(_selectedActorIndex, false);
				_actorList.set(_selectedActorIndex, _actorEditor.save());
			} 
			_actorList.add(new BaseActor(new String("Empty Chararcter")));
			_actorAdapter.notifyDataSetChanged();			
			_selectedActorIndex= _actorList.size()-1;
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getChildAt
		assertEquals( "tab2", tabHost.getTabSpec( 1 ).getIndicator() );
		tab = (android.widget.LinearLayout) tabHost.getTabSpec( 1 ).getContent().createTabContent( null );
		assertEquals( android.widget.LinearLayout.VERTICAL, tab.getOrientation() );
		tabTableLayout = (android.widget.TableLayout) tab.getChildAt( 0 );
		tableRow = (TableRow) tabTableLayout.getChildAt( 0 );
		assertEquals( "Def: ", ( (TextView) tableRow.getChildAt( 0 ) ).getText() );
		assertTrue( tableRow.getChildAt( 1 ) instanceof EditText );
		assertEquals( 1, tabTableLayout.getChildCount() );
 
		// Separate component 
 
		tableRow = (TableRow) tableLayout.getChildAt( 2 );
		assertEquals( "Ghi: ", ( (TextView) tableRow.getChildAt( 0 ) ).getText() );
		assertTrue( tableRow.getChildAt( 1 ) instanceof Spinner );
 
		// Tab Host #2 
 
		tableRow = (TableRow) tableLayout.getChildAt( 3 );
		tabHost = (TabHost) tableRow.getChildAt( 0 );
		tabLayout = (android.widget.LinearLayout) tabHost.getChildAt( 0 );
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getChildAt
This code example shows how to use the following methods:getContext, addView
    		list.removeView( rowToBeRemoved );
    	} 
    } 
     
    public void addButton() { 
    	TableRow newRow = new TableRow( list.getContext() );
    	Button actionButton = new Button( newRow.getContext() );
    	actionButton.setText( "Action: " + ++rowsSoFar );
    	Button removeSelfButton = new Button( newRow.getContext() );
    	removeSelfButton.setText( "-" );
    	// pass on all the information necessary for deletion 
    	removeSelfButton.setOnClickListener( new RowRemover( list, newRow ));
    	newRow.addView( actionButton );
    	newRow.addView( removeSelfButton );
    	list.addView( newRow );
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setBackgroundResource, setLayoutParams, setMinimumHeight, setPadding
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setLayoutParams, addView
	} 
	 
	public void insertTable(String s){
		TextView t = new TextView(this);
		t.setText(s);
		dummy = new TableRow(this);
	    dummy.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
		dummy.addView(t);
	    layout.addView(dummy ,new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.WRAP_CONTENT));
	} 
    public static byte[] asBytes (String s) {
        String s2;
        byte[] b = new byte[s.length() / 2];
        int i;
        for (i = 0; i < s.length() / 2; i++) {
            s2 = s.substring(i * 2, i * 2 + 2);
            b[i] = (byte)(Integer.parseInt(s2, 16) & 0xff);
        } 
        return b;
    } 
6
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Android TableRow Questions & Answers:

See Code Examples for Android TableRow Methods: