Codota Logo
RadioButton.setLayoutParams
Code IndexAdd Codota 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)

  • Common ways to obtain RadioButton
private void myMethod () {
RadioButton r =
  • Codota IconView view;(RadioButton) view.findViewById(id)
  • Codota IconRadioGroup radioGroup;(RadioButton) radioGroup.getChildAt(int1)
  • Codota IconContext context;new RadioButton(context)
  • Smart code suggestions by Codota
}
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

  • Running tasks concurrently on multiple threads
  • getApplicationContext (Context)
  • getExternalFilesDir (Context)
  • getSystemService (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Kernel (java.awt.image)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now