TextView getCompoundDrawables - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TextView getCompoundDrawables method.

This code example shows how to use the following methods:getCompoundDrawables, setCompoundDrawables, setText
		super.onPageFinished(view, url);
	} 
 
	@Override 
	public void onPageStarted(WebView view, String url, Bitmap favicon) {
		mUrl.setText(url);
		mProgressBar.setProgress(0);
		 
		mUrl.setCompoundDrawables(mUrl.getCompoundDrawables()[0], null, mCircularProgress, null);
		((AnimationDrawable) mCircularProgress).start();
		 
		//mProgressBar.setVisibility(View.VISIBLE);		 
		super.onPageStarted(view, url, favicon);
	} 
 
	@Override 
	public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) {		
		super.onReceivedSslError(view, handler, error);
		 
		StringBuilder sb = new StringBuilder();
5
CodeRank
This code example shows how to use the following methods:getCompoundDrawables
    /** 
     * @param keyword 
     */ 
    public RightDrawableOnTouchListener(TextView view) {
        super(); 
        final Drawable[] drawables = view.getCompoundDrawables();
        if (drawables != null && drawables.length == 4)
            this.drawable = drawables[2];
    } 
 
    /* 
     * (non-Javadoc) 
     *  
     * @see android.view.View.OnTouchListener#onTouch(android.view.View, android.view.MotionEvent) 
     */ 
    @Override 
    public boolean onTouch(final View v, final MotionEvent event) {
        if (event.getAction() == MotionEvent.ACTION_DOWN && drawable != null) {
            final int x = (int) event.getX();
            final int y = (int) event.getY();
5
CodeRank
This code example shows how to use the following methods:getBottom, getLeft, getPaddingTop, getRight, getScrollX
    private AndroidViewUtils() { 
        throw new AssertionError();
    } 
 
    public static boolean drawDrawables(Canvas canvas, @Nonnull TextView textView) {
        final int compoundPaddingLeft = textView.getCompoundPaddingLeft();
        final int compoundPaddingTop = textView.getCompoundPaddingTop();
        final int compoundPaddingRight = textView.getCompoundPaddingRight();
        final int compoundPaddingBottom = textView.getCompoundPaddingBottom();
 
        final int scrollX = textView.getScrollX();
        final int scrollY = textView.getScrollY();
 
        final int right = textView.getRight();
        final int left = textView.getLeft();
        final int bottom = textView.getBottom();
        final int top = textView.getTop();
 
        final Drawable[] drawables = textView.getCompoundDrawables();
        if (drawables != null) {

4
CodeRank
This code example shows how to use the following methods:getCompoundDrawables
	/** 
	 * @param keyword 
	 */ 
	public RightDrawableOnTouchListener(EditText view) {
		super(); 
		final Drawable[] drawables = view.getCompoundDrawables();
		if (drawables != null && drawables.length == 4)
			this.drawable = drawables[2];
	} 
 
	@Override 
	public boolean onTouch(final View v, final MotionEvent event) {
		if (event.getAction() == MotionEvent.ACTION_DOWN && drawable != null) {
			final int x = (int) event.getX();
			final int y = (int) event.getY();
			final Rect bounds = drawable.getBounds();
			if (x >= (v.getRight() - bounds.width() - fuzz)
					&& x <= (v.getRight() - v.getPaddingRight() + fuzz)
					&& y >= (v.getPaddingTop() - fuzz)
					&& y <= (v.getHeight() - v.getPaddingBottom()) + fuzz) {
5
CodeRank

Related TextView getCompoundDrawables Questions & Answers:

getCompoundDrawables Method Overview
Returns drawables for the left, top, right, and bottom borders.
See Code Examples for other Android TextView Methods: