当前位置: 首页>>代码示例>>Java>>正文


Java TableRow.setLayoutParams方法代码示例

本文整理汇总了Java中android.widget.TableRow.setLayoutParams方法的典型用法代码示例。如果您正苦于以下问题:Java TableRow.setLayoutParams方法的具体用法?Java TableRow.setLayoutParams怎么用?Java TableRow.setLayoutParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.TableRow的用法示例。


在下文中一共展示了TableRow.setLayoutParams方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateLayoutHolder

import android.widget.TableRow; //导入方法依赖的package包/类
public void updateLayoutHolder(View vToBeAdded, boolean bRemoveAllFirst)	{
	if (bRemoveAllFirst)	{
		mlLayoutholderInputPadCfg.removeAllViews();
	}
	mlLayoutholderInputPadCfg.addView(vToBeAdded);
	vToBeAdded.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
	if (vToBeAdded instanceof TableLayout)	{
		int nNumofRows = ((TableLayout)vToBeAdded).getChildCount();
		for (int idx = 0; idx < nNumofRows; idx ++)	{
			TableRow tr = (TableRow)((TableLayout)vToBeAdded).getChildAt(idx);
			tr.setLayoutParams(new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
			int nNumofBtns = tr.getChildCount();
			for (int idx1 = 0; idx1 < nNumofBtns; idx1 ++)	{
				View vBtn = tr.getChildAt(idx1);
				// height has been set before.
				vBtn.setLayoutParams(new TableRow.LayoutParams(0, vBtn.getLayoutParams().height, 1));
			}
		}
	}
}
 
开发者ID:woshiwpa,项目名称:SmartMath,代码行数:21,代码来源:ActivityCfgKeyPad.java

示例2: addRow

import android.widget.TableRow; //导入方法依赖的package包/类
private void addRow(TableLayout parent, String key, String value) {
    TableRow.LayoutParams rowParams = new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT);

    TextView textViewKey = new TextView(this);
    textViewKey.setText(key);
    textViewKey.setLayoutParams(rowParams);

    TextView textViewValue = new TextView(this);
    textViewValue.setText(value);
    textViewValue.setLayoutParams(rowParams);

    TableRow tableRow = new TableRow(this);
    tableRow.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT));
    tableRow.addView(textViewKey);
    tableRow.addView(textViewValue);

    parent.addView(tableRow);
}
 
开发者ID:yeriomin,项目名称:YalpStore,代码行数:19,代码来源:DeviceInfoActivity.java

示例3: getTableRow

import android.widget.TableRow; //导入方法依赖的package包/类
public static TableRow getTableRow(Context context, View... views){
    TableRow tableRow = new TableRow(context);
    tableRow.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT,
            TableRow.LayoutParams.WRAP_CONTENT));
    tableRow.setBackgroundColor(Color.GRAY);
    for (View item: views) {
        tableRow.addView(item);
    }
    return tableRow;
}
 
开发者ID:AlexeyZatsepin,项目名称:CP-Tester,代码行数:11,代码来源:ViewHelper.java

示例4: createTableRow

import android.widget.TableRow; //导入方法依赖的package包/类
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;
}
 
开发者ID:feliperce,项目名称:MyNotes,代码行数:8,代码来源:ColorPickerPalette.java

示例5: makeRemarkList

import android.widget.TableRow; //导入方法依赖的package包/类
private void makeRemarkList(){

        if(remarks.size() > 0){
            tv_msg_remark.setVisibility(View.GONE);
        }else{
            tv_msg_remark.setVisibility(View.VISIBLE);
        }

        for(PatientRemark pr : remarks){

            TableLayout.LayoutParams tlps=new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT,TableLayout.LayoutParams.WRAP_CONTENT);
            TableRow.LayoutParams trps=new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT,TableRow.LayoutParams.WRAP_CONTENT);

            TableRow tr = new TableRow(this);
            tr.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT));

            TextView tv_title = new TextView(this);
            tv_title.setText(pr.getDescription());
            tv_title.setLayoutParams(trps);
            tv_title.setTextColor(getColorId(R.color.dark_gray));
            tv_title.setGravity(Gravity.CENTER);
            tv_title.setTextSize(TypedValue.COMPLEX_UNIT_PX,
                    getResources().getDimension(R.dimen.default_font_small_size));

            TextView tv_time = new TextView(this);
            tv_time.setText(AdditionalFunc.getTimeString(pr.getRegisteredDate()));
            tv_time.setLayoutParams(trps);
            tv_time.setTextColor(getColorId(R.color.dark_gray));
            tv_time.setGravity(Gravity.CENTER);
            tv_time.setTextSize(TypedValue.COMPLEX_UNIT_PX,
                    getResources().getDimension(R.dimen.default_font_small_size));

            tr.addView(tv_title);
            tr.addView(tv_time);

            tl_remark.addView(tr, tlps);
        }

    }
 
