Drawable setCallback - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:getIntrinsicHeight, getIntrinsicWidth, setCallback, setState, setVisible
This code example shows how to use the following methods:getIntrinsicHeight, getIntrinsicWidth, isStateful, setBounds, setCallback
 
            mDotDrawable = dotDrawable;
 
            if (dotDrawable != null) {
 
                if (dotDrawable.getIntrinsicHeight() == -1 || dotDrawable.getIntrinsicWidth() == -1) {
                    // Do not accept Drawable with no intrinsic dimensions. 
                    return; 
                } 
 
                dotDrawable.setBounds(0, 0, dotDrawable.getIntrinsicWidth(), dotDrawable.getIntrinsicHeight());
                dotDrawable.setCallback(this);
                if (dotDrawable.isStateful()) {
                    dotDrawable.setState(getDrawableState());
                } 
            } 
 
            requestLayout(); 
            invalidate(); 
        } 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setBounds, setCallback
            mBackground.setCallback(null);
            unscheduleDrawable(mBackground);
        } 
        mBackground = bg;
        if (bg != null) {
            bg.setCallback(this);
            if (mActionBarView != null) {
                mBackground.setBounds(mActionBarView.getLeft(), mActionBarView.getTop(),
                        mActionBarView.getRight(), mActionBarView.getBottom());
            } 
        } 
        setWillNotDraw(mIsSplit ? mSplitBackground == null :
                mBackground == null && mStackedBackground == null);
        invalidate();
    } 
 
    public void setStackedBackground(Drawable bg) {
        if (mStackedBackground != null) {
            mStackedBackground.setCallback(null);
            unscheduleDrawable(mStackedBackground);
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setCallback
	public void releaseDelegate() { 
		if (background != null) {
			if (background instanceof BitmapDrawable) {
				((BitmapDrawable)background).getBitmap().recycle();
			} 
			background.setCallback(null);
			background = null;
		} 
	} 
 
	public void setBackgroundColor(int backgroundColor) {
		//this.background = new ColorDrawable(backgroundColor); 
		releaseDelegate(); 
		this.background = new PaintDrawable(backgroundColor);
	} 
 
	public void setBackgroundImage(Bitmap backgroundImage) {
		releaseDelegate(); 
		this.background = new BitmapDrawable(backgroundImage);
	} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setCallback
    } 
 
    @Override 
    protected void onAttachedToWindow() { 
        super.onAttachedToWindow(); 
        mBackground.setCallback(this);
        setWillNotDraw(false);
    } 
 
    @Override 
    protected void onDetachedFromWindow() { 
        super.onDetachedFromWindow(); 
        mBackground.setCallback(null);
    } 
     
    private void getChildBounds(Rect r) {
        r.left = r.top = Integer.MAX_VALUE;
        r.bottom = r.right = Integer.MIN_VALUE;
        final int N = getChildCount();
        for (int i=0; i<N; i++) {
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getIntrinsicHeight, getIntrinsicWidth, setCallback, setState, setVisible
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setCallback
This code example shows how to use the following methods:setCallback
    public void setBounds(int left, int top, int right, int bottom) { 
        super.setBounds(left + mInsetBoundsSides, top, right - mInsetBoundsSides, bottom); 
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setBounds, setCallback, setVisible
	private final static String TAG="ALD";
 
 
	public void setDelegate(Drawable delegate) {
		this.mCurrDrawable = delegate;
		delegate.setBounds(getBounds());
		if (delegate instanceof Animatable) {
			delegate.setCallback(this);
			delegate.setVisible(true, true);
			((Animatable) delegate).start();
			Log.d("ALD", "Started the bugger");
		} 
	} 
 
	public void onLoad(Drawable delegate) {
		setDelegate(delegate);
		invalidateSelf();
	} 
	 
	public void draw(Canvas canvas) {
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getMinimumHeight, setCallback
        } else { 
            needUpdate = false;
        } 
 
        if (d != null) {
            d.setCallback(this);
 
            // Make sure the ProgressBar is always tall enough 
            int drawableHeight = d.getMinimumHeight();
            if (mMaxHeight < drawableHeight) {
                mMaxHeight = drawableHeight;
                requestLayout();
            } 
        } 
        mProgressDrawable = d;
        if (!mIndeterminate) {
            mCurrentDrawable = d;
            postInvalidate(); 
        } 
 
6
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Drawable setCallback Questions & Answers:

setCallback Method Overview
Bind a Drawable.Callback object to this Drawable.
See Code Examples for other Android Drawable Methods: