congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
RadioButton.setLayoutParams
Code IndexAdd Tabnine to your IDE (free)

How to use
setLayoutParams
method
in
android.widget.RadioButton

Best Java code snippets using android.widget.RadioButton.setLayoutParams (Showing top 8 results out of 315)

origin: TeamNewPipe/NewPipe

radioButton.setChecked(false);
radioButton.setId(id++);
radioButton.setLayoutParams(new RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
radioButton.setOnClickListener(radioButtonsClickListener);
radioGroup.addView(radioButton);
origin: heinrichreimer/android-issue-reporter

private void setOptionUseAccountMarginStart(int marginStart) {
  LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) optionUseAccount.getLayoutParams();
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
    layoutParams.setMarginStart(marginStart);
  } else {
    layoutParams.leftMargin = marginStart;
  }
  optionUseAccount.setLayoutParams(layoutParams);
}
origin: zhangliangzs/KDemo

    ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT,
    Gravity.CENTER);
radio.setLayoutParams(l);
radio.setGravity(Gravity.CENTER);
radio.setPadding(20, 20, 20, 20);
origin: mvpleung/SwitchButton

RadioButton mRadioButton = mRadioArrays.get(i, createRadioView());
mParams.leftMargin = i > 0 ? -strokeWidth : 0;
mRadioButton.setLayoutParams(i == 0 ? mFirstParams : mParams);
mRadioButton.setButtonDrawable(mButtonDrawables != null ? mButtonDrawables.get(i, colorDrawable) : colorDrawable);
if (Build.VERSION.SDK_INT >= 16) {
origin: vir56k/demo

  /**
   * 创建子 tab
   *
   * @param context
   * @param id
   */
  public static RadioButton creatTabItem(Context context, int id, String text) {
    final int width = DensityUtil.dip2px(context, 80);
    final int height = DensityUtil.dip2px(context, 46);
    final int padding = DensityUtil.dip2px(context, 3);

    RadioButton button;
    button = new RadioButton(context);
    button.setId(id);
//        button.setWidth(width);
//        button.setHeight(height);
    button.setText(text);
    button.setLayoutParams(new LinearLayout.LayoutParams(width, height));
    button.setHeight(height);
    button.setBackgroundResource(R.drawable.tab_item_bg_selector);
    button.setButtonDrawable(context.getResources().getDrawable(android.R.color.transparent));
    button.setGravity(Gravity.CENTER);
    button.setTextColor(context.getResources().getColorStateList(R.color.tab_item_font_color_selector));
    button.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
    button.setPadding(0, 0, 0, padding);
    return button;
  }
}
origin: boredream/DesignResCollection

  params.setMargins(DisplayUtils.dp2px(context, 8), 0, 0, 0);
rb.setLayoutParams(params);
rb.setButtonDrawable(new ColorDrawable());
rb.setBackgroundResource(R.drawable.shape_oval_primary2white_sel);
origin: termux/termux-api

@Override
RadioGroup createWidgetView(AppCompatActivity activity) {
  radioGroup = new RadioGroup(activity);
  radioGroup.setPadding(16, 16, 16, 16);
  LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
  layoutParams.topMargin = 32;
  layoutParams.bottomMargin = 32;
  String[] values = getInputValues(activity.getIntent());
  for (int j = 0; j < values.length; ++j) {
    String value = values[j];
    RadioButton button = new RadioButton(activity);
    button.setText(value);
    button.setId(j);
    button.setTextSize(18);
    button.setPadding(16, 16, 16, 16);
    button.setLayoutParams(layoutParams);
    radioGroup.addView(button);
  }
  return radioGroup;
}
origin: Odoo-mobile/framework

private void createRadioGroup() {
  final LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT,
      LayoutParams.WRAP_CONTENT);
  if (mRadioGroup == null) {
    mRadioGroup = new RadioGroup(mContext);
    mRadioGroup.setLayoutParams(params);
  } else {
    removeView(mRadioGroup);
  }
  mRadioGroup.removeAllViews();
  mRadioGroup.setOnCheckedChangeListener(this);
  for (ODataRow label : items) {
    RadioButton rdoBtn = new RadioButton(mContext);
    rdoBtn.setLayoutParams(params);
    rdoBtn.setText(label.getString(mModel.getDefaultNameColumn()));
    if (textSize > -1) {
      rdoBtn.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
    }
    if (appearance > -1) {
      rdoBtn.setTextAppearance(mContext, appearance);
    }
    rdoBtn.setTextColor(textColor);
    mRadioGroup.addView(rdoBtn);
  }
  addView(mRadioGroup);
}
android.widgetRadioButtonsetLayoutParams

Popular methods of RadioButton

  • setChecked
  • isChecked
  • setText
  • setOnClickListener
  • setOnCheckedChangeListener
  • <init>
  • getId
  • setId
  • getText
  • setEnabled
  • setVisibility
  • setButtonDrawable
  • setVisibility,
  • setButtonDrawable,
  • setTag,
  • setTextColor,
  • setBackgroundDrawable,
  • getTag,
  • setBackgroundColor,
  • setTextSize,
  • onDraw

Popular in Java

  • Making http requests using okhttp
  • putExtra (Intent)
  • startActivity (Activity)
  • setScale (BigDecimal)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • JComboBox (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now