當前位置: 首頁>>代碼示例>>Java>>正文


Java ImageView.getVisibility方法代碼示例

本文整理匯總了Java中android.widget.ImageView.getVisibility方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageView.getVisibility方法的具體用法?Java ImageView.getVisibility怎麽用?Java ImageView.getVisibility使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.ImageView的用法示例。


在下文中一共展示了ImageView.getVisibility方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateProgress

import android.widget.ImageView; //導入方法依賴的package包/類
private void updateProgress(StepProgress progress, View progressStepContainer) {
    ProgressBar progBar = Ui.findView(progressStepContainer, R.id.spinner);
    ImageView checkmark = Ui.findView(progressStepContainer, R.id.checkbox);

    // don't show the spinner again if we've already shown the checkmark,
    // regardless of the underlying state that might hide
    if (checkmark.getVisibility() == View.VISIBLE) {
        return;
    }

    progressStepContainer.setVisibility(View.VISIBLE);

    if (progress.status == StepProgress.STARTING) {
        checkmark.setVisibility(View.GONE);

        progBar.setProgressDrawable(tintedSpinner);
        progBar.setVisibility(View.VISIBLE);

    } else {
        progBar.setVisibility(View.GONE);

        checkmark.setImageDrawable(tintedCheckmark);
        checkmark.setVisibility(View.VISIBLE);
    }
}
 
開發者ID:Datatellit,項目名稱:xlight_android_native,代碼行數:26,代碼來源:ConnectingActivity.java

示例2: determineSocialIconPlacement

import android.widget.ImageView; //導入方法依賴的package包/類
/**
 * Aligns the Twitter icon the parent bottom right. Aligns the G+ icon to the left of the
 * Twitter icon if it is present. Otherwise, aligns the G+ icon to the parent bottom right.
 */
private void determineSocialIconPlacement(ImageView plusOneIcon, ImageView twitterIcon) {
    if (plusOneIcon.getVisibility() == View.VISIBLE) {
        // Set the dimensions of the G+ button.
        int socialIconDimension = getResources().getDimensionPixelSize(
                R.dimen.social_icon_box_size);
        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
                socialIconDimension, socialIconDimension);
        params.addRule(RelativeLayout.BELOW, R.id.speaker_abstract);
        params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);

        if (twitterIcon.getVisibility() == View.VISIBLE) {
            params.addRule(RelativeLayout.LEFT_OF, R.id.twitter_icon_box);
        } else {
            params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
        }
        plusOneIcon.setLayoutParams(params);
    }
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:23,代碼來源:SessionDetailFragment.java

示例3: avancarTxt

import android.widget.ImageView; //導入方法依賴的package包/類
public void avancarTxt(View view) {
    ImageView imageView44 = (ImageView) findViewById(R.id.imageView44);
    TextView exp2 = (TextView) findViewById(R.id.exp2);
    if(imageView44.getVisibility()==View.VISIBLE) {
        findViewById(R.id.voltar).setVisibility(View.VISIBLE);
        findViewById(R.id.proximo).setVisibility(View.GONE);
        findViewById(R.id.exp2).setVisibility(View.VISIBLE);
        findViewById(R.id.avancar).setVisibility(View.VISIBLE);
        findViewById(R.id.imageView44).setVisibility(View.GONE);
    }else
    if (exp2.getVisibility() == View.VISIBLE) {
        findViewById(R.id.voltar).setVisibility(View.VISIBLE);
        findViewById(R.id.proximo).setVisibility(View.VISIBLE);
        findViewById(R.id.exp3).setVisibility(View.VISIBLE);
        findViewById(R.id.exp2).setVisibility(View.GONE);
        findViewById(R.id.avancar).setVisibility(View.GONE);
        findViewById(R.id.imageView44).setVisibility(View.GONE);


    }
}
 
開發者ID:jvbeltra,項目名稱:JavaIsFun,代碼行數:22,代碼來源:Condicao7.java

示例4: selecionar

import android.widget.ImageView; //導入方法依賴的package包/類
public void selecionar(View view) {
    ImageView incorreto = (ImageView) findViewById(R.id.incorreto);
    ImageView correto = (ImageView) findViewById(R.id.correto);
    if (incorreto.getVisibility() == View.VISIBLE) {
        findViewById(R.id.titulo1).setVisibility(View.GONE);
        findViewById(R.id.titulo2).setVisibility(View.GONE);
        findViewById(R.id.textCorreto).setVisibility(View.VISIBLE);
        findViewById(R.id.wink).setVisibility(View.VISIBLE);
        findViewById(R.id.buttonProx).setVisibility(View.VISIBLE);
        findViewById(R.id.deslizeWarn).setVisibility(View.GONE);
        findViewById(R.id.incorreto).setVisibility(View.GONE);
    } else if (correto.getVisibility() == View.VISIBLE) {
        findViewById(R.id.titulo1).setVisibility(View.GONE);
        findViewById(R.id.titulo2).setVisibility(View.GONE);
        findViewById(R.id.textErrado).setVisibility(View.VISIBLE);
        findViewById(R.id.textErrado2).setVisibility(View.VISIBLE);
        findViewById(R.id.buttonProx).setVisibility(View.VISIBLE);
        findViewById(R.id.deslizeWarn).setVisibility(View.GONE);
        findViewById(R.id.correto).setVisibility(View.GONE);
    }

}
 