开发者ID:pooi,项目名称:Nearby,代码行数:40,代码来源:InquiryDateDetailActivity.java

示例6: addRow

import android.widget.TableRow; //导入方法依赖的package包/类
public void addRow() {
    rows++;
    TableRow tr = new TableRow(getContext());
    tr.setLayoutParams(new MatrixView.LayoutParams(MatrixView.LayoutParams.WRAP_CONTENT, MatrixView.LayoutParams.WRAP_CONTENT, 1));
    addView(tr);

    for(int i = 0; i < columns; i++) {
        tr.addView(createEditText());
    }
}
 
开发者ID:gigabytedevelopers,项目名称:CalcMate,代码行数:11,代码来源:MatrixView.java

示例7: addButtonForNetwork

import android.widget.TableRow; //导入方法依赖的package包/类
private void addButtonForNetwork(AccessPointInfo info) {

        TableLayout s = (TableLayout) findViewById(R.id.table_networks);
        TableLayout.LayoutParams tableParams = new TableLayout.LayoutParams(
                        LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
        TableRow row = new TableRow(this);
        TableRow.LayoutParams rowParams = new TableRow.LayoutParams(LayoutParams.MATCH_PARENT,
                        LayoutParams.WRAP_CONTENT);
        rowParams.gravity = Gravity.FILL_HORIZONTAL;
        row.setPadding(10, 10, 10, 10);
        row.setLayoutParams(rowParams);
        row.setGravity(Gravity.FILL_HORIZONTAL);
        row.setLayoutParams(rowParams);

        NetworkButton button = new NetworkButton(this, info.getBssid());

        TableRow.LayoutParams params = new TableRow.LayoutParams(LayoutParams.MATCH_PARENT,
                        LayoutParams.WRAP_CONTENT);
        button.setLayoutParams(params);
        button.setBackground(getResources().getDrawable(R.drawable.repwifi_button));
        button.setTextColor(Commons.colorThemeLight);
        button.setTextSize(20);
        button.setPadding(25, 10, 25, 10);
        button.setGravity(Gravity.CENTER_HORIZONTAL);
        button.setText(info.getSsid(20));
        button.setOnClickListener(this);

        row.addView(button, params);
        row.setGravity(Gravity.CENTER_HORIZONTAL);
        s.addView(row, tableParams);
        s.setGravity(Gravity.FILL_HORIZONTAL);

    }
 
开发者ID:vaginessa,项目名称:RepWifiApp,代码行数:34,代码来源:SelectNetworkActivity.java

示例8: createTable

import android.widget.TableRow; //导入方法依赖的package包/类
/**
 * @param activity   Activity
 * @param options    Option[]
 * @param owner Object
 * @return TableRow
 */
public static TableRow createTable(Activity activity, Option[] options, Object owner)
{
	TableRow tableRow = new TableRow(activity);
	tableRow.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.MATCH_PARENT));
	//
	LinearLayout linearLayout = new LinearLayout(activity);
	linearLayout.setOrientation(LinearLayout.VERTICAL);
	if (owner != null && (owner instanceof Transformer || owner instanceof Consumer))
	{
		//add divider
		linearLayout.addView(Util.addDivider(activity));
	}
	TextView textViewName = new TextView(activity);
	textViewName.setText(R.string.str_options);
	textViewName.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);
	textViewName.setTextSize(TypedValue.COMPLEX_UNIT_SP, 22);
	linearLayout.addView(textViewName);
	//
	LinearLayout linearLayoutOptions = new LinearLayout(activity);
	linearLayoutOptions.setBackgroundColor(activity.getResources().getColor(R.color.colorListBorder));
	linearLayoutOptions.setOrientation(LinearLayout.VERTICAL);
	//options
	for (int i = 0; i < options.length; i++)
	{
		if (options[i].isAssignableByString())
		{
			linearLayoutOptions.addView(addOption(activity, options[i], owner));
		}
	}
	linearLayout.addView(linearLayoutOptions);
	tableRow.addView(linearLayout);
	return tableRow;
}
 
开发者ID:hcmlab,项目名称:ssj,代码行数:40,代码来源:OptionTable.java

示例9: addNotificationRow

import android.widget.TableRow; //导入方法依赖的package包/类
public void addNotificationRow(String sender, String message){
    TableRow tr = new TableRow(getActivity());
    tr.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
    TextView textview = new TextView(getActivity());
    textview.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT, 1.0f));
    textview.setTextSize(20);
    textview.setTextColor(Color.parseColor("#0B0719"));
    textview.setText(Html.fromHtml(sender + "<br><b>" + "Data" + " : </b>" + message));
    tr.addView(textview);
    tab.addView(tr);
}
 
