ImageView setVisibility - top ranked examples from Open Source projects

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

This code example shows how to use the following methods: getVisibility, setImageDrawable, setVisibility
        if (mIconView == null) {
            insertIconView(); 
        } 
 
        if (icon != null || mPreserveIconSpacing) {
            mIconView.setImageDrawable(showIcon ? icon : null);
 
            if (mIconView.getVisibility() != VISIBLE) {
                mIconView.setVisibility(VISIBLE);
            } 
        } else { 
            mIconView.setVisibility(GONE);
        } 
    } 
 
    @Override 
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        if (mIconView != null && mPreserveIconSpacing) {
            // Enforce minimum icon spacing 
            ViewGroup.LayoutParams lp = getLayoutParams();
Full Snippet Info
9
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: setImageDrawable, setImageResource, setVisibility
        if (mMobileType != null) {
            mMobileType.setImageDrawable(null);
        } 
 
        if(mAirplane != null) {
            mAirplane.setImageDrawable(null);
        } 
 
        apply(); 
    } 
 
    // Run after each indicator change. 
    private void apply() { 
        if (mWifiGroup == null) return;
 
        if (mWifiVisible) {
            mWifi.setImageResource(mWifiStrengthId);
            mWifiActivity.setImageResource(mWifiActivityId);
 
            mWifiGroup.setContentDescription(mWifiDescription);

10
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: setId, setLayoutParams, setVisibility
This code example shows how to use the following methods: getVisibility, setImageDrawable, setVisibility
        if (mIconView == null) {
            insertIconView(); 
        } 
         
        if (icon != null || mPreserveIconSpacing) {
            mIconView.setImageDrawable(showIcon ? icon : null);
 
            if (mIconView.getVisibility() != VISIBLE) {
                mIconView.setVisibility(VISIBLE);
            } 
        } else { 
            mIconView.setVisibility(GONE);
        } 
    } 
     
    @Override 
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        if (mIconView != null && mPreserveIconSpacing) {
            // Enforce minimum icon spacing 
            ViewGroup.LayoutParams lp = getLayoutParams();
Full Snippet Info
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: setId, setTag, setImageDrawable, setScaleType, setVisibility
     * Sets up the status icon, creating it if necessary. 
     */ 
    public void setStatusButton(Drawable icon, int id, long appId) {
        if (icon != null) {
            if (mStatusButton == null) {
                mStatusButton = new ImageView(mContext);
                mStatusButton.setId(id);
                mStatusButton.setScaleType(ScaleType.CENTER);
                addView(mStatusButton);
            } 
            mStatusButton.setImageDrawable(icon);
            mStatusButton.setTag(appId);
            mStatusButton.setVisibility(View.VISIBLE);
        } else { 
            if (mStatusButton != null) {
                mStatusButton.setVisibility(View.GONE);
            } 
        } 
    } 
 
Full Snippet Info
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: setImageBitmap, setVisibility
			if (isCancelled())
				return; 
			 
			ImageView imgView = imgViewRef.get();
 
			if (imgView != null && AsyncDrawable.getTask(imgView) == this) { //make sure the ImageView instance has not been reused for another page
				if (result != null) {
					imgView.setImageBitmap(result);
					imgView.setVisibility(View.VISIBLE);
				} 
 
				ProgressBar bar = getProgressBar();
				if (bar != null)
					bar.setVisibility(View.GONE);
				 
				FlipViewController controller = controllerRef.get();
				if (controller != null)
					controller.refreshPage(pageIndex);
			}			 
		} 
Full Snippet Info
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: getVisibility, setImageDrawable, setVisibility
        if (mIconView == null) {
            insertIconView(); 
        } 
 
        if (icon != null || mPreserveIconSpacing) {
            mIconView.setImageDrawable(showIcon ? icon : null);
 
            if (mIconView.getVisibility() != VISIBLE) {
                mIconView.setVisibility(VISIBLE);
            } 
        } else { 
            mIconView.setVisibility(GONE);
        } 
    } 
 
    @Override 
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        if (mIconView != null && mPreserveIconSpacing) {
            // Enforce minimum icon spacing 
            ViewGroup.LayoutParams lp = getLayoutParams();
Full Snippet Info
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: setImageDrawable, setVisibility
        TextView tv = (TextView) view.findViewById(mTextId);
        View separator = view.findViewById(mSeparatorId);
 
        if (!isEnabled(position)) {
            if (iv != null) {
                iv.setVisibility(View.GONE);
            } 
            if (tv != null) {
                tv.setVisibility(View.GONE);
            } 
            if (separator != null) {
                separator.setVisibility(View.VISIBLE);
            } 
        } else { 
            if (separator != null) {
                separator.setVisibility(View.GONE);
            } 
            final ImageListItem item = mData.get(position);
            if (iv != null) {
                iv.setVisibility(View.VISIBLE);

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: getVisibility, setImageDrawable, setVisibility
        if (mIconView == null) {
            insertIconView(); 
        } 
 
        if (icon != null || mPreserveIconSpacing) {
            mIconView.setImageDrawable(showIcon ? icon : null);
 
            if (mIconView.getVisibility() != VISIBLE) {
                mIconView.setVisibility(VISIBLE);
            } 
        } else { 
            mIconView.setVisibility(GONE);
        } 
    } 
 
    @Override 
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        if (mIconView != null && mPreserveIconSpacing) {
            // Enforce minimum icon spacing 
            ViewGroup.LayoutParams lp = getLayoutParams();
Full Snippet Info
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: setImageDrawable, setVisibility
		r = (RelativeLayout) r.getChildAt(0);
		ImageView i = (ImageView) r.getChildAt(0);
		if (image == null) {
			i.setVisibility(View.GONE);
		} else { 
			i.setVisibility(View.VISIBLE);
			i.setImageDrawable(image);
		} 
		TextView t = (TextView) r.getChildAt(1);
		t.setText(text);
		showNext();
	} 
 
	/** 
	 * Sets the text of the text view that is currently showing.  This does 
	 * not perform the animations. 
	 * 
	 * @param text the new text to display 
	 */ 
	public void setCurrentText(CharSequence text, Drawable image) {
Full Snippet Info
7
CodeRank
Experience pair programming with AI  Get Codota for Java

Related ImageView setVisibility Questions & Answers:

Other ImageView setVisibility Examples

198:				videoPreview.setVisibility(View.GONE);
199:	
200:				imgPreview.setVisibility(View.VISIBLE);
201:	
202:				// bimatp factory
-
222:			try {
223:				// hide image preview
224:				imgPreview.setVisibility(View.GONE);
225:	
226:				videoPreview.setVisibility(View.VISIBLE);

Read More

54:	        
55:	        imgIcon.setImageResource(spinnerNavItem.get(position).getIcon());
56:	        imgIcon.setVisibility(View.GONE);
57:	        txtTitle.setText(spinnerNavItem.get(position).getTitle());
58:	        return convertView;

Read More

setVisibility Method Overview
Set the enabled state of this view.
See Code Examples for other Android ImageView Methods: