/** * Sets the Drawables (if any) to appear to the start of, above, to the end * of, and below the text. Use {@code null} if you do not want a Drawable * there. The Drawables' bounds will be set to their intrinsic bounds. * <p> * Calling this method will overwrite any Drawables previously set using * {@link #setCompoundDrawables} or related methods. * * @attr ref android.R.styleable#TextView_drawableStart * @attr ref android.R.styleable#TextView_drawableTop * @attr ref android.R.styleable#TextView_drawableEnd * @attr ref android.R.styleable#TextView_drawableBottom */ @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) public void setCompoundDrawablesRelativeWithIntrinsicBounds (Drawable start, Drawable top, Drawable end, Drawable bottom){ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) mInputView.setCompoundDrawablesRelativeWithIntrinsicBounds(start, top, end, bottom); else mInputView.setCompoundDrawablesWithIntrinsicBounds(start, top, end, bottom); }
/** * Sets the Drawables (if any) to appear to the start of, above, to the end * of, and below the text. Use 0 if you do not want a Drawable there. The * Drawables' bounds will be set to their intrinsic bounds. * <p> * Calling this method will overwrite any Drawables previously set using * {@link #setCompoundDrawables} or related methods. * * @param start Resource identifier of the start Drawable. * @param top Resource identifier of the top Drawable. * @param end Resource identifier of the end Drawable. * @param bottom Resource identifier of the bottom Drawable. * * @attr ref android.R.styleable#TextView_drawableStart * @attr ref android.R.styleable#TextView_drawableTop * @attr ref android.R.styleable#TextView_drawableEnd * @attr ref android.R.styleable#TextView_drawableBottom */ @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) public void setCompoundDrawablesRelativeWithIntrinsicBounds (int start, int top, int end, int bottom){ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) mInputView.setCompoundDrawablesRelativeWithIntrinsicBounds(start, top, end, bottom); else mInputView.setCompoundDrawablesWithIntrinsicBounds(start, top, end, bottom); }
private void setEditTextCompoundTick() { Drawable tick = ContextCompat.getDrawable(this, R.drawable.ic_tick); mEditTextLocation.setCompoundDrawablesRelativeWithIntrinsicBounds(null, null, tick, null); }
@Override public void showCheckInAtVenueSuccessful(Venue venue) { mVenuesAdapter.setLastCheckedInVenue(venue.id); onCheckInSuccessful(venue.label); // Clear the edit text tick in case there was one from a previous label check in. mEditTextLocation.setCompoundDrawablesRelativeWithIntrinsicBounds(null, null, null, null); }
mWidget.setCompoundDrawablesRelativeWithIntrinsicBounds( compoundDrawables[0], compoundDrawables[1],
mWidget.setCompoundDrawablesRelativeWithIntrinsicBounds( compoundDrawables[0], compoundDrawables[1],
mWidget.setCompoundDrawablesRelativeWithIntrinsicBounds( compoundDrawables[0], compoundDrawables[1],