开发者ID:applecool,项目名称:Buzz-smartband,代码行数:12,代码来源:NotificationsFragment.java

示例10: init

import android.widget.TableRow; //导入方法依赖的package包/类
public void init(List<Location> locations){
    TableLayout tableLoc = (TableLayout) findViewById(R.id.tableLoc);

    for(Location location:locations){
        TableRow row= new TableRow(this);
        TableRow.LayoutParams lp = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT);
        row.setLayoutParams(lp);
        TextView tv = new TextView(this);
        tv.setText(location.getName()+", " + location.getStreet() + ", " + location.getCity()
            + ", " + location.getZipcode());
        row.addView(tv);
        tableLoc.addView(row);
    }
}
 
开发者ID:lugrace,项目名称:Bank-App,代码行数:15,代码来源:MainActivity.java

示例11: addRow

import android.widget.TableRow; //导入方法依赖的package包/类
public void addRow(RetrofitActivity retrofitActivity, String text1, String text2) {
    TableRow tableRow = new TableRow(retrofitActivity);
    tableRow.setLayoutParams(matchParentParams);

    addText(retrofitActivity, tableRow, text1);
    addText(retrofitActivity, tableRow, text2);

    addView(tableRow);
}
 
开发者ID:zond,项目名称:android-diplicity,代码行数:10,代码来源:UserStatsTable.java

示例12: onBindViewHolder

import android.widget.TableRow; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
    final MainRecord mr = list.get(position);
    final int pos = position;

    holder.tv_dateTitle.setText(mr.getDate());

    ArrayList<MainRecord> groupList = mr.getGroupList();
    for(int i=0; i<groupList.size(); i++){
        MainRecord mr2 = groupList.get(i);

        VitalSign vs = (VitalSign)mr2;

        TableLayout.LayoutParams tlps=new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT,TableLayout.LayoutParams.WRAP_CONTENT);
        TableRow.LayoutParams trps=new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT,TableRow.LayoutParams.WRAP_CONTENT);

        TableRow tr = new TableRow(context);
        tr.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT));


        TextView tv_title = new TextView(context);
        switch (type){
            case InquiryVitalSignFragment.TYPE_PULSE: {
                tv_title.setText(vs.getPulse() + "");
                break;
            }
            case InquiryVitalSignFragment.TYPE_TEMPERATURE:{
                tv_title.setText(vs.getTemperature() + "");
                break;
            }
            case InquiryVitalSignFragment.TYPE_BP:{
                tv_title.setText(vs.getBpMin() + " / " + vs.getBpMax());
                break;
            }
        }
        tv_title.setLayoutParams(trps);
        tv_title.setTextColor(recordSupporter.getColorId(R.color.dark_gray));
        tv_title.setGravity(Gravity.CENTER);
        tv_title.setTextSize(TypedValue.COMPLEX_UNIT_PX,
                context.getResources().getDimension(R.dimen.default_font_small_size));

        tr.addView(tv_title);


        TextView tv_time = new TextView(context);
        tv_time.setText(AdditionalFunc.getTimeString(vs.getRegisteredDate()));
        tv_time.setLayoutParams(trps);
        tv_time.setTextColor(recordSupporter.getColorId(R.color.dark_gray));
        tv_time.setGravity(Gravity.CENTER);
        tv_time.setTextSize(TypedValue.COMPLEX_UNIT_PX,
                context.getResources().getDimension(R.dimen.default_font_small_size));

        tr.addView(tv_time);

        holder.tl.addView(tr, tlps);


    }

}
 
开发者ID:pooi,项目名称:Nearby,代码行数:61,代码来源:AllInOneInquiryVitalListCustomAdapter.java

示例13: makeMealList

import android.widget.TableRow; //导入方法依赖的package包/类
private void makeMealList(){

        if(haveMeals.size() > 0){
            tv_msg_meal.setVisibility(View.GONE);
        }else{
            tv_msg_meal.setVisibility(View.VISIBLE);
        }

        for(HaveMeal hm : haveMeals){

            TableLayout.LayoutParams tlps=new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT,TableLayout.LayoutParams.WRAP_CONTENT);
            TableRow.LayoutParams trps=new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT,TableRow.LayoutParams.WRAP_CONTENT);

            TableRow tr = new TableRow(this);
            tr.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT));

            TextView tv_title = new TextView(this);
            if("nursing_home".equals(hm.getType())){
                tv_title.setText(getString(R.string.nursing_home_meal_srt));
            }else if("water_gruel".equals(hm.getType())){
                tv_title.setText(getString(R.string.water_gruel));
            }else{
                tv_title.setText(hm.getType());
            }
            tv_title.setLayoutParams(trps);
            tv_title.setTextColor(getColorId(R.color.dark_gray));
            tv_title.setGravity(Gravity.CENTER);
            tv_title.setTextSize(TypedValue.COMPLEX_UNIT_PX,
                    getResources().getDimension(R.dimen.default_font_small_size));

            TextView tv_time = new TextView(this);
            tv_time.setText(AdditionalFunc.getTimeString(hm.getRegisteredDate()));
            tv_time.setLayoutParams(trps);
            tv_time.setTextColor(getColorId(R.color.dark_gray));
            tv_time.setGravity(Gravity.CENTER);
            tv_time.setTextSize(TypedValue.COMPLEX_UNIT_PX,
                    getResources().getDimension(R.dimen.default_font_small_size));

            tr.addView(tv_title);
            tr.addView(tv_time);

            tl_meal.addView(tr, tlps);
        }

    }
 
开发者ID:pooi,项目名称:Nearby,代码行数:46,代码来源:InquiryDateDetailActivity.java

示例14: makeList

import android.widget.TableRow; //导入方法依赖的package包/类
private void makeList(String type){

        ArrayList<NearbyLog> list = new ArrayList<>();
        TableLayout tl = null;

        switch (type){
            case "symptom": {
                list = symptomList;
                tl = tl_symptom;
                break;
            }
            case "medicine": {
                list = medicineList;
                tl = tl_medicine;
                break;
            }
            case "record": {
                list = recordList;
                tl = tl_record;
                break;
            }
            case "weight": {
                list = weightList;
                tl = tl_weight;
                break;
            }
            case "edit_patient": {
                list = editPatientList;
                tl = tl_edit_patient;
                break;
            }
            case "supporter": {
                list = supporterList;
                tl = tl_supporter;
                break;
            }
        }

        if(tl != null){


            for(int i= Math.max(0, list.size()-5); i<list.size(); i++){
                NearbyLog log = list.get(i);

                TableLayout.LayoutParams tlps=new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT,TableLayout.LayoutParams.WRAP_CONTENT);
                TableRow.LayoutParams trps=new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT,TableRow.LayoutParams.WRAP_CONTENT);

                TableRow tr = new TableRow(this);
                tr.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT));

                TextView tv_log_msg = new TextView(this);
                tv_log_msg.setText(log.getMsg());
                tv_log_msg.setLayoutParams(trps);
                tv_log_msg.setTextColor(getColorId(R.color.dark_gray));
                tv_log_msg.setGravity(Gravity.CENTER);
                tv_log_msg.setTextSize(TypedValue.COMPLEX_UNIT_PX,
                        getResources().getDimension(R.dimen.default_font_small_size));

                TextView tv_time = new TextView(this);
                tv_time.setText(AdditionalFunc.getDateTimeSrtString(log.getRegisteredDate()));
                tv_time.setLayoutParams(trps);
                tv_time.setTextColor(getColorId(R.color.dark_gray));
                tv_time.setGravity(Gravity.CENTER);
                tv_time.setTextSize(TypedValue.COMPLEX_UNIT_PX,
                        getResources().getDimension(R.dimen.default_font_small_size));

                tr.addView(tv_log_msg);
                tr.addView(tv_time);

                tl.addView(tr, tlps);

            }

        }

    }
 
开发者ID:pooi,项目名称:Nearby,代码行数:77,代码来源:InquiryLogActivity.java

示例15: loadHofTable

import android.widget.TableRow; //导入方法依赖的package包/类
public void loadHofTable(){

  	TableLayout tl = (TableLayout)findViewById(R.id.hoftable);       
     
String filecontent = getStringFromFile("halloffame");        
     
      if (filecontent != "") {
      	
       String scores[] = filecontent.split(";");
   	
       for (int i=0; i<scores.length; i++){
           
       	String score[];
       	score = scores[i].split(",");
       	
       	TableRow tr = new TableRow(this);
           tr.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
	
           TextView points = new TextView(this);
           points.setGravity(Gravity.CENTER_VERTICAL);
           points.setGravity(Gravity.CENTER_HORIZONTAL);
           points.setTextColor(Color.BLACK);
           points.setText(score[0]);
           points.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
           tr.addView(points);
          
           TextView playername = new TextView(this);
           playername.setGravity(Gravity.CENTER_VERTICAL);
           playername.setGravity(Gravity.CENTER_HORIZONTAL);
           playername.setTextColor(Color.BLACK);
           playername.setText(score[1]);
           playername.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
           tr.addView(playername);
           
           TextView dat = new TextView(this);
           dat.setGravity(Gravity.CENTER_VERTICAL);
           dat.setGravity(Gravity.CENTER_HORIZONTAL);
           dat.setTextColor(Color.BLACK);
           dat.setText(score[2]);
           dat.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
           tr.addView(dat);
           
           tl.addView(tr,new TableLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));		
       }
      }  
  }
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:47,代码来源:Hof.java


注:本文中的android.widget.TableRow.setLayoutParams方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。