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

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
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
This code example shows how to use the following methods:addView
     * Appends a swatch to the end of the row for even-numbered rows (starting with row 0), 
     * to the beginning of a row for odd-numbered rows. 
     */ 
    private void addSwatchToRow(TableRow row, View swatch, int rowNumber) {
        if (rowNumber % 2 == 0) {
            row.addView(swatch);
        } else { 
            row.addView(swatch, 0);
        } 
    } 
 
    /** 
     * Add a content description to the specified swatch view. Because the colors get added in a 
     * snaking form, every other row will need to compensate for the fact that the colors are added 
     * in an opposite direction from their left->right/top->bottom order, which is how the system 
     * will arrange them for accessibility purposes. 
     */ 
    private void setSwatchDescription(int rowNumber, int index, int rowElements, boolean selected,
            View swatch) {
        int accessibilityIndex;
6
CodeRank
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
This code example shows how to use the following methods:getChildAt
This code example shows how to use the following methods:addView
		//image:add 
	//	addView(ivLogo, Params); 
		 
		//vertical layer for text 
	//	Params = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); 
		TableRow trName= new TableRow(context);
		_nameLabel= new TextView(context);
		_nameLabel.setTextSize(16);
		_nameLabel.setTypeface(Typeface.DEFAULT, Typeface.BOLD);
		_nameLabel.setText(new String("Name:"));	
		 
		_nameEdit = new EditText( context );
		_nameEdit.setTextSize(16);
		_nameEdit.setTypeface(Typeface.DEFAULT, Typeface.NORMAL );
		_nameEdit.setText(new String("\t")+actor.name());
		        
		trName.addView(_nameLabel, 0);
		trName.addView(_nameEdit, 1);
		  
		addView(trName);

5
CodeRank
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
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
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
This code example shows how to use the following methods:setBackgroundResource, setLayoutParams, setMinimumHeight, setPadding
6
CodeRank

Related Android TableRow.LayoutParams Questions & Answers:

See Code Examples for Android TableRow.LayoutParams Methods: