Drawable setVisible - 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 setVisible 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:setVisible
            // This is a hack to get any animated drawables (like a 'working' spinner) 
            // to animate. You have to setVisible true on an AnimationDrawable to get 
            // it to start animating, but it must first have been false or else the 
            // call to setVisible will be ineffective. We need to clear up the story 
            // about animated drawables in the future, see http://b/1878430. 
            drawable.setVisible(false, false);
            drawable.setVisible(true, false);
        } 
    } 
 
    /** 
     * Gets the text to show in the query field when a suggestion is selected. 
     * 
     * @param cursor The Cursor to read the suggestion data from. The Cursor should already 
     *        be moved to the suggestion that is to be read from. 
     * @return The text to show, or <code>null</code> if the query should not be 
     *         changed when selecting this suggestion. 
     */ 
    @Override 
    public CharSequence convertToString(Cursor cursor) {
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getChangingConfigurations, setVisible
        public final int addChild(Drawable dr) {
            final int pos = mNumChildren;
            if (pos >= mDrawables.length) {
                growArray(pos, pos + 10);
            } 
            dr.setVisible(false, true);
            dr.setCallback(mOwner);
            mDrawables[pos] = dr;
            mNumChildren++;
            mChildrenChangingConfigurations |= dr.getChangingConfigurations();
            mHaveOpacity = false;
            mHaveStateful = false;
            mConstantPadding = null;
            mPaddingChecked = false;
            mComputedConstantSize = false;
            return pos;
        } 
 
        public synchronized boolean canConstantState() { 
            if (!mCheckedConstantState) {
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getIntrinsicHeight, getIntrinsicWidth, setCallback, setState, setVisible
7
CodeRank
Contextual code suggestions in your IDE  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
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setVisible
    @Override 
    public void setVisibility(int visibility) {
        super.setVisibility(visibility);
        final boolean isVisible = visibility == VISIBLE;
        if (mBackground != null) mBackground.setVisible(isVisible, false);
        if (mStackedBackground != null) mStackedBackground.setVisible(isVisible, false);
        if (mSplitBackground != null) mSplitBackground.setVisible(isVisible, false);
    } 
 
    @Override 
    protected boolean verifyDrawable(Drawable who) {
        return (who == mBackground && !mIsSplit) || (who == mStackedBackground && mIsStacked) ||
                (who == mSplitBackground && mIsSplit) || super.verifyDrawable(who);
    } 
 
    @Override 
    protected void drawableStateChanged() { 
        super.drawableStateChanged(); 
        if (mBackground != null && mBackground.isStateful()) {
            mBackground.setState(getDrawableState());
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setVisible
            // This is a hack to get any animated drawables (like a 'working' spinner) 
            // to animate. You have to setVisible true on an AnimationDrawable to get 
            // it to start animating, but it must first have been false or else the 
            // call to setVisible will be ineffective. We need to clear up the story 
            // about animated drawables in the future, see http://b/1878430. 
            drawable.setVisible(false, false);
            drawable.setVisible(true, false);
        } 
    } 
 
    /** 
     * Gets the text to show in the query field when a suggestion is selected. 
     * 
     * @param cursor The Cursor to read the suggestion data from. The Cursor should already 
     *        be moved to the suggestion that is to be read from. 
     * @return The text to show, or <code>null</code> if the query should not be 
     *         changed when selecting this suggestion. 
     */ 
    @Override 
    public CharSequence convertToString(Cursor cursor) {
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setVisible
        return mDrawable.getCurrent();
    } 
 
    @Override 
    public boolean setVisible(boolean visible, boolean restart) {
        return super.setVisible(visible, restart) || mDrawable.setVisible(visible, restart);
    } 
 
    @Override 
    public int getOpacity() { 
        return mDrawable.getOpacity();
    } 
 
    @Override 
    public Region getTransparentRegion() {
        return mDrawable.getTransparentRegion();
    } 
 
    @Override 
    public int getIntrinsicWidth() { 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setAlpha, setBounds, setColorFilter, setDither, setLevel
        final long now = SystemClock.uptimeMillis();
        boolean animating = false;
        if (mCurrDrawable != null) {
            if (mEnterAnimationEnd != 0) {
                if (mEnterAnimationEnd <= now) {
                    mCurrDrawable.setAlpha(mAlpha);
                    mEnterAnimationEnd = 0;
                } else { 
                    int animAlpha = (int) ((mEnterAnimationEnd - now) * 255)
                            / mDrawableContainerState.mEnterFadeDuration;
                    mCurrDrawable.setAlpha((255 - animAlpha) * mAlpha / 255);
                    animating = true;
                } 
            } 
        } else { 
            mEnterAnimationEnd = 0;
        } 
        if (mLastDrawable != null) {
            if (mExitAnimationEnd != 0) {
                if (mExitAnimationEnd <= now) {

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setVisible
            // This is a hack to get any animated drawables (like a 'working' spinner) 
            // to animate. You have to setVisible true on an AnimationDrawable to get 
            // it to start animating, but it must first have been false or else the 
            // call to setVisible will be ineffective. We need to clear up the story 
            // about animated drawables in the future, see http://b/1878430. 
            drawable.setVisible(false, false);
            drawable.setVisible(true, false);
        } 
    } 
 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Drawable setVisible Questions & Answers:

setVisible Method Overview
Set whether this Drawable is visible.
See Code Examples for other Android Drawable Methods: