Tabnine Logo
RadioButton.setPadding
Code IndexAdd Tabnine to your IDE (free)

How to use
setPadding
method
in
android.widget.RadioButton

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

origin: zhangliangzs/KDemo

radio.setLayoutParams(l);
radio.setGravity(Gravity.CENTER);
radio.setPadding(20, 20, 20, 20);
origin: zhangliangzs/KDemo

  @Override
  public void onCheckedChanged(RadioGroup group, int checkedId) {
    int radioButtonId = group.getCheckedRadioButtonId();
    // 根据ID获取RadioButton的实例
    RadioButton rb = (RadioButton) findViewById(radioButtonId);
    for (int i = 0; i < group.getChildCount(); i++) {
      RadioButton vradio = (RadioButton) group.getChildAt(i);
      vradio.setGravity(Gravity.CENTER);
      vradio.setPadding(20, 20, 20, 20);
      if (rb.getId() == vradio.getId()) {
        vradio.setTextColor(getResources().getColor(R.color.subject_select));
        vradio.setChecked(true);
        vradio.setBackground(getResources().getDrawable(R.drawable.bg_bottom));
      } else {
        vradio.setTextColor(getResources().getColor(R.color.kViewztblack));
        vradio.setChecked(false);
        vradio.setBackground(null);
      }
    }
    //           CustomProgress.show(mContext, true, null);
    kChartTimeInterval = titleList.get(checkedId - 1).get("time") + "";
    indexMarketChart();
  }
});
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: linglongxin24/ARDevelopDemo

newRadioButton.setPadding(mEntriesSidesPadding,
  mEntriesUpDownRadioPadding, mEntriesSidesPadding,
  mEntriesUpDownRadioPadding);
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;
}
android.widgetRadioButtonsetPadding

Popular methods of RadioButton

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

Popular in Java

  • Reactive rest calls using spring rest template
  • startActivity (Activity)
  • compareTo (BigDecimal)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JFileChooser (javax.swing)
  • Top plugins for WebStorm
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