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


Java TableRow.LayoutParams方法代码示例

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


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

示例1: setChildWidthForTableLayout

import android.widget.TableRow; //导入方法依赖的package包/类
public static void setChildWidthForTableLayout(View view, int width) {
  Object layoutParams = view.getLayoutParams();
  if (layoutParams instanceof TableRow.LayoutParams) {
    TableRow.LayoutParams tableLayoutParams = (TableRow.LayoutParams) layoutParams;
    switch (width) {
      case Component.LENGTH_PREFERRED:
        tableLayoutParams.width = TableRow.LayoutParams.WRAP_CONTENT;
        break;
      case Component.LENGTH_FILL_PARENT:
        tableLayoutParams.width = TableRow.LayoutParams.FILL_PARENT;
        break;
      default:
        tableLayoutParams.width = calculatePixels(view, width);
        break;
    }
    view.requestLayout();
  } else {
    Log.e("ViewUtil", "The view does not have table layout parameters");
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:21,代码来源:ViewUtil.java

示例2: setChildHeightForTableLayout

import android.widget.TableRow; //导入方法依赖的package包/类
public static void setChildHeightForTableLayout(View view, int height) {
  Object layoutParams = view.getLayoutParams();
  if (layoutParams instanceof TableRow.LayoutParams) {
    TableRow.LayoutParams tableLayoutParams = (TableRow.LayoutParams) layoutParams;
    switch (height) {
      case Component.LENGTH_PREFERRED:
        tableLayoutParams.height = TableRow.LayoutParams.WRAP_CONTENT;
        break;
      case Component.LENGTH_FILL_PARENT:
        tableLayoutParams.height = TableRow.LayoutParams.FILL_PARENT;
        break;
      default:
        tableLayoutParams.height = calculatePixels(view, height);
        break;
    }
    view.requestLayout();
  } else {
    Log.e("ViewUtil", "The view does not have table layout parameters");
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:21,代码来源:ViewUtil.java

示例3: createNewImageBut

import android.widget.TableRow; //导入方法依赖的package包/类
private ImageButton createNewImageBut(final EditText et){
    final TableRow.LayoutParams lparams = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT);
    final ImageButton iBut = new ImageButton(this.getContext());
    iBut.setImageResource(android.R.drawable.ic_delete);
    lparams.weight = 1;
    iBut.setLayoutParams(lparams);
    iBut.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            // row is your row, the parent of the clicked button
            View row = (View) et.getParent();
            // container contains all the rows, you could keep a variable somewhere else to the container which you can refer to here
            ViewGroup container = ((ViewGroup)row.getParent());
            // delete the row and invalidate your view so it gets redrawn
            container.removeView(row);
            container.invalidate();
            addColour = !addColour;
        }
    });

    return iBut;
}
 
开发者ID:bounswe,项目名称:bounswe2016group2,代码行数:23,代码来源:FoodAddFragment.java

示例4: onCreate

import android.widget.TableRow; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.listamedidas);
	
	info=(Button) findViewById(R.id.BotonInfo);
	info.setVisibility(INVISIBLE);
	back=(Button) findViewById(R.id.BotonBack);
	back.setOnClickListener(this);
	
	// Instanciamos CalibradosDataSource para
       // poder realizar acciones con la base de datos
       dataSource = new CalibradosDataSource(this);
       dataSource.open();
       
    // Instanciamos los elementos
       //lvCalibrados = (ListView) findViewById(R.id.lvCalibrados);
       tabla = (TableLayout)findViewById(R.id.tablaMedidas);
       layoutFila = new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT,TableRow.LayoutParams.WRAP_CONTENT);
       
       
       // Cargamos la lista de notas disponibles
       List<Medidas> listaMedidas = dataSource.getAllMedidas();
       agregarFilasTabla(listaMedidas);
}
 
开发者ID:otoumas,项目名称:Furfural-Detector,代码行数:26,代码来源:ListaMedidas.java

示例5: onBindViewHolder

import android.widget.TableRow; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(ThumbHolder holder, int position) {
    final MovieOverviewModel movie = movies.get(position);

    Glide.with(mContext).load("https://image.tmdb.org/t/p/w640/" + movie.getPosterPath())
            .thumbnail(1)
            .transition(withCrossFade())
            .apply(new RequestOptions()
                    .diskCacheStrategy(DiskCacheStrategy.ALL)
            )
            .into(holder.thumbnail);

    holder.title.setText(movie.getTitle());

    holder.container.setOnClickListener(v -> {
        lastClickedItem = position;
        Intent detailsActivityIntent = new Intent(mContext, OverviewActivity.class);

        detailsActivityIntent.setAction(OverviewActivity.MOVIE_ACTION);
        detailsActivityIntent.putExtra(OverviewActivity.MOVIE_ID, movie.getId());

        ActivityOptionsCompat options = ActivityOptionsCompat
                .makeSceneTransitionAnimation(
                        mContext,
                        holder.thumbnail,
                        mContext.getString(R.string.gallery_transition)
                );

        mContext.startActivity(detailsActivityIntent, options.toBundle());
    });

    TableRow.LayoutParams params = new TableRow.LayoutParams(
            (int)(columnHeight * 0.66), columnHeight);

    holder.container.setLayoutParams(params);
}
 
开发者ID:tgbMedia,项目名称:Android-app,代码行数:37,代码来源:DiscoverListAdapter.java

示例6: createBlankSpace

import android.widget.TableRow; //导入方法依赖的package包/类
/**
 * Creates a blank space to fill the row.
 */
private ImageView createBlankSpace() {
    ImageView view = new ImageView(getContext());
    TableRow.LayoutParams params = new TableRow.LayoutParams(mSwatchLength, mSwatchLength);
    params.setMargins(mMarginSize, mMarginSize, mMarginSize, mMarginSize);
    view.setLayoutParams(params);
    return view;
}
 
开发者ID:feliperce,项目名称:MyNotes,代码行数:11,代码来源:ColorPickerPalette.java

示例7: createColorSwatch

import android.widget.TableRow; //导入方法依赖的package包/类
/**
 * Creates a color swatch.
 */
private ColorPickerSwatch createColorSwatch(int color, int selectedColor) {
    ColorPickerSwatch view = new ColorPickerSwatch(getContext(), color,
            color == selectedColor, mOnColorSelectedListener);
    TableRow.LayoutParams params = new TableRow.LayoutParams(mSwatchLength, mSwatchLength);
    params.setMargins(mMarginSize, mMarginSize, mMarginSize, mMarginSize);
    view.setLayoutParams(params);
    return view;
}
 
开发者ID:feliperce,项目名称:MyNotes,代码行数:12,代码来源:ColorPickerPalette.java

示例8: 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

示例9: 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

示例10: displayFoundUser

import android.widget.TableRow; //导入方法依赖的package包/类
private void displayFoundUser(final View view, final String name, final String email) {
    if (view == null || name == null || name.equals("")) {
        throw new IllegalArgumentException();
    }

    TableLayout table = (TableLayout) view.findViewById(R.id.table);
    TableRow tableRow = new TableRow(this.getContext());
    //tableRow.setBackgroundColor(getResources().getColor(R.color.colorAccent));
    tableRow.setPadding(20, 20, 20, 5);

    TableRow.LayoutParams layoutParams = new TableRow.LayoutParams();
    layoutParams.setMargins(50, 40, 40, 40);

    TextView nameTextView = new TextView(this.getContext());
    nameTextView.setText(name);
    nameTextView.setTextSize(22);
    nameTextView.setTextColor(getResources().getColor(R.color.cast_expanded_controller_text_color));
    nameTextView.setLayoutParams(layoutParams);
    tableRow.addView(nameTextView);

    tableRow.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            ((SideBarActivity) getActivity()).searchViewAsMenuItem.collapseActionView();
            listener.onDisplayProfileFragmentInteraction(name, email);
        }
    });

    table.addView(tableRow);
}
 
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:31,代码来源:DisplayUserFragment.java

示例11: onBindViewHolder

import android.widget.TableRow; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(ParticipantViewHolder holder, int position) {
    Participant participant = mParticipantsList.get(position);
    holder.container.removeAllViews();

    //add id
    holder.id = participant.getId();
    holder.type = participant.getType();
    holder.listener = mListener;

    TableRow.LayoutParams params = new TableRow.LayoutParams(participant.getContainer().getWidth(), participant.getContainer().getHeight()); // (width, height)
    holder.container.setLayoutParams(params);

    if (!participant.getStatus().has(MediaType.VIDEO) || (participant.getType().equals(Participant.Type.REMOTE) && !participant.getStatus().subscribedTo(MediaType.VIDEO))) {
        holder.audiOnlyView.setVisibility(View.VISIBLE);
        holder.container.addView(holder.audiOnlyView, params);
    } else {
        holder.audiOnlyView.setVisibility(View.GONE);
        if (participant.getStatus().getView() != null) {
            ViewGroup parent = (ViewGroup) participant.getStatus().getView().getParent();
            if (parent != null) {
                parent.removeView(participant.getStatus().getView());
            }
            holder.container.addView(participant.getStatus().getView());
        }
    }

}
 
开发者ID:opentok,项目名称:accelerator-sample-apps-android,代码行数:29,代码来源:ParticipantsAdapter.java

示例12: 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

示例13: createColorSwatch

import android.widget.TableRow; //导入方法依赖的package包/类
/**
 * Creates a color swatch.
 */
private ColorPickerUtil createColorSwatch(int color, int selectedColor) {
    ColorPickerUtil view = new ColorPickerUtil(getContext(), color,
            color == selectedColor, mOnColorSelectedListener);
    TableRow.LayoutParams params = new TableRow.LayoutParams(mSwatchLength, mSwatchLength);
    params.setMargins(mMarginSize, mMarginSize, mMarginSize, mMarginSize);
    view.setLayoutParams(params);
    return view;
}
 
开发者ID:biniamHaddish,项目名称:BottomSheetColorPicker,代码行数:12,代码来源:ColorPaletteTable.java

示例14: HeroResponsesAdapter

import android.widget.TableRow; //导入方法依赖的package包/类
public HeroResponsesAdapter(Context context, List<HeroResponsesSection> heroSectionsResponses, String holderFolder) {
    editMode = false;
    this.context = context;
    this.holderFolder = holderFolder;
    this.mHeroSectionsResponses = heroSectionsResponses != null ? heroSectionsResponses : new ArrayList<HeroResponsesSection>();
    int dp30 = Utils.dpSize(context, 30);
    dp2 = Utils.dpSize(context, 2);
    otherLayoutParams = new TableRow.LayoutParams(dp30, dp30);
    playerQueue = new ArrayList<>();
    filteredHeroResponses = generateFilteredValue(null);
}
 
开发者ID:mrprona92,项目名称:SecretBrand,代码行数:12,代码来源:HeroResponsesAdapter.java

示例15: setFirstItemDimensions

import android.widget.TableRow; //导入方法依赖的package包/类
public void setFirstItemDimensions() {
    int itemHeightTall = getContext().getResources().getDimensionPixelSize(R.dimen.alarm_list_item_height_tall);
    TableRow.LayoutParams params = new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, itemHeightTall);
    mContainer.setLayoutParams(params);

    int tallItemPadding = itemHeightTall - getContext().getResources().getDimensionPixelSize(R.dimen.alarm_list_item_height);
    mContainer.setPadding(0, tallItemPadding, 0, 0);
}
 
开发者ID:Microsoft,项目名称:ProjectOxford-Apps-MimickerAlarm,代码行数:9,代码来源:AlarmListFragment.java


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