本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}