開發者ID:jvbeltra,項目名稱:JavaIsFun,代碼行數:23,代碼來源:Scanner7.java

示例5: validView4Callback

import android.widget.ImageView; //導入方法依賴的package包/類
private boolean validView4Callback(boolean forceValidAsyncDrawable) {
    final ImageView view = viewRef.get();
    if (view != null) {
        Drawable otherDrawable = view.getDrawable();
        if (otherDrawable instanceof AsyncDrawable) {
            ImageLoader otherLoader = ((AsyncDrawable) otherDrawable).getImageLoader();
            if (otherLoader != null) {
                if (otherLoader == this) {
                    if (view.getVisibility() != View.VISIBLE) {
                        otherLoader.cancel();
                        return false;
                    } else {
                        return true;
                    }
                } else {
                    if (this.seq > otherLoader.seq) {
                        otherLoader.cancel();
                        return true;
                    } else {
                        this.cancel();
                        return false;
                    }
                }
            }
        } else if (forceValidAsyncDrawable) {
            this.cancel();
            return false;
        }
        return true;
    }
    return false;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:33,代碼來源:ImageLoader.java

示例6: prox

import android.widget.ImageView; //導入方法依賴的package包/類
public void prox(View view) {
    ImageView imageViewtop = (ImageView) findViewById(R.id.corretoerrado);
    ImageView classpeixe = (ImageView) findViewById(R.id.classpeixe);
    ImageView classcachorro = (ImageView) findViewById(R.id.classcachorro);
    ImageView classgato = (ImageView) findViewById(R.id.classgato);
    ImageView classabelha = (ImageView) findViewById(R.id.classabelha);
    TextView erradoabelha = (TextView) findViewById(R.id.erradoAbelha);
    TextView erradocachorro = (TextView) findViewById(R.id.erradoCachorro);
    TextView erradogato = (TextView) findViewById(R.id.erradoGato);
    imageViewtop.setVisibility(View.GONE);
    if (classabelha.getVisibility() == View.VISIBLE || erradoabelha.getVisibility() == View.VISIBLE) {
        findViewById(R.id.classabelha).setVisibility(View.GONE);
        findViewById(R.id.classgato).setVisibility(View.VISIBLE);
        findViewById(R.id.antP).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoAbelha).setVisibility(View.GONE);
        imageViewtop.setVisibility(View.GONE);
    } else if (classgato.getVisibility() == View.VISIBLE || erradogato.getVisibility() == View.VISIBLE) {
        findViewById(R.id.classgato).setVisibility(View.GONE);
        findViewById(R.id.classcachorro).setVisibility(View.VISIBLE);
        findViewById(R.id.antP).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoGato).setVisibility(View.GONE);
        imageViewtop.setVisibility(View.GONE);
    } else if (classcachorro.getVisibility() == View.VISIBLE || erradocachorro.getVisibility() == View.VISIBLE) {
        findViewById(R.id.classcachorro).setVisibility(View.GONE);
        findViewById(R.id.classpeixe).setVisibility(View.VISIBLE);
        findViewById(R.id.proxP).setVisibility(View.GONE);
        findViewById(R.id.antP).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoCachorro).setVisibility(View.GONE);
        imageViewtop.setVisibility(View.GONE);
    }
}
 
開發者ID:jvbeltra,項目名稱:JavaIsFun,代碼行數:32,代碼來源:Classe4.java

示例7: updateTextAndIcon

import android.widget.ImageView; //導入方法依賴的package包/類
private void updateTextAndIcon(@Nullable final TextView textView,
            @Nullable final ImageView iconView) {
  final Drawable icon = mTab != null ? mTab.getIcon() : null;
  final CharSequence text = mTab != null ? mTab.getText() : null;
  final CharSequence contentDesc = mTab != null ? mTab.getContentDescription() : null;

  if (iconView != null) {
    if (icon != null) {
      iconView.setImageDrawable(icon);
      iconView.setVisibility(VISIBLE);
      setVisibility(VISIBLE);
    } else {
      iconView.setVisibility(GONE);
      iconView.setImageDrawable(null);
    }
    iconView.setContentDescription(contentDesc);
  }

  final boolean hasText = !TextUtils.isEmpty(text);
  if (textView != null) {
    if (hasText) {
      textView.setText(text);
      textView.setVisibility(VISIBLE);
      setVisibility(VISIBLE);
    } else {
      textView.setVisibility(GONE);
      textView.setText(null);
    }
    textView.setContentDescription(contentDesc);
  }

  if (iconView != null) {
    MarginLayoutParams lp = ((MarginLayoutParams) iconView.getLayoutParams());
    int bottomMargin = 0;
    if (hasText && iconView.getVisibility() == VISIBLE) {
      // If we're showing both text and icon, add some margin bottom to the icon
      bottomMargin = dpToPx(DEFAULT_GAP_TEXT_ICON);
    }
    if (bottomMargin != lp.bottomMargin) {
      lp.bottomMargin = bottomMargin;
      iconView.requestLayout();
    }
  }
        TooltipCompat.setTooltipText(this, hasText ? null : contentDesc);
}
 
開發者ID:commonsguy,項目名稱:cwac-crossport,代碼行數:46,代碼來源:TabLayoutLite.java

示例8: updateTextAndIcon

import android.widget.ImageView; //導入方法依賴的package包/類
private void updateTextAndIcon(@Nullable TextView textView, @Nullable ImageView iconView) {
    Drawable icon;
    CharSequence text;
    CharSequence contentDesc;
    boolean hasText;
    if (this.mTab != null) {
        icon = this.mTab.getIcon();
    } else {
        icon = null;
    }
    if (this.mTab != null) {
        text = this.mTab.getText();
    } else {
        text = null;
    }
    if (this.mTab != null) {
        contentDesc = this.mTab.getContentDescription();
    } else {
        contentDesc = null;
    }
    if (iconView != null) {
        if (icon != null) {
            iconView.setImageDrawable(icon);
            iconView.setVisibility(0);
            setVisibility(0);
        } else {
            iconView.setVisibility(8);
            iconView.setImageDrawable(null);
        }
        iconView.setContentDescription(contentDesc);
    }
    if (TextUtils.isEmpty(text)) {
        hasText = false;
    } else {
        hasText = true;
    }
    if (textView != null) {
        if (hasText) {
            textView.setText(text);
            textView.setVisibility(0);
            setVisibility(0);
        } else {
            textView.setVisibility(8);
            textView.setText(null);
        }
        textView.setContentDescription(contentDesc);
    }
    if (iconView != null) {
        MarginLayoutParams lp = (MarginLayoutParams) iconView.getLayoutParams();
        int bottomMargin = 0;
        if (hasText && iconView.getVisibility() == 0) {
            bottomMargin = TabLayout.this.dpToPx(8);
        }
        if (bottomMargin != lp.bottomMargin) {
            lp.bottomMargin = bottomMargin;
            iconView.requestLayout();
        }
    }
    if (hasText || TextUtils.isEmpty(contentDesc)) {
        setOnLongClickListener(null);
        setLongClickable(false);
        return;
    }
    setOnLongClickListener(this);
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:66,代碼來源:TabLayout.java

示例9: ant

import android.widget.ImageView; //導入方法依賴的package包/類
public void ant(View view) {
    ImageView imageViewtop = (ImageView) findViewById(R.id.corretoerrado);

    TextView textocorreto = (TextView) findViewById(R.id.textCorreto);
    TextView erradocachorro = (TextView) findViewById(R.id.erradoCachorro);
    TextView erradogato = (TextView) findViewById(R.id.erradoGato);
    ImageView classpeixe = (ImageView) findViewById(R.id.classpeixe);
    ImageView classcachorro = (ImageView) findViewById(R.id.classcachorro);
    ImageView classgato = (ImageView) findViewById(R.id.classgato);
    ImageView classabelha = (ImageView) findViewById(R.id.classabelha);


    if (classgato.getVisibility() == View.VISIBLE || erradogato.getVisibility() == View.VISIBLE) {
        findViewById(R.id.classgato).setVisibility(View.GONE);
        findViewById(R.id.classabelha).setVisibility(View.VISIBLE);
        findViewById(R.id.antP).setVisibility(View.GONE);
        findViewById(R.id.proxP).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoGato).setVisibility(View.GONE);
        findViewById(R.id.erradoCachorro).setVisibility(View.GONE);
        findViewById(R.id.textCorreto).setVisibility(View.GONE);
        findViewById(R.id.erradoAbelha).setVisibility(View.GONE);
        imageViewtop.setVisibility(View.GONE);
    } else if (classcachorro.getVisibility() == View.VISIBLE || erradocachorro.getVisibility() == View.VISIBLE) {
        findViewById(R.id.classcachorro).setVisibility(View.GONE);
        findViewById(R.id.classgato).setVisibility(View.VISIBLE);
        findViewById(R.id.proxP).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoGato).setVisibility(View.GONE);
        findViewById(R.id.erradoCachorro).setVisibility(View.GONE);
        findViewById(R.id.textCorreto).setVisibility(View.GONE);
        findViewById(R.id.erradoAbelha).setVisibility(View.GONE);
        imageViewtop.setVisibility(View.GONE);
    } else if (classpeixe.getVisibility() == View.VISIBLE || textocorreto.getVisibility() == View.VISIBLE) {
        findViewById(R.id.classpeixe).setVisibility(View.GONE);
        findViewById(R.id.classcachorro).setVisibility(View.VISIBLE);
        findViewById(R.id.proxP).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoGato).setVisibility(View.GONE);
        findViewById(R.id.erradoCachorro).setVisibility(View.GONE);
        findViewById(R.id.textCorreto).setVisibility(View.GONE);
        findViewById(R.id.erradoAbelha).setVisibility(View.GONE);
        imageViewtop.setVisibility(View.GONE);

    }

}
 
