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

How to use
setCompoundDrawables
method
in
android.widget.RadioButton

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

origin: AriaLyy/BlogDemo

private void init() {
  mFm = getSupportFragmentManager();
  mNavigationBar = (RadioGroup) findViewById(R.id.navigation);
  int size = (int) getResources().getDimension(R.dimen.navigation_top_icon_size);
  for (int i = 0, count = mNavigationBar.getChildCount(); i < count; i++) {
    RadioButton rb = (RadioButton) mNavigationBar.getChildAt(i);
    Drawable topIcon = getResources().getDrawable(R.drawable.selector_navigation_bg);
    topIcon.setBounds(0, 0, size, size);
    rb.setCompoundDrawables(null, topIcon, null, null);
    rb.setId(i);
  }
  mNavigationBar.setOnCheckedChangeListener(this);
  ((RadioButton) mNavigationBar.getChildAt(0)).setChecked(true);
}
origin: ShonLin/QuickDevFramework

  @Override
  public void setCompoundDrawables(Drawable left, Drawable top, Drawable right, Drawable bottom) {
    setDrawableBounds(left, drawableLeftWidth, drawableLeftHeight, drawableWidth, drawableHeight);
    setDrawableBounds(top, drawableTopWidth,drawableTopHeight, drawableWidth,drawableHeight);
    setDrawableBounds(right, drawableRightWidth, drawableRightHeight,drawableWidth,drawableHeight);
    setDrawableBounds(bottom, drawableBottomWidth, drawableBottomHeight, drawableWidth,drawableHeight);
    super.setCompoundDrawables(left, top, right, bottom);
  }
}
origin: mkulesh/microMathematics

public void onCreate(RadioButton[] rb)
{
  for (int i = 0; i < rb.length; i++)
  {
    final String text = ctx.getString(R.string.dialog_function_selection) + " "
        + Integer.toString(i + 1) + ":";
    rb[i].setText(text);
    final Paint p = functions.get(i).getLineParameters().getPaint();
    final int textWidth = (int) rb[i].getPaint().measureText(text);
    rb[i].setCompoundDrawables(null, null,
        new LineDrawable(p, textWidth, (int) (p.getStrokeWidth() + 4)), null);
    rb[i].setCompoundDrawablePadding(ctx.getResources().getDimensionPixelSize(
        R.dimen.dialog_content_padding));
  }
}
origin: trezor/trezor-android

private void refreshTrezorsList() {
  ImmutableList<InitializedTrezor> trezors = gct.getCommonDb().getTrezors();
  if (radioGroupTrezors.getChildCount() > trezors.size()) {
    radioGroupTrezors.removeViews(trezors.size(), radioGroupTrezors.getChildCount() - trezors.size());
  }
  LayoutInflater inflater = LayoutInflater.from(radioGroupTrezors.getContext());
  for (int i = radioGroupTrezors.getChildCount(); i < trezors.size(); i++) {
    RadioButton btn = (RadioButton)inflater.inflate(R.layout.nav_drawer_trezor_radiobutton, radioGroupTrezors, false);
    btn.setCompoundDrawables(createNavDrawerButtonIcon(R.drawable.ic_trezor), null, null, null);
    btn.setOnClickListener(onTrezorClickListener);
    radioGroupTrezors.addView(btn);
  }
  for (int i = 0; i < trezors.size(); i++) {
    InitializedTrezor t = trezors.get(i);
    RadioButton btn = (RadioButton)radioGroupTrezors.getChildAt(i);
    btn.setText(TextUtils.isEmpty(t.getFeatures().getLabel()) ? btn.getContext().getString(R.string.init_trezor_device_label_default) : t.getFeatures().getLabel());
    int id = getTrezorButtonId(t.getFeatures().getDeviceId());
    btn.setId(id);
  }
  refreshCurrentSelectedTrezor(gct.getCommonDb().getLastSelectedDeviceId());
  radioGroupTrezors.setVisibility(trezors.isEmpty() ? View.GONE : View.VISIBLE);
  dividerTrezors.setVisibility(trezors.isEmpty() ? View.GONE : View.VISIBLE);
}
android.widgetRadioButtonsetCompoundDrawables

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

  • Creating JSON documents from java classes using gson
  • getResourceAsStream (ClassLoader)
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JCheckBox (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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