本文整理匯總了Java中android.widget.ImageView.setVisibility方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageView.setVisibility方法的具體用法?Java ImageView.setVisibility怎麽用?Java ImageView.setVisibility使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.ImageView
的用法示例。
在下文中一共展示了ImageView.setVisibility方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: verifCorreto
import android.widget.ImageView; //導入方法依賴的package包/類
public void verifCorreto(View view) {
imageView = (ImageView) findViewById(R.id.wink);
imageView.setImageResource(R.drawable.happy);
imageView.setVisibility(View.VISIBLE);
findViewById(R.id.textCorreto).setVisibility(View.VISIBLE);
findViewById(R.id.enunciado).setVisibility(View.GONE);
findViewById(R.id.buttonErrado3).setVisibility(View.GONE);
findViewById(R.id.buttonErrado2).setVisibility(View.GONE);
findViewById(R.id.buttonErrado1).setVisibility(View.GONE);
findViewById(R.id.buttonCorreto).setVisibility(View.GONE);
findViewById(R.id.buttonNext).setVisibility(View.VISIBLE);
findViewById(R.id.vmsPrati).setVisibility(View.GONE);
findViewById(R.id.atividade).setVisibility(View.GONE);
findViewById(R.id.space).setVisibility(View.GONE);
}
示例2: createCrossImage
import android.widget.ImageView; //導入方法依賴的package包/類
private void createCrossImage() {
crossImageView = new ImageView(getContext());
// Dismiss the dialog when user click on the 'x'
crossImageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
sendCancelToListener();
WebDialog.this.dismiss();
}
});
Drawable crossDrawable = getContext().getResources().getDrawable(R.drawable.com_facebook_close);
crossImageView.setImageDrawable(crossDrawable);
/* 'x' should not be visible while webview is loading
* make it visible only after webview has fully loaded
*/
crossImageView.setVisibility(View.INVISIBLE);
}
示例3: onCreate
import android.widget.ImageView; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
topContentView = (ViewGroup) LayoutInflater.from(getActivity()).inflate(R.layout.tt_fragment_base, null);
topBar = (ViewGroup) topContentView.findViewById(R.id.topbar);
topTitleTxt = (TextView) topContentView.findViewById(R.id.base_fragment_title);
topLetTitleTxt = (TextView) topContentView.findViewById(R.id.left_txt);
topRightTitleTxt = (TextView) topContentView.findViewById(R.id.right_txt);
topLeftBtn = (ImageView) topContentView.findViewById(R.id.left_btn);
topRightBtn = (ImageView) topContentView.findViewById(R.id.right_btn);
topContactTitle = (TopTabButton) topContentView.findViewById(R.id.contact_tile);
topSearchEdt = (SearchEditText) topContentView.findViewById(R.id.chat_title_search);
topLeftContainerLayout=(RelativeLayout)topContentView.findViewById(R.id.top_left_container);
searchFrameLayout = (FrameLayout)topContentView.findViewById(R.id.searchbar);
topContactFrame = (FrameLayout)topContentView.findViewById(R.id.contactTopBar);
topTitleTxt.setVisibility(View.GONE);
topRightBtn.setVisibility(View.GONE);
topLeftBtn.setVisibility(View.GONE);
topLetTitleTxt.setVisibility(View.GONE);
topRightTitleTxt.setVisibility(View.GONE);
topContactTitle.setVisibility(View.GONE);
topSearchEdt.setVisibility(View.GONE);
}
示例4: getView
import android.widget.ImageView; //導入方法依賴的package包/類
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// Inflate our row and find our views!
View rowItem = mInflater.inflate(R.layout.li_friend, parent, false);
ImageView img = rowItem.findViewById(R.id.li_friend_img);
TextView name = rowItem.findViewById(R.id.li_name_tv);
ImageView vader = rowItem.findViewById(R.id.li_starwars_img);
// Getting the data for this specific row!
Friend friend = getItem(position);
name.setText(friend.getName());
Picasso.with(mContext).load(friend.getImageUrl()).into(img);
if (friend.isAStarWarsLover()) {
vader.setVisibility(View.VISIBLE);
}
return rowItem;
}
示例5: startEditMode
import android.widget.ImageView; //導入方法依賴的package包/類
private void startEditMode(RecyclerView parent) {
this.isEditMode = true;
int childCount = parent.getChildCount();
for (int i = 0; i < childCount; i++) {
View view = parent.getChildAt(i);
if (view != null) {
ImageView imgEdit = (ImageView) view.findViewById(R.id.edit_tip);
RelativeLayout layout = (RelativeLayout) view.findViewById(R.id.item_group_id);
if (layout != null) {
layout.setBackgroundResource(R.drawable.channel_wall_item_selecter_bg);
}
if (imgEdit != null) {
if (((Integer) imgEdit.getTag()).intValue() == 0) {
imgEdit.setBackgroundResource(2130837812);
} else {
imgEdit.setBackgroundResource(2130837811);
}
imgEdit.setVisibility(0);
}
}
}
}
示例6: setNameIconView
import android.widget.ImageView; //導入方法依賴的package包/類
private static void setNameIconView(ChatRoomMessage message, ImageView nameIconView) {
final String KEY = "type";
Map<String, Object> ext = message.getRemoteExtension();
if (ext == null || !ext.containsKey(KEY)) {
nameIconView.setVisibility(View.GONE);
return;
}
MemberType type = MemberType.typeOfValue((Integer) ext.get(KEY));
if (type == MemberType.ADMIN) {
nameIconView.setImageResource(R.drawable.admin_icon);
nameIconView.setVisibility(View.VISIBLE);
} else if (type == MemberType.CREATOR) {
nameIconView.setImageResource(R.drawable.master_icon);
nameIconView.setVisibility(View.VISIBLE);
} else {
nameIconView.setVisibility(View.GONE);
}
}
示例7: onBindDialogView
import android.widget.ImageView; //導入方法依賴的package包/類
@Override
protected void onBindDialogView(View view) {
super.onBindDialogView(view);
final ImageView iconView = (ImageView) view.findViewById(R.id.icon);
if (mMyIcon != null) {
iconView.setImageDrawable(mMyIcon);
} else {
iconView.setVisibility(View.GONE);
}
}
示例8: setViewImage
import android.widget.ImageView; //導入方法依賴的package包/類
private void setViewImage(ImageView v, Integer value) {
if (value == 0)
return;
if (value == -1)
v.setVisibility(View.INVISIBLE);
else {
v.setImageResource(value);
v.setVisibility(View.VISIBLE);
}
}
示例9: setImageOrSensitive
import android.widget.ImageView; //導入方法依賴的package包/類
private void setImageOrSensitive(String url, ImageView imageView, boolean sensitiveContent) {
if (!sensitiveContent) {
Glide
.with(parentCtx)
.load(url)
.crossFade()
.into(imageView);
} else {
imageView.setImageDrawable(new ColorDrawable(Color.GRAY));
}
imageView.setVisibility(View.VISIBLE);
}
示例10: clearImageViews
import android.widget.ImageView; //導入方法依賴的package包/類
void clearImageViews() {
for (int index = 0; index < imageCount; index++) {
final ImageView imageView = imageViews[index];
if (imageView != null) {
imageView.setVisibility(GONE);
}
}
imageCount = 0;
}
示例11: initView
import android.widget.ImageView; //導入方法依賴的package包/類
private void initView() {
pollId = getIntent().getLongExtra("pollId", 0);
content = DbManager.getInstance().getPollDetails(pollId);
ivBack = (ImageView) findViewById(R.id.ivBack);
ivNext = (ImageView) findViewById(R.id.ivNext);
tvHeader = (TextView) findViewById(R.id.tvHeader);
ivNext.setVisibility(View.INVISIBLE);
tvHeader.setText("Poll Response");
tvExpiryTime = (TextView) findViewById(R.id.tvExpiryTime);
tvPollQuestion = (TextView) findViewById(R.id.tvPollQuestion);
tvOptionOne = (TextView) findViewById(R.id.tvOptionOne);
tvOptionTwo = (TextView) findViewById(R.id.tvOptionTwo);
tvOptionThree = (TextView) findViewById(R.id.tvOptionThree);
tvOptionFour = (TextView) findViewById(R.id.tvOptionFour);
btnRespond = (Button) findViewById(R.id.btnRespond);
llOptions= (LinearLayout) findViewById(R.id.llOptions);
llCheckbox = (LinearLayout) findViewById(R.id.llCheckbox);
llRadioButton = (LinearLayout) findViewById(R.id.llRadioButton);
rgOptions = (RadioGroup) findViewById(R.id.rgOptions);
rdOptionOne = (RadioButton) findViewById(R.id.rdOptionOne);
rdOptionTwo = (RadioButton) findViewById(R.id.rdOptionTwo);
rdOptionThree = (RadioButton) findViewById(R.id.rdOptionThree);
rdOptionFour = (RadioButton) findViewById(R.id.rdOptionFour);
cbOptionOne = (CheckBox) findViewById(R.id.cbOptionOne);
cbOptionTwo = (CheckBox) findViewById(R.id.cbOptionTwo);
cbOptionThree = (CheckBox) findViewById(R.id.cbOptionThree);
cbOptionFour = (CheckBox) findViewById(R.id.cbOptionFour);
tvYourResponse = (TextView) findViewById(R.id.tvYourResponse);
etDescriptive = (EditText) findViewById(R.id.etDescriptive);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.hide();
}
}
示例12: updateIndicator
import android.widget.ImageView; //導入方法依賴的package包/類
public void updateIndicator(int count) {
if(dotViews == null){
return;
}
for(int i = 0 ; i < dotViews.size() ; i++){
if(i >= count){
dotViews.get(i).setVisibility(GONE);
((View)dotViews.get(i).getParent()).setVisibility(GONE);
}
else {
dotViews.get(i).setVisibility(VISIBLE);
((View)dotViews.get(i).getParent()).setVisibility(VISIBLE);
}
}
if(count > dotViews.size()){
int diff = count - dotViews.size();
for(int i = 0 ; i < diff ; i++){
RelativeLayout rl = new RelativeLayout(context);
LayoutParams params = new LayoutParams(dotHeight,dotHeight);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
ImageView imageView = new ImageView(context);
imageView.setImageBitmap(unselectedBitmap);
rl.addView(imageView, layoutParams);
rl.setVisibility(View.GONE);
imageView.setVisibility(View.GONE);
this.addView(rl, params);
dotViews.add(imageView);
}
}
}
示例13: onPostExecute
import android.widget.ImageView; //導入方法依賴的package包/類
@Override
protected final void onPostExecute(@NonNull final ImageView view, @Nullable final Bitmap data,
@NonNull final TabItem... params) {
view.setImageBitmap(data);
view.setVisibility(data != null ? View.VISIBLE : View.GONE);
TabItem tabItem = params[0];
childViewRecycler.remove(tabItem.getTab());
}
示例14: verif
import android.widget.ImageView; //導入方法依賴的package包/類
public void verif(View view){
findViewById(R.id.imageButton114).setVisibility(View.VISIBLE);
findViewById(R.id.button7).setVisibility(View.GONE);
FlexboxLayout flexboxLayout = (FlexboxLayout) findViewById(R.id.flexTop);
int count = flexboxLayout.getChildCount();
int laco=0;
for(int i =0;i<count;i++){
View v = flexboxLayout.getChildAt(i);
laco++;
if(laco==1){
if(v==findViewById(R.id.button28)){
cont++;
}
}else if(laco==2){
if(v==findViewById(R.id.button19)){
cont++;
}
}else if(laco==3){
if(v==findViewById(R.id.button23)){
cont++;
}
}else if(laco==4){
if(v==findViewById(R.id.button21)){
cont++;
}
}else if(laco==5){
if(v==findViewById(R.id.button25)){
cont++;
}
}else if(laco==6){
if(v==findViewById(R.id.button22)){
cont++;
}
}else if(laco==7){
if(v==findViewById(R.id.button24)){
cont++;
}
}
}
ImageView imageView = (ImageView) findViewById(R.id.imageView63);
if(cont>=7){
findViewById(R.id.textView248).setVisibility(View.VISIBLE);
findViewById(R.id.textView249).setVisibility(View.GONE);
imageView.setVisibility(View.VISIBLE);
findViewById(R.id.flexDown).setVisibility(View.GONE);
}else{
findViewById(R.id.textView248).setVisibility(View.GONE);
imageView.setImageResource(R.drawable.sad);
imageView.setVisibility(View.VISIBLE);
findViewById(R.id.textView249).setVisibility(View.VISIBLE);
findViewById(R.id.flexDown).setVisibility(View.GONE);
}
}
示例15: make
import android.widget.ImageView; //導入方法依賴的package包/類
/**
* Make a themed toast with text, icon, toastBackground and the tint color.
*
* @param context The context to use. Usually your {@link android.app.Application}
* or {@link android.app.Activity} object.
* @param text The text to show. Can be formatted text.
* @param icon The toast icon to show.
* @param tintColor The toast tint color based on the toastBackground. It will
* automatically check for the contrast to provide best
* visibility.
* @param backgroundColor The toast toastBackground color.
* @param duration How long to display the message. Either
* {@link Toast#LENGTH_SHORT} or {@link Toast#LENGTH_LONG}.
*
* @return Toast with the supplied parameters. Use {@link Toast#show()}
* to display the toast.
*/
public static @NonNull Toast make(@NonNull Context context, @Nullable CharSequence text,
@Nullable Drawable icon, @ColorInt int tintColor,
@ColorInt int backgroundColor, int duration) {
final Toast toast = new Toast(context);
final View toastLayout = LayoutInflater.from(context).inflate(
R.layout.adt_layout_toast, new LinearLayout(context), false);
final ImageView toastIcon = toastLayout.findViewById(R.id.adt_toast_icon);
final TextView toastText = toastLayout.findViewById(R.id.adt_toast_text);
tintColor = DynamicColorUtils.getContrastColor(tintColor, backgroundColor);
if (icon != null && !disableIcon) {
if (iconSize != ADT_DEFAULT_ICON_SIZE) {
toastIcon.getLayoutParams().width = iconSize;
toastIcon.getLayoutParams().height = iconSize;
toastIcon.requestLayout();
}
toastIcon.setColorFilter(tintColor);
toastIcon.setImageDrawable(icon);
} else {
toastIcon.setVisibility(View.GONE);
}
if (textTypeface != null) {
toastText.setTypeface(textTypeface);
}
if (textSize != ADT_DEFAULT_TEXT_SIZE) {
toastText.setTextSize(TypedValue.COMPLEX_UNIT_SP, textSize);
}
toastText.setTextColor(tintColor);
toastText.setText(text);
if (toastBackground != null) {
DynamicDrawableUtils.setBackground(toastLayout,
DynamicDrawableUtils.colorizeDrawable(toastBackground,
backgroundColor, PorterDuff.Mode.MULTIPLY));
} else {
DynamicDrawableUtils.setBackground(toastLayout,
DynamicDrawableUtils.colorizeDrawable(
ContextCompat.getDrawable(context, R.drawable.adt_toast_frame),
backgroundColor, PorterDuff.Mode.MULTIPLY));
}
toast.setDuration(duration);
toast.setView(toastLayout);
return toast;
}