開發者ID:jvbeltra,項目名稱:JavaIsFun,代碼行數:45,代碼來源:Classe4.java

示例10: verificar

import android.widget.ImageView; //導入方法依賴的package包/類
public void verificar(View view) {
    ImageView imageViewtop = (ImageView) findViewById(R.id.corretoerrado);

    TextView erradoabelha = (TextView) findViewById(R.id.erradoAbelha);
    TextView erradocachorro = (TextView) findViewById(R.id.erradoCachorro);
    TextView erradogato = (TextView) findViewById(R.id.erradoGato);
    TextView textocorreto = (TextView) findViewById(R.id.textCorreto);
    ImageView classpeixe = (ImageView) findViewById(R.id.classpeixe);
    ImageView classcachorro = (ImageView) findViewById(R.id.classcachorro);
    ImageView classgato = (ImageView) findViewById(R.id.classgato);
    ImageView classabelha = (ImageView) findViewById(R.id.classabelha);
    if (classpeixe.getVisibility() == View.VISIBLE) {
        findViewById(R.id.textCorreto).setVisibility(View.VISIBLE);
        findViewById(R.id.imageButton63).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoAbelha).setVisibility(View.GONE);
        findViewById(R.id.erradoGato).setVisibility(View.GONE);
        findViewById(R.id.erradoCachorro).setVisibility(View.GONE);
        findViewById(R.id.classpeixe).setVisibility(View.GONE);
        imageViewtop.setImageResource(R.drawable.happy);
        imageViewtop.setVisibility(View.VISIBLE);
    } else if (classcachorro.getVisibility() == View.VISIBLE) {
        findViewById(R.id.textCorreto).setVisibility(View.GONE);
        findViewById(R.id.imageButton63).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoAbelha).setVisibility(View.GONE);
        findViewById(R.id.erradoGato).setVisibility(View.GONE);
        findViewById(R.id.erradoCachorro).setVisibility(View.VISIBLE);
        findViewById(R.id.classcachorro).setVisibility(View.GONE);
        imageViewtop.setImageResource(R.drawable.sad);
        imageViewtop.setVisibility(View.VISIBLE);
    } else if (classgato.getVisibility() == View.VISIBLE) {
        findViewById(R.id.textCorreto).setVisibility(View.GONE);
        findViewById(R.id.imageButton63).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoAbelha).setVisibility(View.GONE);
        findViewById(R.id.erradoGato).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoCachorro).setVisibility(View.GONE);
        findViewById(R.id.classgato).setVisibility(View.GONE);
        imageViewtop.setImageResource(R.drawable.sad);
        imageViewtop.setVisibility(View.VISIBLE);
    } else if (classabelha.getVisibility() == View.VISIBLE) {
        findViewById(R.id.textCorreto).setVisibility(View.GONE);
        findViewById(R.id.imageButton63).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoAbelha).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoGato).setVisibility(View.GONE);
        findViewById(R.id.erradoCachorro).setVisibility(View.GONE);
        findViewById(R.id.classabelha).setVisibility(View.GONE);
        imageViewtop.setImageResource(R.drawable.sad);
        imageViewtop.setVisibility(View.VISIBLE);
    }
}
 
開發者ID:jvbeltra,項目名稱:JavaIsFun,代碼行數:50,代碼來源:Classe4.java


注:本文中的android.widget.ImageView.getVisibility方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。